nrel.hive.dispatcher.forecaster

Submodules

Package Contents

Classes

BasicForecaster

A forecaster that generates a prediction based on the current demand.

Forecast

Typed version of namedtuple.

ForecastType

Generic enumeration.

ForecasterInterface

A class that computes an optimal fleet state.

class nrel.hive.dispatcher.forecaster.BasicForecaster[source]

Bases: nrel.hive.dispatcher.forecaster.forecaster_interface.ForecasterInterface

A forecaster that generates a prediction based on the current demand.

reader: nrel.hive.util.iterators.DictReaderStepper
classmethod build(demand_forecast_file: str) BasicForecaster[source]

loads a forecaster from a file

Parameters:

demand_forecast_file – the file source

Returns:

a BasicForecaster

Raises:

an exception if there were file loading issues

generate_forecast(simulation_state: hive.state.simulation_state.simulation_state.SimulationState) Tuple[BasicForecaster, nrel.hive.dispatcher.forecaster.forecast.Forecast][source]

Generate fleet targets to be consumed by the dispatcher.

Parameters:

simulation_state – The current simulation state

Returns:

the update Manager along with the fleet target

class nrel.hive.dispatcher.forecaster.Forecast[source]

Bases: NamedTuple

Typed 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)])
type: ForecastType
value: int
class nrel.hive.dispatcher.forecaster.ForecastType[source]

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

DEMAND = 0
class nrel.hive.dispatcher.forecaster.ForecasterInterface[source]

Bases: abc.ABC

A class that computes an optimal fleet state.

abstract generate_forecast(simulation_state: nrel.hive.state.simulation_state.simulation_state.SimulationState) Tuple[ForecasterInterface, nrel.hive.dispatcher.forecaster.forecast.Forecast][source]

Generate forecast of some future state.

Parameters:

simulation_state – The current simulation state

Returns:

the update Forecaster along with the forecast