public string OrderNumber;public string ProductNumber;public int Quantity;public IntVar Start_Time;public IntVar On_Line;public IntVar CurrentCapacity;public IntVar Duration;public IntVar End_Time;
solver.Add( OrderList[i].CurrentCapacity == lines.MLineList[OrderList[i].On_Line - 1].Capacity );
solver.Add( !( (OrderList[i].Start_Time <= OrderList[j].End_Time) && (OrderList[j].Start_Time <= OrderList[i].End_Time) ) )
solver.Add( (OrderList[i].On_Line == OrderList[j].On_Line) == !( (OrderList[i].Start_Time <= OrderList[j].End_Time) && (OrderList[j].Start_Time <= OrderList[i].End_Time) ) )
--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Again however, I get stuck. Namely while trying to retrieve the variables from the solver.
Firstly I used the if(solver.Solve(...)){...} way of calling the solver.
I could find the values of the "Alternative Variables" using solution.Value(OrderList[order_id].AlternativeVariable), and such know which order was scheduled on which machine. (solution = collector.Solution(0), and I use a LastSolutionCollector)
However, the solution does not have any method which accepts a SequenceVar, so I cannot read any information in the current solution about the sequences. Then I thought I might look into the IntervalVar's, this should be possible using solution.DurationValue(OrderList[order_id].intervals[LINE]) (or Start- and EndValue), wehere LINE is the value of the alternative variable.
However each time I try to get this information, my program crashes (I think it's something to do with an invalid memory call, caused by LINE).
Also I could not find a way to access the SequenceVar.Next() method.
Anyway, I read in the manual in section 2.4.2, that using solver.Solve(), you cannot access the variables of the current solution, but with NewSearch, NextSolution and EndSearch you can. So I decided to try that, such that I won't need the solution.Value() method. So I tested this:
[...]
solver.NewSearch(main_phase, search_log,objective_monitor,limit);
while(solver.NextSolution()){[..1..]}
// Check values in IntervalVars and SequenceVars
[..2..]
solver.EndSearch();
Now only in place [..1..] I can obtain the current values of the variables not in [..2..], however I only want the LAST solution (with the best objective value), so I would like to obtain them only in [..2..]. I also tried to add a single solver.NextSolution() outside the while, but this doesn't help as the time_limit has already finished (at least that's what I guess is happening after testing a bit).
The actual question: (above is a bit of context and stuff):
So I guess my actual question is how to use the SequenceVar.Next() method only for the last solution, in a not so devious way.
Thanks for your time!
Jeremy
System.AccessViolationException : Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "or-tools-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/or-tools-discuss/3KCbccqVWjs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to or-tools-discu...@googlegroups.com.
- for change-over time, have a look at transition times in the disjunctive constraint itself.
Understandable, thanks for looking into it!I'll try it tomorrow.
Jeremy
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discuss+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "or-tools-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/or-tools-discuss/3KCbccqVWjs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to or-tools-discuss+unsubscribe@googlegroups.com.
Lukas
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "or-tools-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/or-tools-discuss/3KCbccqVWjs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "or-tools-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/or-tools-discuss/3KCbccqVWjs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to or-tools-discu...@googlegroups.com.
Lukas
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discuss+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "or-tools-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/or-tools-discuss/3KCbccqVWjs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to or-tools-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.