Skip to main content
Version: 2.0.1

strategy

StrategyInterface Objects

class StrategyInterface(ABC)

StrategyInterface The strategy interface can be used to call a strategy from an agent.

__init__

@abstractmethod
def __init__(agent_helper: AgentHelperInterface,
environment_helper: EnvironmentHelperInterface,
models: list[ModelHelperInterface],
metric_helper: MetricHelperInterface)

Initialization of the strategy

Arguments:


  • agent_helper AgentHelperInterface - The agent helper, which provides access to the agent's functions
  • environment_helper EnvironmentHelperInterface - The environment helper, which provides access to the environment's functions
  • models List[ModelHelperInterface] - The models that the strategy can use
  • metric_helper MetricHelperInterface - The metric helper, which provides access to the strategy's metrics and functions to log new ones

strategy_initialization

@abstractmethod
def strategy_initialization(simulation_state: SimulationStateHelperInterface)

Initialization of the strategy Will be called once at the start of the simulation

Arguments:


  • simulation_state SimulationStateHelperInterface - A helper that provides access to the simulation's state

strategy_pre_step

@abstractmethod
def strategy_pre_step(simulation_state: SimulationStateHelperInterface)

Pre step of the strategy Will be called before each step of the strategy

Arguments:


  • simulation_state SimulationStateHelperInterface - A helper that provides access to the simulation's state

strategy_step

@abstractmethod
def strategy_step(environment_helper: EnvironmentHelperInterface,
simulation_state: SimulationStateHelperInterface)

Step of the strategy

Arguments:


  • environment_helper EnvironmentHelperInterface - A helper that provides access to the environment's functions
  • simulation_state SimulationStateHelperInterface - A helper that provides access to the simulation's state

strategy_post_step

@abstractmethod
def strategy_post_step(simulation_state: SimulationStateHelperInterface)

Post step of the strategy Will be called after each step of the strategy

Arguments:


  • simulation_state SimulationStateHelperInterface - A helper that provides access to the simulation's state

strategy_teardown

@abstractmethod
def strategy_teardown(simulation_state: SimulationStateHelperInterface)

Teardown of the strategy Will be called once at the end of the simulation

Arguments:


  • simulation_state SimulationStateHelperInterface - A helper that provides access to the simulation's state