Skip to content
Snippets Groups Projects
Commit b0a3f878 authored by Christian Doh Dinga's avatar Christian Doh Dinga
Browse files

add function docstring

parent eae16320
No related branches found
No related tags found
1 merge request!1Solve distributed admm problem using centralized optimization
from typing import Dict
import pandas as pd import pandas as pd
import pyomo.environ as pyo import pyomo.environ as pyo
from typing import Dict
def define_consumer_parameters(agent: str, model: pyo.AbstractModel, data: Dict, ts: pd.DataFrame) -> pyo.AbstractModel: def define_consumer_parameters(agent: str, model: pyo.AbstractModel, data: Dict, ts: pd.DataFrame) -> pyo.AbstractModel:
"""Define parmaters common to all consumer agents."""
# Extract consumer parameter values from data # Extract consumer parameter values from data
total_consumers = data['General']['totConsumers'] total_consumers = data['General']['totConsumers']
share_of_agent = data['Consumers'][agent]['Share'] share_of_agent = data['Consumers'][agent]['Share']
...@@ -17,7 +18,7 @@ def define_consumer_parameters(agent: str, model: pyo.AbstractModel, data: Dict, ...@@ -17,7 +18,7 @@ def define_consumer_parameters(agent: str, model: pyo.AbstractModel, data: Dict,
# Declare consumer optimization parameters (but do not construct yet) # Declare consumer optimization parameters (but do not construct yet)
model.demand_profile = pyo.Param(model.time, name='demand_profile', initialize=dict(enumerate(demand_profile)), mutable=False) model.demand_profile = pyo.Param(model.time, name='demand_profile', initialize=dict(enumerate(demand_profile)), mutable=False)
model.pv_profile = pyo.Param(model.time, name='pv_profile', initialize=dict(enumerate(pv_profile)), mutable=False) model.pv_profile = pyo.Param(model.time, name='pv_profile', initialize=dict(enumerate(pv_profile)), mutable=False)
return model return model
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment