Package haizea :: Package core :: Module manager :: Class SimulatedClock
[hide private]
[frames] | no frames]

Class SimulatedClock

source code


Simulates the passage of time... really fast.

The simulated clock steps through time to produce an ideal schedule. See the run() function for a description of how time is incremented exactly in the simulated clock.

Instance Methods [hide private]
 
__init__(self, manager, starttime)
Initialize the simulated clock, starting at the provided starttime
source code
 
get_time(self)
See docstring in base Clock class.
source code
 
get_start_time(self)
See docstring in base Clock class.
source code
 
get_next_schedulable_time(self)
See docstring in base Clock class.
source code
 
run(self)
Runs the simulated clock through time.
source code
 
__get_next_time(self)
Determines what is the next point in time to skip to.
source code
 
__get_trace_frontend(self)
Gets the tracefile frontend from the resource manager
source code

Inherited from Clock: stop

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, manager, starttime)
(Constructor)

source code 

Initialize the simulated clock, starting at the provided starttime

Overrides: object.__init__

get_time(self)

source code 

See docstring in base Clock class.

Overrides: Clock.get_time

get_start_time(self)

source code 

See docstring in base Clock class.

Overrides: Clock.get_start_time

get_next_schedulable_time(self)

source code 

See docstring in base Clock class.

Overrides: Clock.get_next_schedulable_time

run(self)

source code 

Runs the simulated clock through time.

The clock starts at the provided start time. At each point in time, it wakes up the resource manager and then skips to the next time where "something" is happening (see __get_next_time for a more rigorous description of this).

The clock stops when there is nothing left to do (no pending or queue requests, and no future reservations)

The simulated clock can only work in conjunction with the tracefile request frontend.

Overrides: Clock.run

__get_next_time(self)

source code 

Determines what is the next point in time to skip to.

At a given point in time, the next time is the earliest of the following: * The arrival of the next lease request * The start or end of a reservation (a "changepoint" in the slot table) * A premature end of a lease