net.sf.cpsolver.studentsct.heuristics.selection
Class BranchBoundSelection.Selection

java.lang.Object
  extended by net.sf.cpsolver.studentsct.heuristics.selection.BranchBoundSelection.Selection
Direct Known Subclasses:
OnlineSelection.EpsilonSelection
Enclosing class:
BranchBoundSelection

public class BranchBoundSelection.Selection
extends Object

Branch & bound selection for a student


Field Summary
protected  Enrollment[] iAssignment
          Current assignment
protected  Enrollment[] iBestAssignment
          Best assignment
protected  double iBestValue
          Best value
protected  Student iStudent
          Student
protected  long iT0
          Start time
protected  long iT1
          End time
protected  boolean iTimeoutReached
          Was timeout reached
protected  Hashtable iValues
          Value cache
 
Constructor Summary
BranchBoundSelection.Selection(Student student)
          Constructor
 
Method Summary
 void backTrack(int idx)
          branch & bound search
 boolean canAssign(Request request, int idx)
          True if the given request can be assigned
 Enrollment firstConflict(int idx, Enrollment enrollment)
          First conflicting enrollment
protected  double getAssignmentPenalty(int i)
          Assignment penalty
 Enrollment[] getBestAssignment()
          Best schedule
 int getBestNrAssigned()
          Number of requests assigned in the best schedule
 double getBestValue()
          Value of the best schedule
 double getBound(int idx)
          Bound for the current schedule
 int getNrAssigned()
          Number of assigned requests in the current schedule
 int getNrAssignedBound(int idx)
          Bound for the number of assigned requests in the current schedule
 double getNrDistanceConflicts(int idx)
          Number of distance conflicts of idx-th assignment of the current schedule
 double getPenalty()
          Penalty of the current schedule
 double getPenaltyBound(int idx)
          Penalty bound of the current schedule
 long getTime()
          Time (in milliseconds) the branch & bound did run
 double getValue()
          Value of the current schedule
 boolean isTimeoutReached()
          Was timeout reached
 void saveBest()
          Save the current schedule as the best
 BranchBoundSelection.BranchBoundNeighbour select()
          Execute branch & bound, return the best found schedule for the selected student.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iStudent

protected Student iStudent
Student


iT0

protected long iT0
Start time


iT1

protected long iT1
End time


iTimeoutReached

protected boolean iTimeoutReached
Was timeout reached


iAssignment

protected Enrollment[] iAssignment
Current assignment


iBestAssignment

protected Enrollment[] iBestAssignment
Best assignment


iBestValue

protected double iBestValue
Best value


iValues

protected Hashtable iValues
Value cache

Constructor Detail

BranchBoundSelection.Selection

public BranchBoundSelection.Selection(Student student)
Constructor

Parameters:
student - selected student
Method Detail

select

public BranchBoundSelection.BranchBoundNeighbour select()
Execute branch & bound, return the best found schedule for the selected student.


isTimeoutReached

public boolean isTimeoutReached()
Was timeout reached


getTime

public long getTime()
Time (in milliseconds) the branch & bound did run


getBestAssignment

public Enrollment[] getBestAssignment()
Best schedule


getBestValue

public double getBestValue()
Value of the best schedule


getBestNrAssigned

public int getBestNrAssigned()
Number of requests assigned in the best schedule


getNrAssignedBound

public int getNrAssignedBound(int idx)
Bound for the number of assigned requests in the current schedule


getNrDistanceConflicts

public double getNrDistanceConflicts(int idx)
Number of distance conflicts of idx-th assignment of the current schedule


getBound

public double getBound(int idx)
Bound for the current schedule


getValue

public double getValue()
Value of the current schedule


getAssignmentPenalty

protected double getAssignmentPenalty(int i)
Assignment penalty


getPenalty

public double getPenalty()
Penalty of the current schedule


getPenaltyBound

public double getPenaltyBound(int idx)
Penalty bound of the current schedule


saveBest

public void saveBest()
Save the current schedule as the best


firstConflict

public Enrollment firstConflict(int idx,
                                Enrollment enrollment)
First conflicting enrollment


canAssign

public boolean canAssign(Request request,
                         int idx)
True if the given request can be assigned


getNrAssigned

public int getNrAssigned()
Number of assigned requests in the current schedule


backTrack

public void backTrack(int idx)
branch & bound search