[gecode-users] Help to express a constraint

Christian Schulte cschulte at kth.se
Sun Jun 1 19:51:42 CEST 2014


Hmm, why not just write a bunch of reified constraints?  Did you try that?

You basically have an implication something like tihsfollows:
	rel(*this, (status(t,m) != 3) && (status(succ(t,m)) != 3) >>
(time(succ(t,m),m)) ? 10));

I have to admit that I do not know what "increase by 10" means. I would
expect that you can express it as a constraint (that's why I write a ?
above).

Best
Christian

--
Christian Schulte, www.ict.kth.se/~cschulte/


> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On
> Behalf Of Philippe
> Sent: Sunday, June 01, 2014 12:41 AM
> To: users at gecode.org
> Subject: [gecode-users] Help to express a constraint
> 
> Hello all,
> 
> 
> I want to increase the starting time of the successor of task t in machine
m (eg.
> time(succ(t,m),m)) by 10 only if status(t,m) != 3 and
> status(succ(t,m)) != 3
> 
> with status = Matrix<IntArgs>
>           t = int
>           m = int
>      succ   = Maxtrix<IntVarArray>
>      time   = Matrix<IntVarArray>
> 
> I have dirty/wrong/long code to do this (I am shameful to show you it),
I'm
> certainly going in a wrong direction (comparing to elegant/natural code
seen in
> the examples).
> Could you help me please ?
> Thanks for your help
> Philippe
> 
> note:
> I've read the tips 7.3 page 106 of gecode manual and i'm not using
scheduling
> constraint since i don't feel comfortable yet with it).
> 
> 
> 
> 
> 
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users




More information about the users mailing list