12 for(
int i=0;i<ordered.Length;i++)
15 if(fixedFrom>0){
foreach(var to
in routings){
if(to.ItemId==fixedFrom)
continue;var z=
GetVariable(context,
GlspFormulationVariableKeyFactory.
CreateChangeoverKey(plantId,wc.Id,fixedFrom,to.ItemId,current));var y=
GetVariable(context,
GlspFormulationVariableKeyFactory.
CreateMicroSetupStateKey(plantId,wc.Id,to.Id,to.ItemId,current));
AddConstraint(context,$
"glspInitialChangeover_i{fixedFrom}_j{to.ItemId}_t{current.MacroPeriod}_s{current.MicroPeriodIndex}",
new LinearExpressionBuilder().Add(z).Subtract(y).Build(),
MathematicalConstraintSense.Equal,0.0);}
continue;}
17 foreach(var from
in routings)
foreach(var to
in routings)
19 if(from.ItemId==to.ItemId)
continue;var z=
GetVariable(context,
GlspFormulationVariableKeyFactory.
CreateChangeoverKey(plantId,wc.Id,from.ItemId,to.ItemId,current));var yp=
GetVariable(context,
GlspFormulationVariableKeyFactory.
CreateMicroSetupStateKey(plantId,wc.Id,from.Id,from.ItemId,ordered[i-1]));var yc=
GetVariable(context,
GlspFormulationVariableKeyFactory.
CreateMicroSetupStateKey(plantId,wc.Id,to.Id,to.ItemId,current));
string suffix=$
"_i{from.ItemId}_j{to.ItemId}_t{current.MacroPeriod}_s{current.MicroPeriodIndex}";
25 return ValueTask.CompletedTask;