nrel.hive.state.simulation_state.update.step_simulation
Module Contents
Classes
Helper class that provides a standard way to create an ABC using |
Attributes
- class nrel.hive.state.simulation_state.update.step_simulation.StepSimulation[source]
Bases:
nrel.hive.state.simulation_state.update.simulation_update.SimulationUpdateFunctionHelper class that provides a standard way to create an ABC using inheritance.
- property ordered_instruction_generators: Tuple[nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGenerator, Ellipsis]
- instruction_generators: immutables.Map[nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGeneratorId, nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGenerator]
- instruction_generator_order: Tuple[nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGeneratorId, Ellipsis]
- classmethod from_tuple(instruction_generators: Tuple[nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGenerator, Ellipsis]) StepSimulation[source]
Create a StepSimulation from a tuple of instruction generators.
- update_instruction_generators(updated_i_gens: Tuple[nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGenerator, Ellipsis]) StepSimulation[source]
Update the set of instruction generators.
- update(simulation_state: nrel.hive.state.simulation_state.simulation_state.SimulationState, env: nrel.hive.runner.environment.Environment) Tuple[nrel.hive.state.simulation_state.simulation_state.SimulationState, StepSimulation][source]
generates all instructions for this time step and then attempts to apply them to the SimulationState upon completion, returns the modified simulation state along with any reports and additionally, returns an updated version of the StepSimulation (in the case of any modifications to the InstructionGenerators)
before beginning, it first calls a provided update function on the set of InstructionGenerators for any control models injected by the user
- Parameters:
simulation_state – state to modify
env – the sim environment
- Returns:
updated simulation state, with reports, along with the (optionally) updated StepSimulation
- get_instruction_generator(identifier: nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGeneratorId | Type[nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGenerator]) returns.result.ResultE[nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGenerator][source]
Get the instance of an internal instruction generator either by an id or the actual class type.
- update_instruction_generator(i_gen: nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGenerator) returns.result.ResultE[StepSimulation][source]
Update a single instruction generator.