public class BranchBoundSelection.Selection extends Object
Modifier and Type | Field and Description |
---|---|
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 HashMap<CourseRequest,List<Enrollment>> |
iValues
Value cache
|
Modifier and Type | Method and Description |
---|---|
void |
backTrack(int idx)
branch & bound search
|
boolean |
canAssign(Request request,
int idx)
True if the given request can be assigned
|
protected boolean |
canLeaveUnassigned(Request request)
Returns true if the given request can be left unassigned
|
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
|
protected double |
getBound(Request r)
Return bound of a request
|
Set<DistanceConflict.Conflict> |
getDistanceConflicts(int idx)
Distance conflicts of idx-th assignment of 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 |
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
|
Set<TimeOverlapsCounter.Conflict> |
getTimeOverlappingConflicts(int idx)
Time overlapping conflicts of idx-th assignment of the current
schedule
|
double |
getValue()
Value of the current schedule
|
protected double |
getWeight(Enrollment enrollment,
Set<DistanceConflict.Conflict> distanceConflicts,
Set<TimeOverlapsCounter.Conflict> timeOverlappingConflicts)
Weight of an assignment.
|
boolean |
inConflict(int idx,
Enrollment enrollment)
True if the enrollment is conflicting
|
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.
|
protected List<Enrollment> |
values(CourseRequest request)
Returns list of available enrollments for a course request
|
protected long iT0
protected long iT1
protected boolean iTimeoutReached
protected Enrollment[] iAssignment
protected Enrollment[] iBestAssignment
protected double iBestValue
protected HashMap<CourseRequest,List<Enrollment>> iValues
public BranchBoundSelection.BranchBoundNeighbour select()
public boolean isTimeoutReached()
public long getTime()
public Enrollment[] getBestAssignment()
public double getBestValue()
public int getBestNrAssigned()
public int getNrAssignedBound(int idx)
public Set<DistanceConflict.Conflict> getDistanceConflicts(int idx)
public Set<TimeOverlapsCounter.Conflict> getTimeOverlappingConflicts(int idx)
protected double getWeight(Enrollment enrollment, Set<DistanceConflict.Conflict> distanceConflicts, Set<TimeOverlapsCounter.Conflict> timeOverlappingConflicts)
StudentWeights.getWeight(Enrollment, Set, Set)
, only count this side of distance conflicts and time overlaps.public double getBound(int idx)
public double getValue()
protected double getAssignmentPenalty(int i)
public double getPenalty()
public double getPenaltyBound(int idx)
public void saveBest()
public boolean inConflict(int idx, Enrollment enrollment)
public Enrollment firstConflict(int idx, Enrollment enrollment)
public boolean canAssign(Request request, int idx)
public int getNrAssigned()
protected boolean canLeaveUnassigned(Request request)
protected List<Enrollment> values(CourseRequest request)
public void backTrack(int idx)