net.sf.cpsolver.studentsct.model
Class Enrollment

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Value
      extended by net.sf.cpsolver.studentsct.model.Enrollment
All Implemented Interfaces:
Comparable

public class Enrollment
extends Value

Representation of an enrollment of a student into a course. A student needs to be enrolled in a section of each subpart of a selected configuration. When parent-child relation is defined among sections, if a student is enrolled in a section that has a parent section defined, he/she has be enrolled in the parent section as well. Also, the selected sections cannot overlap in time.

Version:
StudentSct 1.1 (Student Sectioning)
Copyright (C) 2007 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic

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 2.1 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Field Summary
static double sAlterativeWeight
           
static double sDistConfWeight
           
static double sInitialWeight
           
static double sMinWeight
           
static double sNormPenalty
           
static double sPriorityWeight
           
static double sSelectedWeight
           
static double sWaitlistedWeight
           
 
Fields inherited from class net.sf.cpsolver.ifs.model.Value
iValue
 
Constructor Summary
Enrollment(Request request, double value, Config config, Set assignments)
          Constructor
 
Method Summary
 boolean equals(Object o)
          By default, comparison is made on unique ids
 Set getAssignments()
          List of assignments (selected sections)
 Config getConfig()
          Config of the course request
 String getName()
          Enrollment name
 Offering getOffering()
          Offering of the course request
 double getPenalty()
          Enrollment penalty -- sum of section penalties (see Section.getPenalty())
 Request getRequest()
          Request
 Student getStudent()
          Student
 boolean isCourseRequest()
          True if the request is course request
 boolean isOverlapping(Enrollment enrl)
          True when this enrollment is overlapping with the given enrollment
 boolean isSelected()
          True if all the sections are selected
 boolean isWaitlisted()
          True if all the sections are wait-listed
static double normalizePenalty(double penalty)
          Normalized enrollment penalty -- to be used in toDouble()
 double nrDistanceConflicts()
          Number of distance conflicts, in which this enrollment is involved.
 double percentInitial()
          Percent of sections that are initial
 double percentSelected()
          Percent of sections that are selected
 double percentWaitlisted()
          Percent of sections that are wait-listed
 double toDouble()
          Enrollment value
 double toDouble(double nrDistanceConflicts)
          Enrollment value
 String toString()
           
 
Methods inherited from class net.sf.cpsolver.ifs.model.Value
assigned, compareTo, conflicts, countAssignments, getDescription, getExtra, getId, hashCode, isConsistent, lastAssignmentIteration, lastUnassignmentIteration, setExtra, setVariable, unassigned, valueEquals, variable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

sPriorityWeight

public static double sPriorityWeight

sAlterativeWeight

public static double sAlterativeWeight

sInitialWeight

public static double sInitialWeight

sSelectedWeight

public static double sSelectedWeight

sWaitlistedWeight

public static double sWaitlistedWeight

sMinWeight

public static double sMinWeight

sNormPenalty

public static double sNormPenalty

sDistConfWeight

public static double sDistConfWeight
Constructor Detail

Enrollment

public Enrollment(Request request,
                  double value,
                  Config config,
                  Set assignments)
Constructor

Parameters:
request - course / free time request
value - value (1.0 for primary course, 0.5 for the first alternative, etc.)
config - selected configuration
assignments - valid list of sections
Method Detail

getStudent

public Student getStudent()
Student


getRequest

public Request getRequest()
Request


isCourseRequest

public boolean isCourseRequest()
True if the request is course request


getOffering

public Offering getOffering()
Offering of the course request


getConfig

public Config getConfig()
Config of the course request


getAssignments

public Set getAssignments()
List of assignments (selected sections)


isOverlapping

public boolean isOverlapping(Enrollment enrl)
True when this enrollment is overlapping with the given enrollment


percentWaitlisted

public double percentWaitlisted()
Percent of sections that are wait-listed


percentSelected

public double percentSelected()
Percent of sections that are selected


percentInitial

public double percentInitial()
Percent of sections that are initial


isWaitlisted

public boolean isWaitlisted()
True if all the sections are wait-listed


isSelected

public boolean isSelected()
True if all the sections are selected


getPenalty

public double getPenalty()
Enrollment penalty -- sum of section penalties (see Section.getPenalty())


normalizePenalty

public static double normalizePenalty(double penalty)
Normalized enrollment penalty -- to be used in toDouble()


toDouble

public double toDouble()
Enrollment value

Overrides:
toDouble in class Value

toDouble

public double toDouble(double nrDistanceConflicts)
Enrollment value


getName

public String getName()
Enrollment name

Overrides:
getName in class Value

toString

public String toString()
Overrides:
toString in class Value

equals

public boolean equals(Object o)
Description copied from class: Value
By default, comparison is made on unique ids

Overrides:
equals in class Value

nrDistanceConflicts

public double nrDistanceConflicts()
Number of distance conflicts, in which this enrollment is involved.