|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.ifs.model.Constraint<Activity,Location>
net.sf.cpsolver.ifs.example.tt.Resource
public class Resource
Resource constraint
Field Summary | |
---|---|
static int |
TYPE_CLASS
|
static int |
TYPE_INSTRUCTOR
|
static int |
TYPE_OTHER
|
static int |
TYPE_ROOM
|
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
iAssignedVariables, iConstraintListeners, iId |
Constructor Summary | |
---|---|
Resource(String id,
int type,
String name)
|
Method Summary | |
---|---|
void |
addDiscouragedSlot(int slot)
|
void |
addDiscouragedSlot(int day,
int hour)
|
void |
addProhibitedSlot(int slot)
|
void |
addProhibitedSlot(int day,
int hour)
|
void |
assigned(long iteration,
Location location)
Given value is to be assigned to its varable. |
void |
computeConflicts(Location location,
Set<Location> conflicts)
The only method which has to be implemented by any constraint. |
Set<Integer> |
getDiscouragedSlots()
|
String |
getName()
Constraint's name -- for printing purposes |
Set<Integer> |
getProhibitedSlots()
|
String |
getResourceId()
|
int |
getType()
|
boolean |
inConflict(Location location)
Returns true if the given assignment is inconsistent with the existing assignments respecting this constraint. |
boolean |
isConsistent(Location l1,
Location l2)
Returns true if the given assignments are consistent respecting this constraint. |
boolean |
isDiscouragedSlot(int slot)
|
boolean |
isDiscouragedSlot(int day,
int hour)
|
boolean |
isProhibited(int day,
int hour,
int length)
|
boolean |
isProhibitedSlot(int slot)
|
boolean |
isProhibitedSlot(int day,
int hour)
|
void |
setModel(Model<Activity,Location> model)
Sets the model which the constraint belongs to |
void |
unassigned(long iteration,
Location location)
Given value is unassigned from its variable. |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, addVariable, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, variables |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_ROOM
public static final int TYPE_INSTRUCTOR
public static final int TYPE_CLASS
public static final int TYPE_OTHER
Constructor Detail |
---|
public Resource(String id, int type, String name)
Method Detail |
---|
public void setModel(Model<Activity,Location> model)
Constraint
setModel
in class Constraint<Activity,Location>
public String getResourceId()
public String getName()
Constraint
getName
in class Constraint<Activity,Location>
public int getType()
public Set<Integer> getProhibitedSlots()
public Set<Integer> getDiscouragedSlots()
public void addProhibitedSlot(int day, int hour)
public void addDiscouragedSlot(int day, int hour)
public boolean isProhibitedSlot(int day, int hour)
public boolean isDiscouragedSlot(int day, int hour)
public void addProhibitedSlot(int slot)
public void addDiscouragedSlot(int slot)
public boolean isProhibitedSlot(int slot)
public boolean isDiscouragedSlot(int slot)
public boolean isProhibited(int day, int hour, int length)
public void computeConflicts(Location location, Set<Location> conflicts)
Constraint
computeConflicts
in class Constraint<Activity,Location>
location
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Location location)
Constraint
MacPropagation
).
inConflict
in class Constraint<Activity,Location>
public boolean isConsistent(Location l1, Location l2)
Constraint
MacPropagation
).
isConsistent
in class Constraint<Activity,Location>
public void assigned(long iteration, Location location)
Constraint
assigned
in class Constraint<Activity,Location>
public void unassigned(long iteration, Location location)
Constraint
unassigned
in class Constraint<Activity,Location>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |