nrel.hive.runner

Submodules

Package Contents

Classes

Environment

Environment of this Hive Simulation.

LocalSimulationRunner

The local simulation runner.

RunnerPayload

Holds the simulation state, dispatcher and reports for the simulation run.

class nrel.hive.runner.Environment[source]

Bases: NamedTuple

Environment of this Hive Simulation.

config: nrel.hive.config.HiveConfig
mechatronics: immutables.Map[nrel.hive.util.typealiases.MechatronicsId, nrel.hive.model.vehicle.mechatronics.mechatronics_interface.MechatronicsInterface]
chargers: immutables.Map[nrel.hive.util.typealiases.ChargerId, nrel.hive.model.energy.charger.charger.Charger]
schedules: immutables.Map[nrel.hive.util.typealiases.ScheduleId, nrel.hive.model.vehicle.schedules.schedule.ScheduleFunction]
fleet_ids: FrozenSet[nrel.hive.util.typealiases.MembershipId | None]
reporter: nrel.hive.reporting.reporter.Reporter
set_reporter(reporter: nrel.hive.reporting.reporter.Reporter) Environment[source]

allows the reporter to be updated after the environment is built.

Parameters:

reporter – the reporter to be used

Returns:

the updated environment

class nrel.hive.runner.LocalSimulationRunner[source]

Bases: NamedTuple

The local simulation runner.

classmethod run(runner_payload: nrel.hive.runner.runner_payload.RunnerPayload) nrel.hive.runner.runner_payload.RunnerPayload[source]

steps through time, running a simulation, and producing a simulation result

Parameters:

runner_payload – the initial state of the simulation

Returns:

the final simulation state and dispatcher state

classmethod step(runner_payload: nrel.hive.runner.runner_payload.RunnerPayload) nrel.hive.runner.runner_payload.RunnerPayload | None[source]

takes exactly one step forward, or, if the simulation has reached the end time, does nothing

Parameters:

runner_payload – the current state of the simulation

Returns:

the next simulation state after one simtime step, or, None if we have reached the end_time

class nrel.hive.runner.RunnerPayload[source]

Bases: NamedTuple

Holds the simulation state, dispatcher and reports for the simulation run.

Parameters:
  • s (SimulationState) – the simulation state

  • e (Environment) – the environmental assets for this simulation

  • u (Update) – the updates we need to apply during each sim step

s: nrel.hive.state.simulation_state.simulation_state.SimulationState
e: nrel.hive.runner.environment.Environment
u: nrel.hive.state.simulation_state.update.update.Update