|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.model.Variable net.sf.cpsolver.studentsct.model.Request
public abstract class Request
Representation of a request of a student for a course(s) or a free time. This can be either CourseRequest
or FreeTimeRequest
.
Each request contains id, priority, weight, and a student. A request can be also marked as alternative.
For each student, all non-alternative requests should be satisfied (an enrollment is assigned to a request). If not, an alternative request can be
assigned instead of a non-alternative course request. In the case when only one of two requests can be assigned, the one with the lowest priority
is preferred.
Field Summary | |
---|---|
static boolean |
sCacheValues
True means that method values() will cache its results. |
Fields inherited from class net.sf.cpsolver.ifs.model.Variable |
---|
iValue |
Constructor Summary | |
---|---|
Request(long id,
int priority,
boolean alternative,
Student student)
Constructor |
Method Summary | |
---|---|
void |
assign(long iteration,
Value value)
Assign given enrollment to this request. |
int |
compareTo(Object o)
Compare to requests, non-alternative requests go first, otherwise use priority (a request with lower priority goes first) |
abstract Vector |
computeEnrollments()
Compute available enrollments |
abstract double |
getBound()
Get bound, i.e., the value of the best possible enrollment |
long |
getId()
Request id |
int |
getPriority()
Request priority -- if there is a choice, request with lower priority is more preferred to be assigned |
Student |
getStudent()
Student to which this request belongs |
double |
getWeight()
Request weight, set by default to 1.0, defines the amount of space which will be taken in the section by this request. |
boolean |
isAlternative()
True, if the request is alternative (alternative request can be assigned instead of a non-alternative course requests, if it is left unassigned) |
void |
setPriority(int priority)
Set request priority |
void |
setWeight(double weight)
Set request weight. |
void |
unassign(long iteration)
Unassign currently assigned enrollment from this request. |
Vector |
values()
Domain of this variable -- list of available enrollments. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static boolean sCacheValues
values()
will cache its results.
Constructor Detail |
---|
public Request(long id, int priority, boolean alternative, Student student)
id
- course/free time request unique idpriority
- request priority -- if there is a choice, request with lower priority is more preferred to be assignedalternative
- true if the request is alternative (alternative request can be assigned instead of a non-alternative course requests, if it is left unassigned)student
- student to which this request belongsMethod Detail |
---|
public long getId()
getId
in class Variable
public int getPriority()
public void setPriority(int priority)
public boolean isAlternative()
public Student getStudent()
public int compareTo(Object o)
compareTo
in interface Comparable
compareTo
in class Variable
public abstract Vector computeEnrollments()
public Vector values()
computeEnrollments()
is used.
values
in class Variable
public void assign(long iteration, Value value)
Assignment.assigned(Enrollment)
on for all the assignments of the enrollment.
assign
in class Variable
iteration
- current iterationvalue
- the value to be assignedpublic void unassign(long iteration)
Assignment.unassigned(Enrollment)
on for all the assignments of the current enrollment.
unassign
in class Variable
iteration
- current iterationpublic abstract double getBound()
public double getWeight()
public void setWeight(double weight)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |