public class Location extends Value<Activity,Location>
Constructor and Description |
---|
Location(Activity activity,
int day,
int hour,
Resource[] resources)
Constructor. slot = nrHours * day + hour
|
Location(Activity activity,
int slot,
Resource[] resources)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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()
Placement value (for optimization) -- getNrOfDiscouragedSlots() is returned
|
compareTo, compareTo, conflicts, conflicts, equals, getDescription, getExtra, getId, hashCode, isConsistent, setExtra, setVariable, toDouble, toString, valueEquals, valueEquals, variable
public Location(Activity activity, int slot, Resource[] resources)
activity
- parent activityslot
- starting timeresources
- selection of resourcespublic int getSlot()
public Resource[] getResources()
public Resource getResource(int idx)
idx
- indexpublic boolean containResource(Resource resource)
resource
- given resourcepublic int getNrOfDiscouragedSlots()
public double toDouble()
public int computeNrOfDiscouragedSlots()
public boolean hasIntersection(Location location)
location
- another locationpublic boolean isProhibited()