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.

dynamic_action_space()

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.

log_frame()

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 action amount 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

absorption_marginal_cost

Expected marginal cost of energy absorption.

action_space

Action spaces of the module.

current_step

Current step of the module.

is_sink

Whether the module is a sink.

is_source

Whether the module is a source.

log

Module's log as a DataFrame.

logger

The module's logger.

logger_last

The most recent entry in the log.

marginal_cost

Average marginal cost of producing with the module.

max_act

Maximum action that the module allows.

max_consumption

Maximum amount of consumption at the current time step.

max_obs

Maximum observation that the module gives.

max_production

Maximum amount of production at the current time step.

min_act

Minimum action that the module allows.

min_obs

Minimum observation that the module gives.

min_production

Minimum amount of production at the current time step.

module_type

Type of the module.

observation_space

Observation space of the module.

production_marginal_cost

Expected marginal cost of energy production.

state

Current state of the module as a vector.

yaml_tag

Tag used for yaml serialization.