net.sf.cpsolver.studentsct.constraint
Class LinkedSections.LinkedSectionsConstraint

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Constraint<Request,Enrollment>
      extended by net.sf.cpsolver.studentsct.constraint.LinkedSections.LinkedSectionsConstraint
All Implemented Interfaces:
Comparable<Constraint<Request,Enrollment>>
Enclosing class:
LinkedSections

public class LinkedSections.LinkedSectionsConstraint
extends Constraint<Request,Enrollment>

Linked sections constraint -- to be created for each student that requests two or more offerings of this link


Field Summary
 
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint
iAssignedVariables, iConstraintListeners, iId
 
Constructor Summary
protected LinkedSections.LinkedSectionsConstraint(Student student, Collection<Request> requests)
          Constructor
 
Method Summary
 void computeConflicts(Enrollment value, Set<Enrollment> conflicts)
          Compute conflicts using LinkedSections.computeConflicts(Enrollment, ConflictHandler)
 LinkedSections getLinkedSections()
          Return linked section
 Student getStudent()
          Return student
 boolean inConflict(Enrollment value)
          Check for conflict using LinkedSections.inConflict(Enrollment)
 boolean isConsistent(Enrollment enrollment, Enrollment other)
          Check consistency using LinkedSections.inConflict(Enrollment, Assignment)
 String toString()
           
 
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint
addConstraintListener, addVariable, assigned, assignedVariables, compareTo, 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

LinkedSections.LinkedSectionsConstraint

protected LinkedSections.LinkedSectionsConstraint(Student student,
                                                  Collection<Request> requests)
Constructor

Parameters:
student - a student
requests - sub-set of student requests Student.getRequests() that contains offerings of this link
Method Detail

getStudent

public Student getStudent()
Return student


getLinkedSections

public LinkedSections getLinkedSections()
Return linked section


computeConflicts

public void computeConflicts(Enrollment value,
                             Set<Enrollment> conflicts)
Compute conflicts using LinkedSections.computeConflicts(Enrollment, ConflictHandler)

Specified by:
computeConflicts in class Constraint<Request,Enrollment>
Parameters:
value - value to be assigned to its varaible
conflicts - resultant set of conflicting values

isConsistent

public boolean isConsistent(Enrollment enrollment,
                            Enrollment other)
Check consistency using LinkedSections.inConflict(Enrollment, Assignment)

Overrides:
isConsistent in class Constraint<Request,Enrollment>

inConflict

public boolean inConflict(Enrollment value)
Check for conflict using LinkedSections.inConflict(Enrollment)

Overrides:
inConflict in class Constraint<Request,Enrollment>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 UniTime LLC. All Rights Reserved.