Constraints
Reported by @ext-kranjcevic_m:
I don't see any difference when using constraints (I still get design variables for which the constraint doesn't hold in the .json files).
If I replace line 264 in https://gitlab.psi.ch/OPAL/opt-pilot/blob/master/Optimizer/EA/FixedPisaNsga2.tcc#L264 with:
if( ((itr->second.value.size() == 1) && itr->second.is_valid) ||
((itr->second.value.size() > 1) && itr->second.is_valid && itr->second.value[0])) {
opt-pilot seems to respect the constraint from the input file (no more design variables which don't satisfy it in the .json files).
My understanding:
-
for objectives:
-
itr->second.value.size()
... 1 -
itr->second.value[0]
... the value of the objective -
itr->second.is_valid
... true if the objective was computed correctly (the value is meaningful)
-
-
for constraints:
-
itr->second.value.size()
... 3 -
itr->second.value[0]
... 0 if the constraint doesn't hold (1 otherwise) -
itr->second.value[1]
... the value of the lhs -
itr->second.value[2]
... the value of the rhs -
itr->second.is_valid
... true if the lhs, rhs and the comparison where computed correctly (but the constraint doesn't necessarily hold)
-
Is this correct and does the change make sense?