|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.model.Value net.sf.cpsolver.ifs.example.tt.Location
public class Location
Location (value, i.e., a single placement of the activity). Location encodes a slot and a selection of resources.
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.model.Value |
---|
iValue |
Constructor Summary | |
---|---|
Location(Activity activity,
int day,
int hour,
Resource[] resources)
Constructor. slot = nrHours * day + hour |
|
Location(Activity activity,
int slot,
Resource[] resources)
Constructor. |
Method Summary | |
---|---|
int |
computeNrOfDiscouragedSlots()
Computes number of discouraged slots (over all resources and the activity) |
boolean |
containResource(Resource resource)
Returns true if the given resource is used by this location |
String |
getName()
Values name -- for printing purposes (E.g., Monday 7:30) |
int |
getNrOfDiscouragedSlots()
Number of slots (over all resources) which are discouraged |
Resource |
getResource(int idx)
Gets given resource |
Resource[] |
getResources()
Gets selection of resources |
int |
getSlot()
Gets slot |
boolean |
hasIntersection(Location location)
Returns true if the location intersects with another location. |
boolean |
isProhibited()
Returns true if the location is prohibited. |
double |
toDouble()
Int value (for optimization) -- getNrOfDiscouragedSlots() is returned |
Methods inherited from class net.sf.cpsolver.ifs.model.Value |
---|
assigned, compareTo, conflicts, countAssignments, equals, getDescription, getExtra, getId, hashCode, isConsistent, lastAssignmentIteration, lastUnassignmentIteration, setExtra, setVariable, toString, unassigned, valueEquals, variable |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Location(Activity activity, int slot, Resource[] resources)
activity
- parent activityslot
- starting timeresources
- selection of resourcespublic Location(Activity activity, int day, int hour, Resource[] resources)
activity
- parent activityday
- dayhour
- starting hourresources
- required resourcesMethod Detail |
---|
public int getSlot()
public Resource[] getResources()
public Resource getResource(int idx)
public boolean containResource(Resource resource)
public int getNrOfDiscouragedSlots()
public double toDouble()
toDouble
in class Value
public int computeNrOfDiscouragedSlots()
public boolean hasIntersection(Location location)
public boolean isProhibited()
public String getName()
Value
getName
in class Value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |