// Path: src/main/java/hu/mta/sztaki/lpds/cloud/simulator/util/SeedSyncer.java
// public class SeedSyncer {
// 	/**
// 	 * The random generator that will be used by the system components and that
// 	 * is recommended to be used by simulations built on top of DISSECT-CF
// 	 */
// 	public static final Random centralRnd;
// 	/**
// 	 * The random seed for the central random generator.
// 	 * 
// 	 * To set this seed, you must define the system property of
// 	 * "hu.mta.sztaki.lpds.cloud.simulator.util.SeedSyncer.seed" before running
// 	 * any simulations.
// 	 */
// 	public static final int seed;
// 
// 	static {
// 		String seedText = System.getProperty("hu.mta.sztaki.lpds.cloud.simulator.util.SeedSyncer.seed");
// 		if (seedText == null) {
// 			seed = 1;
// 		} else {
// 			seed = Integer.parseInt(seedText);
// 		}
// 		centralRnd = new Random(seed);
// 	}
// 
// 	/**
// 	 * To restart the simulator's random generator
// 	 */
// 	public static void resetCentral() {
// 		centralRnd.setSeed(seed);
// 	}
// }


import hu.mta.sztaki.lpds.cloud.simulator.util.SeedSyncer;
/*
 *  ========================================================================
 *  DIScrete event baSed Energy Consumption simulaTor 
 *    					             for Clouds and Federations (DISSECT-CF)
 *  ========================================================================
 *  
 *  This file is part of DISSECT-CF.
 *  
 *  DISSECT-CF is free software: you can redistribute it and/or modify it
 *  under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or (at
 *  your option) any later version.
 *  
 *  DISSECT-CF is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
 *  General Public License for more details.
 *  
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with DISSECT-CF.  If not, see <http://www.gnu.org/licenses/>.
 *  
 *  (C) Copyright 2014, Gabor Kecskemeti (gkecskem@dps.uibk.ac.at,
 *   									  kecskemeti.gabor@sztaki.mta.hu)
 */

package hu.mta.sztaki.lpds.cloud.simulator.io;


/**
 * Represents arbitrary data fragments (e.g. files) to be stored in a
 * repository. Also useful for modeling file transfers.
 * 
 * @author "Gabor Kecskemeti, Distributed and Parallel Systems Group, University
 *         of Innsbruck (c) 2013" "Gabor Kecskemeti, Laboratory of Parallel and
 *         Distributed Systems, MTA SZTAKI (c) 2012"
 */
public class StorageObject {
	// TODO: think about if it would make things easier if we would refer here
	// the repository where this storage object is stored.

	/**
	 * the identifier of the storage object. This might not be unique
	 * everywhere. It is the user's responsibility to keep it unique with the
	 * newcopy function.
	 */
	public final String id;
	/**
	 * The actual size of the object. This is immutable, if a storage object
	 * needs to increase in size in a repository, it is recommended to replace
	 * it with a bigger one while holding the same name.
	 * 
	 * unit: bytes
	 */
	public final long size;

	/**
	 * Allows the creation of the storage object with unknown size (the
	 * simulator will pick a random one!
	 * 
	 * @param myid
	 *            the id of the new storage object
	 */
	public StorageObject(final String myid) {
		id = myid;
// Path: src/main/java/hu/mta/sztaki/lpds/cloud/simulator/util/SeedSyncer.java
// public class SeedSyncer {
// 	/**
// 	 * The random generator that will be used by the system components and that
// 	 * is recommended to be used by simulations built on top of DISSECT-CF
// 	 */
// 	public static final Random centralRnd;
// 	/**
// 	 * The random seed for the central random generator.
// 	 * 
// 	 * To set this seed, you must define the system property of
// 	 * "hu.mta.sztaki.lpds.cloud.simulator.util.SeedSyncer.seed" before running
// 	 * any simulations.
// 	 */
// 	public static final int seed;
// 
// 	static {
// 		String seedText = System.getProperty("hu.mta.sztaki.lpds.cloud.simulator.util.SeedSyncer.seed");
// 		if (seedText == null) {
// 			seed = 1;
// 		} else {
// 			seed = Integer.parseInt(seedText);
// 		}
// 		centralRnd = new Random(seed);
// 	}
// 
// 	/**
// 	 * To restart the simulator's random generator
// 	 */
// 	public static void resetCentral() {
// 		centralRnd.setSeed(seed);
// 	}
// }


// Path: src/main/java/hu/mta/sztaki/lpds/cloud/simulator/io/StorageObject.java
import hu.mta.sztaki.lpds.cloud.simulator.util.SeedSyncer;

/*
 *  ========================================================================
 *  DIScrete event baSed Energy Consumption simulaTor 
 *    					             for Clouds and Federations (DISSECT-CF)
 *  ========================================================================
 *  
 *  This file is part of DISSECT-CF.
 *  
 *  DISSECT-CF is free software: you can redistribute it and/or modify it
 *  under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or (at
 *  your option) any later version.
 *  
 *  DISSECT-CF is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
 *  General Public License for more details.
 *  
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with DISSECT-CF.  If not, see <http://www.gnu.org/licenses/>.
 *  
 *  (C) Copyright 2014, Gabor Kecskemeti (gkecskem@dps.uibk.ac.at,
 *   									  kecskemeti.gabor@sztaki.mta.hu)
 */

package hu.mta.sztaki.lpds.cloud.simulator.io;


/**
 * Represents arbitrary data fragments (e.g. files) to be stored in a
 * repository. Also useful for modeling file transfers.
 * 
 * @author "Gabor Kecskemeti, Distributed and Parallel Systems Group, University
 *         of Innsbruck (c) 2013" "Gabor Kecskemeti, Laboratory of Parallel and
 *         Distributed Systems, MTA SZTAKI (c) 2012"
 */
public class StorageObject {
	// TODO: think about if it would make things easier if we would refer here
	// the repository where this storage object is stored.

	/**
	 * the identifier of the storage object. This might not be unique
	 * everywhere. It is the user's responsibility to keep it unique with the
	 * newcopy function.
	 */
	public final String id;
	/**
	 * The actual size of the object. This is immutable, if a storage object
	 * needs to increase in size in a repository, it is recommended to replace
	 * it with a bigger one while holding the same name.
	 * 
	 * unit: bytes
	 */
	public final long size;

	/**
	 * Allows the creation of the storage object with unknown size (the
	 * simulator will pick a random one!
	 * 
	 * @param myid
	 *            the id of the new storage object
	 */
	public StorageObject(final String myid) {
		id = myid;
		size = 500000000L + (long) (SeedSyncer.centralRnd.nextDouble() * 19500000000L);