|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jopt.csp.spi.arcalgorithm.domain.AbstractDomain jopt.js.spi.domain.resource.ResourceDomain jopt.js.spi.domain.resource.GranularResourceDomain
Extension of a standard resource domain. Behavior is similar to a standard resource, but capacity is split into uniformly sized buckets. The user simply needs to specify size of the bucket as well as an index to base the buckets off of. The provided functionality is important for situations in which the unit of time used for resource availability is not the same as that of the activities. For instance, supposed an activity requires X units of resource A every 15 minutes; thus, 1 unit of time = 15 minutes. However, resource A has Y units available each hour (60 minutes). Rather than estimating the availability of resource A to be Y/4 per unit of time, we can model resource A as a granular resource with a bucket size of 4.
Constructor Summary | |
GranularResourceDomain(ResourceDomain resDom,
int bucketSize,
int offset)
Constructs an instance of a granular Resource Domain |
Method Summary | |
void |
afterChoicePointPopEvent()
|
void |
afterChoicePointPushEvent()
|
void |
beforeChoicePointPopEvent()
|
void |
beforeChoicePointPushEvent()
|
boolean |
choicePointStackSet()
|
void |
clearDelta()
|
java.lang.Object |
clone()
|
jopt.csp.util.IntIntervalSet |
findAvailIntervals(int start,
int end,
int quantity)
Returns a set indicating the intervals that this resource is available in the given quantity within the specified range |
jopt.csp.util.IntIntervalSet |
findAvailIntervals(int operationID,
int start,
int end,
int quantity)
Returns a set indicating the intervals that this resource is available to the given operation in the given quantity within the specified range |
java.lang.Object |
getDomainState()
|
int |
getNumberOfOperationsAssigned()
Returns the number of operations currently assigned to the resource |
int |
getResourceEnd()
This obtains the last point for which this resource is, or ever was, available |
int |
getResourceStart()
Obtains the first point for which this resource is, or ever was, available |
int |
getTotalCapacityAvailable()
This method will return the total amount of resource available. |
int |
getType()
Returns an int representing the type of resource this is domain represents |
boolean |
isBuilt()
Determines if this domain is in "built" status |
boolean |
isResourceAvailable(int operationID,
int start,
int end,
int quantity)
Determines whether the resource is available in the specified quantity between specified start and end times for the given operation |
boolean |
isUsed()
Checks to see if any operation requires the use of this resource at any time. |
int |
maxAvailableResource(int start,
int end)
Gives the highest consistently available amount of this resource over the given range |
int |
maxAvailableResource(int operationID,
int start,
int end)
Gives the highest consistently available amount of this resource over the given range for the given operation |
int |
maxAvailableResource(int operationID,
int start,
int end,
int minDur)
Gives the highest consistently available amount of this resource over the given range for the given operation and assuming that the reource will be used for at least the specified duration |
boolean |
needsPropagation()
Returns whether or not this class has been altered, thus rendering its arcs in need of propagation |
void |
registerAllocatedOperation(int opID,
int est,
int let,
int minDur)
Lets the resource know that although a specific time has not necessary been decided, the specified operation will use this resource. |
void |
restoreDomainState(java.lang.Object state)
|
void |
setActualOperationTimeline(int operationID,
jopt.csp.util.IntIntervalSet timeline)
Registers the amount of time the specified operation will be using this resource |
void |
setBuilt(boolean built)
Sets the built status of this domain |
void |
setChoicePointStack(jopt.csp.spi.solver.ChoicePointStack cps)
|
void |
setNeedsPropagation(boolean needsPropagation)
Sets the nnedsPropagation flag to the given boolean |
void |
setPotentialOperationTimeline(int operationID,
jopt.csp.util.IntIntervalSet timeline)
Indicates the time during which the specified operation may be using this resource |
java.lang.String |
toString()
|
Methods inherited from class jopt.js.spi.domain.resource.ResourceDomain |
getBeginTime, getCompleteTime, getMakeSpan, getNumOps, isBound |
Methods inherited from class jopt.csp.spi.arcalgorithm.domain.AbstractDomain |
addDomainChangeListener, addRangeChangeListener, addValueChangeListener, changed, removeDomainChangeListener, removeRangeChangeListener, removeValueChangeListener |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GranularResourceDomain(ResourceDomain resDom, int bucketSize, int offset)
resDom
- resource domain to which make granularbucketSize
- number of units in one groupingoffset
- an index off of which to base the bucketsMethod Detail |
public boolean isUsed()
ResourceDomain
isUsed
in class ResourceDomain
public int getType()
ResourceDomain
getType
in class ResourceDomain
public jopt.csp.util.IntIntervalSet findAvailIntervals(int start, int end, int quantity)
ResourceDomain
findAvailIntervals
in class ResourceDomain
start
- start of interval inquired aboutend
- end of interval inquired aboutquantity
- amound of resource required
public void registerAllocatedOperation(int opID, int est, int let, int minDur) throws jopt.csp.variable.PropagationFailureException
ResourceDomain
registerAllocatedOperation
in class ResourceDomain
opID
- operation id of operation using resourceest
- earliest start timelet
- latest end timeminDur
- minimum duration
jopt.csp.variable.PropagationFailureException
public int getNumberOfOperationsAssigned()
ResourceDomain
getNumberOfOperationsAssigned
in class ResourceDomain
public int getResourceStart()
ResourceDomain
getResourceStart
in class ResourceDomain
public int getResourceEnd()
ResourceDomain
getResourceEnd
in class ResourceDomain
public int getTotalCapacityAvailable()
ResourceDomain
getTotalCapacityAvailable
in class ResourceDomain
public jopt.csp.util.IntIntervalSet findAvailIntervals(int operationID, int start, int end, int quantity)
ResourceDomain
findAvailIntervals
in class ResourceDomain
operationID
- operation for whome we are checking the availabilitystart
- start of interval inquired aboutend
- end of interval inquired aboutquantity
- amound of resource required
public boolean isResourceAvailable(int operationID, int start, int end, int quantity)
ResourceDomain
isResourceAvailable
in class ResourceDomain
operationID
- the operationID of the operation in questionstart
- start of interval being inquired aboutend
- end of interval being inquired aboutquantity
- quantity of resource needed
public int maxAvailableResource(int start, int end)
ResourceDomain
maxAvailableResource
in class ResourceDomain
start
- start of range being inquired aboutend
- end of range being inquired about
public int maxAvailableResource(int operationID, int start, int end)
ResourceDomain
maxAvailableResource
in class ResourceDomain
operationID
- the operationID of the operation in questionstart
- start of range being inquired aboutend
- end of range being inquired about
public int maxAvailableResource(int operationID, int start, int end, int minDur)
ResourceDomain
maxAvailableResource
in class ResourceDomain
operationID
- the operationID of the operation in questionstart
- start of range being inquired aboutend
- end of range being inquired aboutminDur
- the minimum duration
public void setPotentialOperationTimeline(int operationID, jopt.csp.util.IntIntervalSet timeline) throws jopt.csp.variable.PropagationFailureException
ResourceDomain
setPotentialOperationTimeline
in class ResourceDomain
operationID
- id of operationtimeline
- times potentially being used
jopt.csp.variable.PropagationFailureException
public void setActualOperationTimeline(int operationID, jopt.csp.util.IntIntervalSet timeline) throws jopt.csp.variable.PropagationFailureException
ResourceDomain
setActualOperationTimeline
in class ResourceDomain
operationID
- id of operationtimeline
- times being used
jopt.csp.variable.PropagationFailureException
public void clearDelta()
clearDelta
in interface jopt.csp.spi.arcalgorithm.domain.Domain
clearDelta
in class ResourceDomain
public void beforeChoicePointPopEvent()
public void afterChoicePointPopEvent()
public void beforeChoicePointPushEvent()
public void afterChoicePointPushEvent()
public java.lang.Object clone()
public java.lang.Object getDomainState()
getDomainState
in interface jopt.csp.spi.arcalgorithm.domain.Domain
getDomainState
in class ResourceDomain
public void restoreDomainState(java.lang.Object state)
restoreDomainState
in interface jopt.csp.spi.arcalgorithm.domain.Domain
restoreDomainState
in class ResourceDomain
public boolean choicePointStackSet()
public void setChoicePointStack(jopt.csp.spi.solver.ChoicePointStack cps)
setChoicePointStack
in interface jopt.csp.spi.solver.ChoicePointDataSource
setChoicePointStack
in class ResourceDomain
public java.lang.String toString()
toString
in class ResourceDomain
public boolean isBuilt()
ResourceDomain
isBuilt
in class ResourceDomain
public void setBuilt(boolean built)
ResourceDomain
setBuilt
in class ResourceDomain
built
- boolean indication whether or not the problem has been builtpublic boolean needsPropagation()
ResourceDomain
needsPropagation
in class ResourceDomain
public void setNeedsPropagation(boolean needsPropagation)
ResourceDomain
setNeedsPropagation
in class ResourceDomain
needsPropagation
- boolean to set the needs Propagation flag
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |