net.sf.cpsolver.studentsct.constraint
Class StudentConflict

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Constraint
      extended by net.sf.cpsolver.studentsct.constraint.StudentConflict

public class StudentConflict
extends Constraint

This constraints ensures that a student is not enrolled into sections that are overlapping 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
 
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint
iAssignedVariables, iConstraintListeners, iId
 
Constructor Summary
StudentConflict()
           
 
Method Summary
 void computeConflicts(Value value, Set conflicts)
          A given enrollment is conflicting when the student is enrolled into another course / free time request that has an assignment that is overlapping with one or more assignments of the given section.
 boolean inConflict(Value value)
          A given enrollment is conflicting when the student is enrolled into another course / free time request that has an assignment that is overlapping with one or more assignments of the given section.
 boolean isConsistent(Value value1, Value value2)
          Two enrollments are consistent if they are not overlapping in time
 String toString()
           
 
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint
addConstraintListener, addVariable, assigned, assignedVariables, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, getName, hashCode, isHard, removeConstraintListener, removeVariable, setModel, unassigned, variables
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StudentConflict

public StudentConflict()
Method Detail

computeConflicts

public void computeConflicts(Value value,
                             Set conflicts)
A given enrollment is conflicting when the student is enrolled into another course / free time request that has an assignment that is overlapping with one or more assignments of the given section. See Enrollment.isOverlapping(Enrollment) for more details. All such overlapping enrollments are added into the provided set of conflicts.

Specified by:
computeConflicts in class Constraint
Parameters:
value - Enrollment that is being considered
conflicts - resultant list of conflicting enrollments

isConsistent

public boolean isConsistent(Value value1,
                            Value value2)
Two enrollments are consistent if they are not overlapping in time

Overrides:
isConsistent in class Constraint

inConflict

public boolean inConflict(Value value)
A given enrollment is conflicting when the student is enrolled into another course / free time request that has an assignment that is overlapping with one or more assignments of the given section. See Enrollment.isOverlapping(Enrollment) for more details.

Overrides:
inConflict in class Constraint
Parameters:
value - Enrollment that is being considered
Returns:
true, if the student is enrolled into another enrollment of a different request that is overlapping in time with the given enrollment

toString

public String toString()
Overrides:
toString in class Object