pymgrid.modules.UnbalancedEnergyModule#
- class pymgrid.modules.UnbalancedEnergyModule(raise_errors, initial_step=0, loss_load_cost=10, overgeneration_cost=2.0, normalized_action_bounds=(0, 1))[source]#
Methods
as_sink(energy_excess)Act as an energy sink to the microgrid.
as_source(energy_demand)Act as an energy source to the microgrid.
dump([stream])Save a module to a YAML buffer.
An action space bounded by the current step's maximum consumption and production.
from_normalized(value[, act, obs])Un-normalize an action or observation.
get_cost(energy_amount, as_source, as_sink)Get the cost of unmet load or excess production.
load(stream)Load a module from yaml representation.
log_dict()Module's log as a dict.
Module's log as a DataFrame.
reset()Reset the module to step zero and flush the log.
sample_action([strict_bound])Sample an action from the module's action space.
state_dict([normalized])Current state of the module as a dictionary.
step(action[, normalized])Take one step in the module, attempting to draw or send
actionamount of energy.to_normalized(value[, act, obs])Normalize an action or observation.
update(external_energy_change[, as_source, ...])Update the state of the module given an energy request.
verbose_eq(other[, indent])Attributes
Expected marginal cost of energy absorption.
Action spaces of the module.
Current step of the module.
Whether the module is a sink.
Whether the module is a source.
Module's log as a DataFrame.
The module's logger.
The most recent entry in the log.
Average marginal cost of producing with the module.
Maximum action that the module allows.
Maximum amount of consumption at the current time step.
Maximum observation that the module gives.
Maximum amount of production at the current time step.
Minimum action that the module allows.
Minimum observation that the module gives.
Minimum amount of production at the current time step.
Type of the module.
Observation space of the module.
Expected marginal cost of energy production.
Current state of the module as a vector.
Tag used for yaml serialization.