Package at.htl.timetableGenerator.model
Class School
java.lang.Object
at.htl.timetableGenerator.model.School
This class represents a school.
A school is defined by a set of school classes and a set of teachers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstraint(Constraint constraint) Adds a constraint to all school classes in this school.voidAdds a room to the school.voidaddSchoolClass(SchoolClass schoolClass) Adds a school class to the school.voidaddTeacher(Teacher teacher) Adds a teacher to the school.voidexportAllTimetables(@NotNull Set<ExportData> exportData, @NotNull Set<ExportFormat> exportFormat, String directory) Exports all timetables of the school to the specified directory in the specified formats.generateTimetables(int daysPerWeek, int maxHoursPerDay, int attempts) Generates timetables for all school classes in this school.Returns the constraints of the school.getName()Returns the name of the school.Returns the room with the specified name.getRooms()Returns the rooms of the school.@NotNull Set<SchoolClass> Returns the school classes of the school.Returns the teachers of the school.voidremoveConstraint(Constraint constraint) Removes a constraint from all school classes in this school.voidremoveSchoolClass(SchoolClass schoolClass) Removes a school class from the school.voidremoveTeacher(Teacher teacher) Removes a teacher from the school.voidsetConstraints(Set<Constraint> constraints) Sets the constraints of the school.voidSets the rooms of the school.voidsetSchoolClasses(@NotNull Set<SchoolClass> schoolClasses) Sets the school classes in this school.voidsetTeachers(@NotNull Set<Teacher> teachers) Sets the teachers in this school.voidUpdates the constraints of the school.
-
Constructor Details
-
School
public School(String name, @NotNull @NotNull Set<SchoolClass> schoolClasses, @NotNull @NotNull Set<Teacher> teachers) Constructs a new School with the specified school classes and teachers.- Parameters:
name- the name of the schoolschoolClasses- the set of school classes in this schoolteachers- the set of teachers in this school
-
School
Constructs a new School with the specified name.- Parameters:
name- the name of the school
-
-
Method Details
-
getRooms
Returns the rooms of the school.- Returns:
- the rooms of the school
-
setRooms
Sets the rooms of the school.- Parameters:
rooms- the rooms to set
-
addRoom
Adds a room to the school.- Parameters:
room- the room to add
-
getRoom
Returns the room with the specified name.- Parameters:
name- the name of the room- Returns:
- the room with the specified name
-
getName
Returns the name of the school.- Returns:
- the name of the school
-
getConstraints
Returns the constraints of the school.- Returns:
- the constraints of the school
-
setConstraints
Sets the constraints of the school.- Parameters:
constraints- the constraints to set
-
getSchoolClasses
Returns the school classes of the school.- Returns:
- the school classes of the school
-
setSchoolClasses
Sets the school classes in this school.- Parameters:
schoolClasses- the set of school classes to set
-
getTeachers
Returns the teachers of the school.- Returns:
- the teachers of the school
-
setTeachers
Sets the teachers in this school.- Parameters:
teachers- the set of teachers to set
-
generateTimetables
@NotNull public @NotNull HashMap<String,Timetable> generateTimetables(int daysPerWeek, int maxHoursPerDay, int attempts) Generates timetables for all school classes in this school.- Parameters:
daysPerWeek- the number of days per weekmaxHoursPerDay- the maximum number of hours per day- Returns:
- a map of school class names to their respective timetables
-
addConstraint
Adds a constraint to all school classes in this school.- Parameters:
constraint- the constraint to add
-
removeConstraint
Removes a constraint from all school classes in this school.- Parameters:
constraint- the constraint to remove
-
exportAllTimetables
public void exportAllTimetables(@NotNull @NotNull Set<ExportData> exportData, @NotNull @NotNull Set<ExportFormat> exportFormat, String directory) Exports all timetables of the school to the specified directory in the specified formats.- Parameters:
exportData- the data to exportexportFormat- the formats to export indirectory- the directory to export to
-
addSchoolClass
Adds a school class to the school.- Parameters:
schoolClass- the school class to add
-
removeSchoolClass
Removes a school class from the school.- Parameters:
schoolClass- the school class to remove
-
updateConstraints
public void updateConstraints()Updates the constraints of the school. -
addTeacher
Adds a teacher to the school.- Parameters:
teacher- the teacher to add
-
removeTeacher
Removes a teacher from the school.- Parameters:
teacher- the teacher to remove
-