hadar.optimizer.lp.domain.
JSONLP
Bases: hadar.optimizer.utils.JSON, abc.ABC
hadar.optimizer.utils.JSON
abc.ABC
from_json
to_json
LPConsumption
Bases: hadar.optimizer.lp.domain.JSONLP
hadar.optimizer.lp.domain.JSONLP
Consumption element for linear programming.
LPConverter
Converter element for linear programming
LPLink
Link element for linear programming
LPNetwork
Bases: hadar.optimizer.utils.JSON
Network element for linear programming
LPNode
Node element for linear programming
LPProduction
Production element for linear programming.
LPStorage
Storage element
LPTimeStep
create_like_study
hadar.optimizer.lp.mapper.
InputMapper
Bases: object
object
Input mapper from global domain to linear programming specific domain
get_conv_var
Map Converter to LPConverter.
name – converter name
t – time step
scn – scenario index
get_node_var
Map InputNode to LPNode.
network – network name
node – node name
LPNode according to node name at t in study
OutputMapper
Output mapper from specific linear programming domain to global domain.
get_result
Get result.
final result after map all nodes
set_converter_var
set_node_var
Map linear programming node to global node (set inside intern attribute).
t – timestamp index
vars – linear programming node with ortools variables inside
None (use get_result)
hadar.optimizer.lp.optimizer.
AdequacyBuilder
Build adequacy flow constraint.
add_converter
Add converter element in equation. Sources are like consumptions, destination like production
conv – converter element to add
t – time index to use
add_node
Add flow constraint for a specific node.
name_network – network name. Used to differentiate each equation
name_node – node name. Used to differentiate each equation
node – node to map constraint
build
Call when all node are added. Apply all import flow for each node.
ConverterMixBuilder
Build equation to determine ratio mix between sources converter.
ObjectiveBuilder
Build objective cost function.
Add converter. Apply cost on output of converter.
conv – converter to cost
Add cost in objective for each node element.
node – node to add
StorageBuilder
Build storage constraints
solve_lp
Solve adequacy flow problem with a linear optimizer.
study – study to compute
out_mapper – use only for test purpose to inject mock. Keep None as default.
Result object with optimal solution