SimTimestep

Python class corresponding to the GridWorks type sim.timestep.000 (VersionedTypeName).

class gridworks.types.SimTimestep(*, FromGNodeAlias, FromGNodeInstanceId, TimeUnixS, TimestepCreatedMs, MessageId, TypeName='sim.timestep', Version='000')

Sent by TimeCoordinators to coordinate time.

For simulated actors, time progresses discretely on receipt of these time steps.

Parameters:
  • FromGNodeAlias (str) –

  • FromGNodeInstanceId (str) –

  • TimeUnixS (int) –

  • TimestepCreatedMs (int) –

  • MessageId (str) –

  • TypeName (Literal['sim.timestep']) –

  • Version (str) –

FromGNodeAlias:
  • Description: The GNodeAlias of the sender. The sender should always be a GNode Actor of role TimeCoordinator.

  • Format: LeftRightDot

FromGNodeInstanceId:
  • Description: The GNodeInstanceId of the sender

  • Format: UuidCanonicalTextual

TimeUnixS:
  • Description: Current time in unix seconds

  • Format: ReasonableUnixTimeS

TimestepCreatedMs:
  • Description: The real time created, in unix milliseconds

  • Format: ReasonableUnixTimeMs

MessageId:
  • Description: MessageId

  • Format: UuidCanonicalTextual

class gridworks.types.sim_timestep.check_is_reasonable_unix_time_s(v)

ReasonableUnixTimeS format: time in unix seconds between Jan 1 2000 and Jan 1 3000

Raises:

ValueError – if not ReasonableUnixTimeS format

Parameters:

v (int) –

class gridworks.types.sim_timestep.check_is_uuid_canonical_textual(v)

UuidCanonicalTextual format: A string of hex words separated by hyphens of length 8-4-4-4-12.

Raises:

ValueError – if not UuidCanonicalTextual format

Parameters:

v (str) –

class gridworks.types.sim_timestep.check_is_left_right_dot(v)

LeftRightDot format: Lowercase alphanumeric words separated by periods, most significant word (on the left) starting with an alphabet character.

Raises:

ValueError – if not LeftRightDot format

Parameters:

v (str) –

class gridworks.types.sim_timestep.check_is_reasonable_unix_time_ms(v)

ReasonableUnixTimeMs format: time in unix milliseconds between Jan 1 2000 and Jan 1 3000

Raises:

ValueError – if not ReasonableUnixTimeMs format

Parameters:

v (str) –

class gridworks.types.SimTimestep_Maker(from_g_node_alias, from_g_node_instance_id, time_unix_s, timestep_created_ms, message_id)
Parameters:
  • from_g_node_alias (str) –

  • from_g_node_instance_id (str) –

  • time_unix_s (int) –

  • timestep_created_ms (int) –

  • message_id (str) –

classmethod tuple_to_type(tuple)

Given a Python class object, returns the serialized JSON type object

Parameters:

tuple (SimTimestep) –

Return type:

str

classmethod type_to_tuple(t)

Given a serialized JSON type object, returns the Python class object

Parameters:

t (str) –

Return type:

SimTimestep