Skip to main content

Producer Energy Requirement Logic

ABMLP-X Producer energy requirement from the Environment agent: March 2024.

Energy Requirement

energy.py
# 2
def energy_requirement(self):
"""
One monetary unit of demands will require one
unit of energy to fulfil.
"""

# Energy required based on combined (monetary) government agent and
# consumer agents desires.
total_energy_required = (_government_supplied_expenditure
+ _household_supplied_expenditure)

energy_shortfall = 0

# To calculate flows of 'flow' (renewable) energy.
opening_flow_energy = environment.units_flow_energy
# To calculate flows of 'stock' (fossil hydrocarbon) energy.
opening_stock_energy = (environment.units_stock_energy
* environment.availability_stock_energy)

"""
Use stock (fossil hydrocarbon) energy to fill the first 5% of
total energy required.
"""
# Environment has remaining stock (fossil hydrocarbon) energy.
if environment.units_stock_energy > 0:
# Fill the portion of total energy required (for maintenance)
# from stock energy.
environment.units_stock_energy -= (total_energy_required
* Decimal(0.05))
total_energy_required = total_energy_required * Decimal(0.95)
else:
sys.exit("Model exit. No available stock energy for maintenance.")

"""
Use all available flow (renewable) energy and make up any shortfall
with stock (fossil hydrocarbon) energy.
"""
# No shortfall in flow energy
if environment.units_flow_energy > 0 and (total_energy_required
<= environment.units_flow_energy):
environment.units_flow_energy -= total_energy_required

# There is a shortfall of up to 100% of 'total_energy_required'.
elif environment.units_flow_energy > 0 and (total_energy_required
> environment.units_flow_energy):
energy_shortfall = total_energy_required - environment.units_flow_energy
_flow_energy_remaining = environment.units_flow_energy
environment.units_flow_energy -= _flow_energy_remaining # (will be 0).

# Environment has remaining stock (fossil hydrocarbon) energy.
if environment.units_stock_energy > 0 and (energy_shortfall
<= environment.units_stock_energy):
# Shortfall might be 0 if total energy requirement has been
# met by flow energy.
environment.units_stock_energy -= energy_shortfall
else:
sys.exit("Model exit. No available stock energy to fill shortfall.")

# Closing energy flows.
# To calculate flows of 'flow' (renewable) energy.
closing_flow_energy = environment.units_flow_energy
# To calculate flows of 'stock' (fossil hydrocarbon) energy.
closing_stock_energy = environment.units_stock_energy

# Flow of energy used by the Producer agent this step.
self.flow_energy_used = opening_flow_energy - closing_flow_energy
self.stock_energy_used = opening_stock_energy - closing_stock_energy

# Negative externality returned to environment.
_neg_externality = (self.stock_energy_used
* environment.cumulative_neg_externality_rate)

environment.cumulative_neg_externality += _neg_externality

Steady State System

One monetary unit of demands from either Government or Housholds will require one unit of energy to fulfil. This is a test model run (170 steps) showing simplistic Producer energy use dynamics.

Model Run Parameters

  • Run Name: ABMLP-X Test
  • Government Expenditure: 20 units per step
  • Taxation rate: 20% (Flat rate; all household agents)
  • Coupon Rate: 0%
  • Interest Rate: 0%
Energy Test Chart

View the amblp-x energy requirement chart.