[gecode-users] Scheduling
Daniel Araya
daniel.araya at gmail.com
Mon May 30 16:55:42 CEST 2011
Hi Guido,
You says: "For the m(j,i) == (resource[j] == i) constraint, you can
actually use a channel constraint, which is more efficient, but I thought
this is closer to your original code."
But how you can use a channel constraint with different argument size?
A few weeks ago I had the same problem and finally I implemented the
problem with reified constraints.
Thanks a lot. BR,
--
Daniel
On Mon, May 30, 2011 at 10:32 AM, Guido Tack <tack at gecode.org> wrote:
> On 30 May 2011, at 16:08, Alin wrote:
>
> > Guido Tack <tack at ...> writes:
> >
> >>
> >> Did you use the version of unary with optional tasks? Otherwise, the
> same
> > start time up in different
> >> unary constends raints, which is quite likely to be unsatisfiable.
> >>
> >> Guido
> >>
> >
> > I've tried to use the unary version with optional tasks,
> > but I don't quite understand how it would help
> > why should I set a certain task to be optional if I have reification ?
>
> How should the unary constraint know about the reification otherwise?
>
> Given your example, I think you need something like this:
>
> BoolVarArgs _m(home, n_tasks*n_resources);
> Matrix<BoolVarArgs> m(m, n_tasks, n_resources);
>
> for (int i=0; i<n_resources; i++) {
> for (int j=0; j<n_tasks; j++) {
> rel(home, m(j,i) == (resource[j] == i));
> dom(home, start_time[j], set_possible_values, m(i,j));
> }
> unary(home, startTimes, durations, m.row(i));
> }
> for (int i=0; i<n_tasks; i++) {
> linear(home, m.col(i), IRT_EQ, 1); // each task is scheduled on exactly
> one resource
> }
>
> For the m(j,i) == (resource[j] == i) constraint, you can actually use a
> channel constraint, which is more efficient, but I thought this is closer to
> your original code.
>
> Cheers,
> Guido
>
> --
> Guido Tack, http://people.cs.kuleuven.be/~guido.tack/
>
>
>
>
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20110530/557bc295/attachment.htm>
More information about the users
mailing list