Yves Jaradin wrote:
mark richardson wrote :
Hi,
I wonder if anyone could offer some advice with two particular
problems I am having.
I am in the process of completing my undergraduate final year project
in Oz.
The project goal is to allocate a list of students to module groups.
The number of groups for each module is predefined, as is the
location and start time. My job is *simply* to allocate students to
groups so that no student appears twice in any group, no students
grouping clashes with any of his other groups (by start time) and
that the maximum number of students in each group is less than a
fixed limit depending upon group.
***some text removed here****
I would simply represent each student as a fixed integer and groups as
finite sets of them.
no student appears twice in any group => implicit
no students grouping clashes with any of his other groups (by start
time) => FS.disjointN
maximum number of students in each group is less than a fixed limit
depending upon group. => FS.cardRange
(all students are affected => FS.unionN, FS.partition)
Yves||
I have modified my program along these lines. I now have a record where
each feature is a module group and each field is the corresponding
finite set of students. I have solved the problem of applying a
cardinality constraint depending on the group type but I've run into
problems applying disjoint and distinct.
I now have for example a record such as this:
Solution=solution('aabp1':{{}..{0#1460}#{1#20}}
'aabp2':{{}..{0#1460}#{1#20}}
'aacs1':{{}..{.......etc.
where 'aabp1' is module code 'aab' ,type p (practical), group number 1.
There may be one or more types from practicals, seminars and lectures
for each module.
Now firstly what I want is for any features beginning 'xxxx', regardless
of the trailing digit, to be distinct and, secondly, for all groups
which contain student y , none of them clash in time - I have a function
which returns the time of a group as an integer representing the hourly
period in the week (ie Mon 8am is 1, Tues 9am is 14).
My idea for the first problem is to change the data structure so that
each module#type is represented by it's 'xxxx' code which then has
possibly a tuple of FS variables (or maybe a FS.record) to represent
each group within that module#type, so then I can just say {FS.distinct
Solution.'aabp'}. Does this sound more sensible?
I am really struggling however on how to express a relationship between
groups based on time so that *for each student*, none of their groupings
are at the same time.
I am also wondering if using a record to hole the result is a good idea
or if a list would be simpler to work with?
I appreciate the help I've received so far, but this is completely new
territory for me and any help is very much appreciated.
Regards
Mark
--
Mark Richardson
Final year undergraduate
University of Teesside
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users