Simulation Files and World Container

In this version of the simulator, we explicitly isolate world as just a container. It holds what should exist in a single simulation instance and can be exported to/from a file.

World Model Container

Will be implemented soon

Base Simulation

class rtd.sim.BaseSimulation[source]

Bases: object

abstract add_object(object)[source]

Add some object to the simulation

abstract initialize()[source]

Initialize everything to start

abstract post_step()[source]

Execute after each step

abstract pre_step()[source]

Execute before the overall step

abstract run(**options)[source]

Run the lifecycle. Max iterations or max length is embedded in this

abstract setup()[source]

Setup all the world

abstract step()[source]

Execute all the updates needed for each step

abstract summary(**options)[source]

Generate the summary

Armour Simulation

class armour.ArmourSimulation(simulate_timestep: float = 0.5)[source]

Bases: BaseSimulation

add_object(object, isentity: bool = False, collision: CollisionObject | DynamicCollisionObject = None, visual: PyvistaVisualObject = None)[source]

Add the specified object to the world. If it is an entity, it is treated as dynamic.

Parameters:
initialize()[source]

Initializes the agent, goal, and obstacles

post_step() dict[source]

Execute after each step

pre_step() dict[source]

Execute before the overall step

run(max_steps: int = 100000000.0, pre_step_callback: Callable = None, step_callback: Callable = None, post_step_callback: Callable = None, stop_on_goal: bool = True)[source]

Runs the lifecycle of the simulation

Parameters:
  • max_steps (int) – maximum number of steps to run for

  • pre_step_callback (Callable) – function to run before the pre_step

  • step_callback (Callable) – function to run before the step

  • post_step_callback (Callable) – function to run before the post_step

  • stop_on_goal (bool) – whether to stop the simulation once it reaches the goal

setup(agent: ArmourAgent)[source]

Populate the world with the ArmourAgent

Parameters:

agent (ArmourAgent) – agent to add

step() dict[source]

Execute all the updates needed for each step

summary(**options)[source]

Generate the summary