Source code for rtd.sim.BaseSimulation

from abc import ABCMeta, abstractmethod
from rtd.sim.types import SimulationState



[docs]class BaseSimulation(metaclass=ABCMeta): def __init__(self): self.simulation_state: SimulationState = SimulationState.INVALID self.simulation_timestep: float = None
[docs] @abstractmethod def add_object(self, object): ''' Add some object to the simulation ''' pass
[docs] @abstractmethod def setup(self): ''' Setup all the world ''' pass
[docs] @abstractmethod def initialize(self): ''' Initialize everything to start ''' pass
[docs] @abstractmethod def pre_step(self): ''' Execute before the overall step ''' pass
[docs] @abstractmethod def step(self): ''' Execute all the updates needed for each step ''' pass
[docs] @abstractmethod def post_step(self): ''' Execute after each step ''' pass
[docs] @abstractmethod def summary(self, **options): ''' Generate the summary ''' pass
[docs] @abstractmethod def run(self, **options): ''' Run the lifecycle. Max iterations or max length is embedded in this ''' pass