org.cpsolver.coursett.sectioning

## Class SctModel

- java.lang.Object
- - org.cpsolver.coursett.sectioning.SctModel

-     public class SctModel
      extends Object

  A model representing student enrollments of a course. Branch & bound algorithm is used to propose best possible enrollment of all students into the given course.
  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/.
  Author:
    Tomáš Müller

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static double` | `sEps`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SctModel(TimetableModel model, Assignment<Lecture,Placement> assignment)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assign(org.cpsolver.coursett.sectioning.SctModel.SctSolution solution)` Assign given solution
    `org.cpsolver.coursett.sectioning.SctModel.SctSolution` | `computeSolution()` Compute best possible enrollment of students into the given offering
    `void` | `computeSolution(org.cpsolver.coursett.sectioning.SctModel.SctSolution solution, int index, SctEnrollment[] enrollments, Map<Long,Double> limits, Map<Long,Map<Long,org.cpsolver.coursett.sectioning.SctModel.Match>> match, double totalConflicts, long t0)` Compute best possible enrollment of students into the given offering
    `org.cpsolver.coursett.sectioning.SctModel.SctSolution` | `currentSolution()`
    `protected void` | `decJenrl(Assignment<Lecture,Placement> assignment, Student student, Lecture l1, Lecture l2)` Decrement `JenrlConstraint` between the given two classes by the given student
    `Assignment<Lecture,Placement>` | `getAssignment()` Current assignment
    `List<Configuration>` | `getConfigurations()` All configuration of the selected offering
    `Long` | `getOfferingId()` Selected offering id
    `List<StudentConflict>` | `getStudentConflictCriteria()` List of student conflict criteria
    `Map<Long,Set<Lecture>>` | `getSubparts(Configuration configuration)` List of scheduling subparts and their classes of the given configuration
    `TimetableModel` | `getTimetableModel()` Course timetabling model
    `protected double` | `group(SctEnrollment[] enrollments, int index, Map<Long,Double> limits, Map<Long,Map<Long,org.cpsolver.coursett.sectioning.SctModel.Match>> matches)` Group weight of the given enrollments (up until the given index, computing bound for students above the index)
    `protected void` | `incJenrl(Assignment<Lecture,Placement> assignment, Student student, Lecture l1, Lecture l2)` Increment `JenrlConstraint` between the given two classes by the given student
    `boolean` | `isTimeOutReached()` Was time out reached while `computeSolution()` was called?
    `void` | `setConfiguration(Configuration config)` Select an offering for the model
    `void` | `unassign()` Unassign all previous enrollments into the given offering

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

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

- - ### Field Detail

    - #### sEps

          public static double sEps

  - ### Constructor Detail

    - #### SctModel

          public SctModel(TimetableModel model,
                          Assignment<Lecture,Placement> assignment)

      Constructor
      Parameters:
        `model` - course timetabling model
        `assignment` - current assignment

  - ### Method Detail

    - #### getStudentConflictCriteria

          public List<StudentConflict> getStudentConflictCriteria()

      List of student conflict criteria

    - #### getConfigurations

          public List<Configuration> getConfigurations()

      All configuration of the selected offering

    - #### setConfiguration

          public void setConfiguration(Configuration config)

      Select an offering for the model

    - #### getSubparts

          public Map<Long,Set<Lecture>> getSubparts(Configuration configuration)

      List of scheduling subparts and their classes of the given configuration

    - #### getOfferingId

          public Long getOfferingId()

      Selected offering id

    - #### getTimetableModel

          public TimetableModel getTimetableModel()

      Course timetabling model

    - #### getAssignment

          public Assignment<Lecture,Placement> getAssignment()

      Current assignment

    - #### group

          protected double group(SctEnrollment[] enrollments,
                                 int index,
                                 Map<Long,Double> limits,
                                 Map<Long,Map<Long,org.cpsolver.coursett.sectioning.SctModel.Match>> matches)

      Group weight of the given enrollments (up until the given index, computing bound for students above the index)

    - #### computeSolution

          public void computeSolution(org.cpsolver.coursett.sectioning.SctModel.SctSolution solution,
                                      int index,
                                      SctEnrollment[] enrollments,
                                      Map<Long,Double> limits,
                                      Map<Long,Map<Long,org.cpsolver.coursett.sectioning.SctModel.Match>> match,
                                      double totalConflicts,
                                      long t0)

      Compute best possible enrollment of students into the given offering

    - #### computeSolution

          public org.cpsolver.coursett.sectioning.SctModel.SctSolution computeSolution()

      Compute best possible enrollment of students into the given offering

    - #### isTimeOutReached

          public boolean isTimeOutReached()

      Was time out reached while `computeSolution()` was called?

    - #### currentSolution

          public org.cpsolver.coursett.sectioning.SctModel.SctSolution currentSolution()

    - #### decJenrl

          protected void decJenrl(Assignment<Lecture,Placement> assignment,
                                  Student student,
                                  Lecture l1,
                                  Lecture l2)

      Decrement `JenrlConstraint` between the given two classes by the given student

    - #### incJenrl

          protected void incJenrl(Assignment<Lecture,Placement> assignment,
                                  Student student,
                                  Lecture l1,
                                  Lecture l2)

      Increment `JenrlConstraint` between the given two classes by the given student

    - #### unassign

          public void unassign()

      Unassign all previous enrollments into the given offering

    - #### assign

          public void assign(org.cpsolver.coursett.sectioning.SctModel.SctSolution solution)

      Assign given solution