Class School

java.lang.Object
at.htl.timetableGenerator.model.School

public class School extends Object
This class represents a school. A school is defined by a set of school classes and a set of teachers.
  • 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 school
      schoolClasses - the set of school classes in this school
      teachers - the set of teachers in this school
    • School

      public School(String name)
      Constructs a new School with the specified name.
      Parameters:
      name - the name of the school
  • Method Details

    • getRooms

      @NotNull public @NotNull Map<String,Room> getRooms()
      Returns the rooms of the school.
      Returns:
      the rooms of the school
    • setRooms

      public void setRooms(@NotNull @NotNull Map<String,Room> rooms)
      Sets the rooms of the school.
      Parameters:
      rooms - the rooms to set
    • addRoom

      public void addRoom(@NotNull @NotNull Room room)
      Adds a room to the school.
      Parameters:
      room - the room to add
    • getRoom

      public Room getRoom(String name)
      Returns the room with the specified name.
      Parameters:
      name - the name of the room
      Returns:
      the room with the specified name
    • getName

      public String getName()
      Returns the name of the school.
      Returns:
      the name of the school
    • getConstraints

      public Set<Constraint> getConstraints()
      Returns the constraints of the school.
      Returns:
      the constraints of the school
    • setConstraints

      public void setConstraints(Set<Constraint> constraints)
      Sets the constraints of the school.
      Parameters:
      constraints - the constraints to set
    • getSchoolClasses

      @NotNull public @NotNull Set<SchoolClass> getSchoolClasses()
      Returns the school classes of the school.
      Returns:
      the school classes of the school
    • setSchoolClasses

      public void setSchoolClasses(@NotNull @NotNull Set<SchoolClass> schoolClasses)
      Sets the school classes in this school.
      Parameters:
      schoolClasses - the set of school classes to set
    • getTeachers

      @NotNull public @NotNull Set<Teacher> getTeachers()
      Returns the teachers of the school.
      Returns:
      the teachers of the school
    • setTeachers

      public void setTeachers(@NotNull @NotNull Set<Teacher> teachers)
      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 week
      maxHoursPerDay - the maximum number of hours per day
      Returns:
      a map of school class names to their respective timetables
    • addConstraint

      public void addConstraint(Constraint constraint)
      Adds a constraint to all school classes in this school.
      Parameters:
      constraint - the constraint to add
    • removeConstraint

      public void removeConstraint(Constraint constraint)
      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 export
      exportFormat - the formats to export in
      directory - the directory to export to
    • addSchoolClass

      public void addSchoolClass(SchoolClass schoolClass)
      Adds a school class to the school.
      Parameters:
      schoolClass - the school class to add
    • removeSchoolClass

      public void removeSchoolClass(SchoolClass schoolClass)
      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

      public void addTeacher(Teacher teacher)
      Adds a teacher to the school.
      Parameters:
      teacher - the teacher to add
    • removeTeacher

      public void removeTeacher(Teacher teacher)
      Removes a teacher from the school.
      Parameters:
      teacher - the teacher to remove