falcong / or-tools

Automatically exported from code.google.com/p/or-tools
0 stars 0 forks source link

Un-decided IntervalVar causing Crash #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile the unpacked .cs-files 
2. Run the executable

The model:
I have ported your c++-model: 
http://or-tools.googlecode.com/svn/trunk/examples/cpp/jobshop.cc to C#.

On top I have added transition times (the function 
"PostTransitionTimeConstraints" i Program.cs).

I expect the model to run and solve a small instance of a flexible jobshop 
problem with transition times.

The solver often finds a couple of solutions before it crashes.
(For the choice of randomisation seed I get 1 solution before it crashes, as 
the problem instance is so small. However, it can also be 0 or any number of 
aquired solutions before the crash, depending on the seed in the search phase 
where I assign the tools, and the size and composition of the problem instance)

The error message from the c++ library is:
"src/constraint_solver/interval.cc:809: Check failed: performed_.MayBeTrue()".
For my version of the code this piece of code reads:

int64 FixedDurationIntervalVar::StartMax() const {
  CHECK(performed_.MayBeTrue());
  return start_.Max();
}

I have found that I can enforce correct transition times, but I cannot 
constrain the next start time without the application eventually crashing.
(this key piece of code can be found on line 216 in my "program.cs" file)

My revision of Google Or-tools is: 2907
My operating system is Windows 7, and I compile on Visual Studio 2012 64bit.

I just saw that you added setup dependent transition times in revision 2909. I 
will look at it, but I think this error is relevant even if the new features 
would solve my problem.

Original issue reported on code.google.com by johan.lu...@gmail.com on 24 Oct 2013 at 11:42

Attachments:

GoogleCodeExporter commented 9 years ago
I will look at it.

Thanks

Original comment by laurent....@gmail.com on 27 Oct 2013 at 8:25

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 5 Nov 2013 at 12:17

GoogleCodeExporter commented 9 years ago
Hello, 

a few comments.

1) I have added examples/tests/issue33.cs that contains your code.
2) There is now an API on the DisjunctiveConstraint that adds transition time 
between activities. You need a callback long distance(int before_activity, int 
after_activity).
3) In your code, next[0] points to the first activity and is not the activity 
after the first. 0 is a dummy node. I am not sure this is true in your code.

Thanks

Original comment by laurent....@gmail.com on 6 Nov 2013 at 1:43

GoogleCodeExporter commented 9 years ago
I found and fixed the bug.
Thanks for the bug report.

Original comment by laurent....@gmail.com on 22 Nov 2013 at 10:50