David López wrote:
i want to search a solution of a timetabling problem, the particular
model is attach with this mail.
(...)
but i want a variable this tipe, Xmwl, where m is roms, w subject an l
periods, how can i have this tipe of variables, where the model is attach
Make X a tuple of tuples of tuples, i.e.,
X={MakeTuple rooms NumberOfRooms}
for M in 1..NumberOfRooms do
X.M={MakeTuple subjects NumberOfSubjects}
for W in 1..NumberOfSubjects do
X.M.W={FD.tuple periods NumberOfPeriods 0#1}
end
end
The decision variable Xmwl is given by X.M.W.L, where M is a room
number, W is a subject number, and L is a time period.
Don't forget that you cannot distribute X in your search script. You
have to put all the variables of X in a list or a record before applying
FD.distribute. The for loop has a convenient 'collect' feature that
works well for that task:
Vars = for M in 1..NumberOfRooms collect:Collect do
for W in 1..NumberOfSubjects do
for L in 1..NumberOfPeriods do
{Collect X.M.W.L}
end
end
end
{FD.distribute ff Vars}
Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list
mozart-users@ps.uni-sb.de
http://www.mozart-oz.org/mailman/listinfo/mozart-users