Originally posted by: GGR
Hi Ebisa
Sorry, I missed charge_level is an array of variable.
To initialize a variable range you can either do it in the declaration of the array:
dvar int charge_level
i in time_steps in ((i == 1)? initial_charge_level : min_storage)..((i==1) ? initial_charge_level : max_storage);
That is possible for not too complex cases
Either in the constraint. That is in the OPL subject to block:
subject to {
charge_level[1] == initial_charge_level;
}
Last in a script execute block:
execute {
charge_level[1].UB = initial_charge_level;
charge_level[1].LB = initial_charge_level;
}
So
for a constant to initialiie:
either in the declaration, either in a script execute block
for a variable to initialize
either in the declaration, either in a script execute block
either in the model subject to block as constraints
Cheers
#ConstraintProgramming-General#DecisionOptimization