syne_tune.backend.simulator_backend.time_keeper module

class syne_tune.backend.simulator_backend.time_keeper.SimulatedTimeKeeper[source]

Bases: TimeKeeper

Here, time is simulated. It needs to be advanced explicitly.

In addition, mark_exit() and real_time_since_last_recent_exit() are used to measure real time spent outside the backend (i.e., in the tuner loop and scheduler). Namely, every method of SimulatorBackend calls mark_exit() before leaving, and real_time_since_last_recent_exit() at the start, advancing the time counter accordingly.

property start_time_stamp: datetime
Returns:

Time stamp (datetime) of (last recent) call of start_of_time

start_of_time()[source]

Called at the start of the experiment. Can be called multiple times if several experiments are run in sequence.

time()[source]
Return type:

float

Returns:

Time elapsed since the start of the experiment

time_stamp()[source]
Return type:

datetime

Returns:

Timestamp (datetime) corresponding to time()

advance(step)[source]

Advance time by step. For real time, this means we sleep for step seconds.

advance_to(to_time)[source]
mark_exit()[source]
real_time_since_last_recent_exit()[source]
Return type:

float