Currently, there are two way to define objectives:
- Through association of an objective with a port, then adding it to the
ObjectiveSet.objective_list attribute
- Through setting
port.objective
When optimiser.optimise is called, it calls optimiser.build_model_and_objective, which calls optimiser._build_objective which collects all the objectives from the ObjectiveSet as well as scans across all ports in the graph to see if there's objectives in port.objective.
Maybe there is a reason for this but @explodingdinosaurs and @mikejturner couldn't find one. We will need to have a conversation with @annaskobeleva and probably @joshvote to make a decision about what to do.
Currently, there are two way to define objectives:
ObjectiveSet.objective_listattributeport.objectiveWhen
optimiser.optimiseis called, it callsoptimiser.build_model_and_objective, which callsoptimiser._build_objectivewhich collects all the objectives from theObjectiveSetas well as scans across all ports in the graph to see if there's objectives inport.objective.Maybe there is a reason for this but @explodingdinosaurs and @mikejturner couldn't find one. We will need to have a conversation with @annaskobeleva and probably @joshvote to make a decision about what to do.