lbg.simulator
Class SimulatorEnvironment
java.lang.Object
lbg.simulator.SimulatorEnvironment
- All Implemented Interfaces:
- ISimulator
public class SimulatorEnvironment
- extends java.lang.Object
- implements ISimulator
- Author:
- Cyril Briquet
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SimulatorEnvironment
public SimulatorEnvironment(Simulator sim,
java.util.Properties scenario_props,
java.lang.String scenario_filename)
throws GridException
- Throws:
GridException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
scenario
public Scenario scenario()
extraSelfEvents
public long extraSelfEvents()
eventList
public EventList eventList()
controller
public EnvironmentController controller()
activateLocalScheduling
public void activateLocalScheduling()
throws GridException
- Throws:
GridException
addJobSubmission
public void addJobSubmission(UserAgent user,
java.lang.String peer_id)
throws GridException
- ISimulator implementation.
- Specified by:
addJobSubmission
in interface ISimulator
- Throws:
GridException
createPeerResources
public static SimulatedResource[] createPeerResources(InternalPeerHandle owner_peer,
int peer_power,
int res_count,
int lo_power,
int hi_power,
int cache_capacity,
int mtbf,
EventList event_list)
throws GridException
- Creates Resources for target Peer.
Power repartition between Resources depends on PEER_POWER, RES_COUNT,
RES_POWER_LO, RES_POWER_HI..
Power repartition algorithm:
if (res_count == 0) {
// random number of Resources, variable Resource power (in [lo..hi])
}
else if (res_count > 0) {
if (peer_power > 0) {
// fixed number of Resources, fixed Resource power (= peer_power / res_count)
}
else if (peer_power == 0) {
// fixed number of Resources, variable Resource power (in [lo..hi])
}
}
- Throws:
GridException
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.