org.cpsolver.coursett.sectioning

## Class SctSectioning

- java.lang.Object
- - org.cpsolver.coursett.model.DefaultStudentSectioning
  - - org.cpsolver.coursett.sectioning.SctSectioning

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

      public class SctSectioning
      extends DefaultStudentSectioning
      implements InfoProvider<Lecture,Placement>

  Student sectioning implementation based on branch & bound. This sectioning takes each offering one by one and it is using a branch & bound algorithm to find the best possible enrollment of all students into the given course. The sectioning considers both student conflict weights and student groups.
  Version:
    CourseTT 1.3 (University Course Timetabling)
    Copyright (C) 2017 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    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/.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `SctSectioning.GroupBasedInitialSectioning`

  - ### Field Summary

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

      `iFinalSectioning, iModel, sDF2`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SctSectioning(TimetableModel model)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected List<StudentConflict>` | `getStudentConflictCriteria()` List of student conflict criteria
    `boolean` | `hasFinalSectioning()` Return true if final student sectioning is implemented.
    `protected boolean` | `hasStudentGroups(Collection<Student> students)`
    `void` | `resection(Assignment<Lecture,Placement> assignment, Lecture lecture, boolean recursive, boolean configAsWell)` Perform sectioning on the given lecture
    `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)` Run student final sectioning (switching students between sections of the same class in order to minimize overall number of student conflicts).
    `protected double` | `value(Solution<Lecture,Placement> solution)` Student conflict weight for the given solution

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

      `getClassLabel, getInfo, getInfo, getProgress, initialSectioning, initialSectioningLectures`

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

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

    - ### Methods inherited from interface org.cpsolver.ifs.model.InfoProvider

      `getInfo, getInfo`

- - ### Constructor Detail

    - #### SctSectioning

          public SctSectioning(TimetableModel model)

  - ### Method Detail

    - #### hasFinalSectioning

          public boolean hasFinalSectioning()

      Description copied from class: `DefaultStudentSectioning`
      Return true if final student sectioning is implemented.
      Specified by:
        `hasFinalSectioning` in interface `StudentSectioning`
      Overrides:
        `hasFinalSectioning` in class `DefaultStudentSectioning`
      Returns:
        true if final student sectioning is implemented

    - #### getStudentConflictCriteria

          protected List<StudentConflict> getStudentConflictCriteria()

      List of student conflict criteria

    - #### value

          protected double value(Solution<Lecture,Placement> solution)

      Student conflict weight for the given solution

    - #### switchStudents

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

      Description copied from class: `DefaultStudentSectioning`
      Run student final sectioning (switching students between sections of the same class in order to minimize overall number of student conflicts).
      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)

      Description copied from class: `DefaultStudentSectioning`
      Perform sectioning on the given lecture
      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

    - #### hasStudentGroups

          protected boolean hasStudentGroups(Collection<Student> students)

    - #### 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`