org.cpsolver.coursett.custom

## Class DeterministicStudentSectioning

- java.lang.Object
- - org.cpsolver.coursett.model.DefaultStudentSectioning
  - - org.cpsolver.coursett.custom.DeterministicStudentSectioning

- All Implemented Interfaces:
    StudentSectioning, InfoProvider<Lecture,Placement>

      public class DeterministicStudentSectioning
      extends DefaultStudentSectioning

  Deterministic implementation of the initial student sectioning. This class assign students to groups in a deterministic way. Students are ordered by their academic information (curriculum) and unique ids and assigned in this order to the first available group (configuration or lecture). See `StudentSectioning` and `DefaultStudentSectioning` for more details about sectioning students during course timetabling.
  This deterministic sectioning can be enabled by setting the following parameter:

       StudentSectioning.Class=org.cpsolver.coursett.custom.DeterministicStudentSectioning

  Version:
    CourseTT 1.3 (University Course Timetabling)
    Copyright (C) 2014 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This customization has been implemented for AGH, Poland.
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.
  Author:
    Tomáš Müller

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DeterministicStudentSectioning.DeterministicInitialSectioning` Assign students to groups in a deterministic way, i.e., first student to first available group etc.

  - ### Field Summary

    - ### Fields inherited from class org.cpsolver.coursett.model.DefaultStudentSectioning

      `iFinalSectioning, iModel, iMustFollowReservations, sDF2`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DeterministicStudentSectioning(TimetableModel model)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasFinalSectioning()` No re-sectioning (final sectioning) during deterministic student sectioning.
    `void` | `resection(Assignment<Lecture,Placement> assignment, Lecture lecture, boolean recursive, boolean configAsWell)` No re-sectioning (final sectioning) during deterministic student sectioning.
    `protected InitialSectioning.Group[]` | `studentsToConfigurations(Long offeringId, Collection<Student> students, Collection<Configuration> configurations)` Section students into configurations.
    `protected InitialSectioning.Group[]` | `studentsToLectures(Long offeringId, Collection<Student> students, Collection<Lecture> lectures)` Section students into lectures.
    `void` | `switchStudents(Solution<Lecture,Placement> solution, TerminationCondition<Lecture,Placement> termination)` No re-sectioning (final sectioning) during deterministic student sectioning.

    - ### Methods inherited from class org.cpsolver.coursett.model.DefaultStudentSectioning

      `getClassLabel, getInfo, getInfo, getProgress, initialSectioning, initialSectioningLectures, isMustFollowReservations, setMustFollowReservations`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DeterministicStudentSectioning

          public DeterministicStudentSectioning(TimetableModel model)

  - ### Method Detail

    - #### studentsToConfigurations

          protected InitialSectioning.Group[] studentsToConfigurations(Long offeringId,
                                                                       Collection<Student> students,
                                                                       Collection<Configuration> configurations)

      Description copied from class: `DefaultStudentSectioning`
      Section students into configurations. This method calls the actual initial sectioning `InitialSectioning.getGroups()`.
      Overrides:
        `studentsToConfigurations` in class `DefaultStudentSectioning`
      Parameters:
        `offeringId` - instructional offering id
        `students` - list of students to be sectioned
        `configurations` - list of configurations the students are to be sectioned into
      Returns:
        list of `InitialSectioning.Group`

    - #### studentsToLectures

          protected InitialSectioning.Group[] studentsToLectures(Long offeringId,
                                                                 Collection<Student> students,
                                                                 Collection<Lecture> lectures)

      Description copied from class: `DefaultStudentSectioning`
      Section students into lectures. This method calls the actual initial sectioning `InitialSectioning.getGroups()`.
      Overrides:
        `studentsToLectures` in class `DefaultStudentSectioning`
      Parameters:
        `offeringId` - instructional offering id
        `students` - list of students to be sectioned
        `lectures` - list of lectures the students are to be sectioned into
      Returns:
        list of `InitialSectioning.Group`

    - #### hasFinalSectioning

          public boolean hasFinalSectioning()

      No re-sectioning (final sectioning) during deterministic student sectioning.
      Specified by:
        `hasFinalSectioning` in interface `StudentSectioning`
      Overrides:
        `hasFinalSectioning` in class `DefaultStudentSectioning`
      Returns:
        true if final student sectioning is implemented

    - #### switchStudents

          public void switchStudents(Solution<Lecture,Placement> solution,
                                     TerminationCondition<Lecture,Placement> termination)

      No re-sectioning (final sectioning) during deterministic student sectioning.
      Specified by:
        `switchStudents` in interface `StudentSectioning`
      Overrides:
        `switchStudents` in class `DefaultStudentSectioning`
      Parameters:
        `solution` - current solution
        `termination` - termination condition (optional)

    - #### resection

          public void resection(Assignment<Lecture,Placement> assignment,
                                Lecture lecture,
                                boolean recursive,
                                boolean configAsWell)

      No re-sectioning (final sectioning) during deterministic student sectioning.
      Specified by:
        `resection` in interface `StudentSectioning`
      Overrides:
        `resection` in class `DefaultStudentSectioning`
      Parameters:
        `assignment` - current assignment
        `lecture` - given lecture
        `recursive` - recursively resection lectures affected by a student swap
        `configAsWell` - resection students between configurations as well