Skip to content

spaceteams.SC_Compute_Server.SimGlobals.SimClock

Freeze

Freeze() -> None

Freezes the simulation clock. This function sets the sim timescale to 0, which halts the counting of wall time towards sim time, effectively pausing the simulation.

GetTimeNow

GetTimeNow() -> spaceteams.SC_Compute_Server.timestamp

Retrieves the current simulation time. This function returns the current time of the simulation clock as an object of type 'sc_tai_time'

Returns: The current time in 'sc_tai_time' format

GetTimescale

GetTimescale() -> float

Retrieves the current time scaling factor of the simulation. This function returns the current time scaling factor which determines how simulation time relates to real (wall clock) time. A value of 1.0 would mean they are the same, A value greater than 1 would mean the simulation time is faster than real time. A value of zero would mean time freezes (but the simulation Functionality still runs). Negative values are allowed as well.

Return: The current time scaling factor as a 'double'

ResetTo

ResetTo(setClockTo: timestamp) -> None

Resets clock to a specific time, and freeze simclock. This function resets the simulation clock to the given ‘setClockTo’ time.

SetTimescale

SetTimescale(timescale: SupportsFloat) -> None

Set simulation timescale. This is the ratio of time passage per wall time passage

UnFreeze

UnFreeze() -> None

Unfreezes the simulation clock, using the last non-zero timescale.