[gecode-users] Understanding cumulatives constraint

Roberto Pinto librarama at gmail.com
Tue Jul 4 10:57:17 CEST 2006


On 7/4/06, Mikael Zayenz Lagerkvist <zayenz at gmail.com> wrote:
> On 7/3/06, Roberto Pinto <librarama at gmail.com> wrote:
> > I'm trying to compile a really basic example using the cumulatives
> > constraint, but I'm finding some problems that I hope you could help
> > me to solve.
>
> The problem with your example is very simple to solve, machines are
> indexed starting from 0 and not from 1. I've added some comments on
> some parts of your code below.
> >             machine[i] = 1;  ///all tasks are worked on machine 1
> should be: machine[i] = 0;

Ok, now it's clear. I didn't get that the indexes of the machines must
be sequential starting from 0. I thought that any kind of univoque id
fits the needs.

> Well, the actual solution one gets is
>     0:4, 4:8, 8:12, 12:16,
> This shows that a task may start and another task may begin at the same time.

We could also interpret this solution as "the first task is finished
at the beginning of the fourth day and the following task should start
immediatly after"

Thank you very much
Libra (Roberto)

> Cheers,
> Mikael
> --
> Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/
>




More information about the gecode-users mailing list