Topic
2 replies Latest Post - ‏2012-11-22T13:13:19Z by UdoKrehler
UdoKrehler
UdoKrehler
19 Posts
ACCEPTED ANSWER

Pinned topic What is the meaning of cp.StartMin for interval variables?

‏2012-11-20T14:44:39Z |
Hi,

I use CP Optimizer 12.4 under C#. I have an interval variable

job = cp.IntervalVar(length);

and want to ensure that the processing of this job does not start before a given value x. To do so, I did the following:

job.StartMin = x;

I don't know why, but this does not work. In the solution computed by CP Optimizer, the processing of this job starts already strictly before x (which should not be feasible according to my model).

If I instead use

cp.AddGe(cp.StartOf(job), x);

it works. In my opinion, both commands should have exactly the same meaning, shouldn't they? Why is there a difference then?

Thanks a lot for any suggestion, Udo.
Updated on 2012-11-22T13:13:19Z at 2012-11-22T13:13:19Z by UdoKrehler
  • SystemAdmin
    SystemAdmin
    554 Posts
    ACCEPTED ANSWER

    Re: What is the meaning of cp.StartMin for interval variables?

    ‏2012-11-22T10:31:14Z  in response to UdoKrehler
    The workaround you used is correct but the behavior you observe is wrong. Setting startMin to x should have the side effect of having the start time of "job" to be greater than or equal to x. Can you display the job variable in your application to check that the interval variable has been correctly updated ? IF you still have this problem, please send us a small code demonstrating it so that can investigate.

    Thanks

    Philippe
    • UdoKrehler
      UdoKrehler
      19 Posts
      ACCEPTED ANSWER

      Re: What is the meaning of cp.StartMin for interval variables?

      ‏2012-11-22T13:13:19Z  in response to SystemAdmin
      Dear Philippe,
      ok, so both code lines should work. I checked my model again now and I have to apologize because there was indeed a bug. Now, it works.
      Thank you, Udo.