Beruflich Dokumente
Kultur Dokumente
INITIALIZATION
Let s first set up our supporting Java classes. We ll create a container class for
each of the data types above
1. room --> atributos(int roomId, String roomNumber, int capacity;)
2. timeslot --> atributos(int timeslotId, String timeslot)
3. professor --> atributos(int professorId, String professorName)
4. module --> atributos(int moduleId, String moduleCode, String module, int prof
essorIds[])
A module is what some might call a course , like Calculus 101 or American History
302 , and like real-life courses, can have multiple sections and groups of stud
ents
taking the course at different times of the week with different professors.
5. group --> atributos(int groupId, int groupSize, int moduleIds[])
The group class constructor accepts a group ID, a group size, and the module
IDs
the group is taking.
6. class --> atributos(int classId, int groupId, int moduleId)
The Class class represents a combination of all of the above. It represents a
student group taking a section of a module at a specific time, in a specific
room,
with a specific professor.
7. timetable
Now we can create a Timetable class to encapsulate all these objects into one
single timetable object.
The Timetable class also understands how to parse a chromosome and create a
candidate Timetable to be evaluated and scored.
a Timetable object knows all of the available rooms, timeslots, professors, etc.
, but
the Timetable object can also read a chromosome, create a subset of classes from
that chromosome, and help evaluate the fitness of the chromosome.
While each of these container classes is very simple they mostly define some
class properties, getters, and setters, with no real logic.