Originally posted by: ArnaudS
Hi
You can access the solution through the OplModel.
For example, if you have following decision variables:
dvar int slot[Slots] in AllConfs;
dvar int lastSlot in nbCars..nbSlots;
After the solve, to retrieve the values, you can use:
int lastSlot = opl.GetElement("lastSlot").AsInt();
Console.Out.WriteLine("lastSlotValue = " + lastSlot);
IIntMap slot = opl.GetElement("slot").AsIntMap();
IIntRange slots = opl.GetElement("Slots").AsIntRange();
for( IEnumerator e = slots.GetEnumerator(); e.MoveNext(); ) {
Console.Out.Write(slot.Get((int)e.Current) + " ");
}
Hope this helps,
Regards,
Arnaud
#CPOptimizer#DecisionOptimization