nrel.hive
Subpackages
nrel.hive.appnrel.hive.confignrel.hive.dispatchernrel.hive.dispatcher.forecasternrel.hive.dispatcher.instructionnrel.hive.dispatcher.instruction_generatornrel.hive.dispatcher.instruction_generator.assignment_opsnrel.hive.dispatcher.instruction_generator.charging_fleet_managernrel.hive.dispatcher.instruction_generator.charging_search_typenrel.hive.dispatcher.instruction_generator.dispatchernrel.hive.dispatcher.instruction_generator.instruction_functionnrel.hive.dispatcher.instruction_generator.instruction_generatornrel.hive.dispatcher.instruction_generator.instruction_generator_ops
nrel.hive.initializationnrel.hive.modelnrel.hive.model.energynrel.hive.model.requestnrel.hive.model.roadnetworknrel.hive.model.roadnetwork.osmnrel.hive.model.roadnetwork.geofencenrel.hive.model.roadnetwork.haversine_link_id_opsnrel.hive.model.roadnetwork.haversine_roadnetworknrel.hive.model.roadnetwork.linknrel.hive.model.roadnetwork.link_idnrel.hive.model.roadnetwork.linktraversalnrel.hive.model.roadnetwork.roadnetworknrel.hive.model.roadnetwork.routenrel.hive.model.roadnetwork.routetraversal
nrel.hive.model.stationnrel.hive.model.vehiclenrel.hive.model.basenrel.hive.model.entitynrel.hive.model.entity_positionnrel.hive.model.membershipnrel.hive.model.passengernrel.hive.model.sim_time
nrel.hive.reportingnrel.hive.reporting.handlernrel.hive.reporting.handler.eventful_handlernrel.hive.reporting.handler.handlernrel.hive.reporting.handler.instruction_handlernrel.hive.reporting.handler.kepler_featurenrel.hive.reporting.handler.kepler_handlernrel.hive.reporting.handler.stateful_handlernrel.hive.reporting.handler.stats_handlernrel.hive.reporting.handler.summary_statsnrel.hive.reporting.handler.time_step_stats_handlernrel.hive.reporting.handler.vehicle_charge_events_handler
nrel.hive.reporting.driver_event_opsnrel.hive.reporting.instruction_generator_event_opsnrel.hive.reporting.report_typenrel.hive.reporting.reporternrel.hive.reporting.reporter_opsnrel.hive.reporting.vehicle_event_ops
nrel.hive.resourcesnrel.hive.runnernrel.hive.statenrel.hive.state.driver_statenrel.hive.state.entity_statenrel.hive.state.simulation_statenrel.hive.state.vehicle_statenrel.hive.state.vehicle_state.charge_queueingnrel.hive.state.vehicle_state.charging_basenrel.hive.state.vehicle_state.charging_stationnrel.hive.state.vehicle_state.dispatch_basenrel.hive.state.vehicle_state.dispatch_opsnrel.hive.state.vehicle_state.dispatch_pooling_tripnrel.hive.state.vehicle_state.dispatch_stationnrel.hive.state.vehicle_state.dispatch_tripnrel.hive.state.vehicle_state.idlenrel.hive.state.vehicle_state.out_of_servicenrel.hive.state.vehicle_state.repositioningnrel.hive.state.vehicle_state.reserve_basenrel.hive.state.vehicle_state.servicing_opsnrel.hive.state.vehicle_state.servicing_pooling_tripnrel.hive.state.vehicle_state.servicing_tripnrel.hive.state.vehicle_state.vehicle_statenrel.hive.state.vehicle_state.vehicle_state_opsnrel.hive.state.vehicle_state.vehicle_state_type
nrel.hive.utilnrel.hive.util.dict_opsnrel.hive.util.error_or_resultnrel.hive.util.exceptionnrel.hive.util.fpnrel.hive.util.fsnrel.hive.util.geonrel.hive.util.h3_opsnrel.hive.util.ionrel.hive.util.iteratorsnrel.hive.util.time_helpersnrel.hive.util.tuple_opsnrel.hive.util.typealiasesnrel.hive.util.unitsnrel.hive.util.validationnrel.hive.util.wkt
Submodules
Package Contents
Classes
Typed version of namedtuple. |
|
Helper class that provides a standard way to create an ABC using |
|
Typed version of namedtuple. |
Functions
|
Attributes
- nrel.hive.__doc__ = Multiline-String
Show Value
""" ## ## #### ## ## ####### ## ## ## ## ## ## ######### ## ## ## ###### ## ## ## ## ## ## ## ## #### ### ####### .' '. __ . . . (__\_ . . . -{{_(|8) ' . . ' ' . . ' (__/ **HIVE** is a Python application for simulating the effects of hypothetical mobility as a service (MaaS) applications on infrastructure, levels of service, and additional energy outcomes. Developed in 2019 at the National Renewable Energy Laboratory (NREL), HIVE is an agent-based model that simulates MaaS operations over real world trip data. """
- class nrel.hive.HiveConfig[source]
Bases:
NamedTupleTyped version of namedtuple.
Usage in Python versions >= 3.6:
class Employee(NamedTuple): name: str id: int
This is equivalent to:
Employee = collections.namedtuple('Employee', ['name', 'id'])
The resulting class has an extra __annotations__ attribute, giving a dict that maps field names to types. (The field names are also in the _fields attribute, which is part of the namedtuple API.) Alternative equivalent keyword syntax is also accepted:
Employee = NamedTuple('Employee', name=str, id=int)
In Python versions <= 3.5 use:
Employee = NamedTuple('Employee', [('name', str), ('id', int)])
- global_config: nrel.hive.config.global_config.GlobalConfig
- input_config: nrel.hive.config.input.Input
- network: nrel.hive.config.network.Network
- scenario_output_directory: pathlib.Path
- classmethod build(scenario_file_path: pathlib.Path, config: Dict | None = None, output_suffix: str | None = None) Exception | HiveConfig[source]
builds a hive config by reading from a scenario file. optionally append additional key/value pairs and modify the datetime convention for naming output directories. :param scenario_file_path: path to the file to load as a HiveConfig :param config: optional overrides to the default config values (Default: None) :param output_suffix: directory name suffix to append to sim_name (by default, timestamp) :return: a hive config or an error
- classmethod from_dict(d: Dict, scenario_file_path: pathlib.Path, output_suffix: str | None) HiveConfig[source]
- set_scenario_output_directory(output_directory: pathlib.Path) HiveConfig[source]
- suppress_logging() HiveConfig[source]
- nrel.hive.__doc__ = Multiline-String
Show Value
""" dispatchers assign requests to vehicles and reposition unassigned vehicles """
- class nrel.hive.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.
- class nrel.hive.Update[source]
Bases:
NamedTupleTyped version of namedtuple.
Usage in Python versions >= 3.6:
class Employee(NamedTuple): name: str id: int
This is equivalent to:
Employee = collections.namedtuple('Employee', ['name', 'id'])
The resulting class has an extra __annotations__ attribute, giving a dict that maps field names to types. (The field names are also in the _fields attribute, which is part of the namedtuple API.) Alternative equivalent keyword syntax is also accepted:
Employee = NamedTuple('Employee', name=str, id=int)
In Python versions <= 3.5 use:
Employee = NamedTuple('Employee', [('name', str), ('id', int)])
- pre_step_update: Tuple[nrel.hive.state.simulation_state.update.simulation_update.SimulationUpdateFunction, Ellipsis]
- classmethod build(config: nrel.hive.config.HiveConfig, instruction_generators: Tuple[nrel.hive.dispatcher.instruction_generator.instruction_generator.InstructionGenerator, Ellipsis]) Update[source]
constructs the functionality to update the simulation each time step
- Parameters:
config –
instruction_generators – any overriding dispatcher functionality
- Returns:
the Update that will be applied at each time step
- apply_update(runner_payload: nrel.hive.runner.RunnerPayload) nrel.hive.runner.RunnerPayload[source]
applies the update at a time step, calling each SimulationUpdateFunction in order
- Parameters:
runner_payload – the current SimulationState and assets at the current simtime
- Returns:
the updated payload after one SimTime step
- nrel.hive.FORMAT = '%(message)s'
- nrel.hive.rich_handler