public abstract class AbstractAllocator extends AbstractSelector
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractAllocator.EventPair |
_canonicalName, _description, _displayName, _name, _params
Constructor and Description |
---|
AbstractAllocator()
Constructors
|
AbstractAllocator(java.lang.String name) |
AbstractAllocator(java.lang.String name,
java.util.HashMap<java.lang.String,java.lang.String> params) |
AbstractAllocator(java.lang.String name,
java.lang.String description) |
AbstractAllocator(java.lang.String name,
java.lang.String desc,
java.util.HashMap<java.lang.String,java.lang.String> params) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Long> |
getAvgDurations(java.util.Collection<AbstractAllocator.EventPair> pairs) |
protected java.util.Map<java.lang.String,java.lang.Long> |
getAvgDurations(EventLogger.event fromEvent,
EventLogger.event toEvent,
WorkItemRecord wir)
Gets the average duration (in msecs) between two events for each participant
recorded against those events for a task
|
protected double |
getCost(XNode resNode,
java.lang.String duration) |
protected java.util.Map<java.lang.String,XNode> |
getCostMap(java.util.Set<java.lang.String> pids,
WorkItemRecord wir)
Gets from the cost service the cost per msec of each of the participants ids
listed for the work item
|
protected java.util.List |
getLoggedEvents(WorkItemRecord wir,
EventLogger.event event)
Gets a list of all resource log rows for a given specification + task + event
combination.
|
protected java.util.Map<java.lang.String,Participant> |
participantSetToMap(java.util.Set<Participant> pSet)
Converts a set of participants to a map
|
abstract Participant |
performAllocation(java.util.Set<Participant> resources,
WorkItemRecord wir)
Performs an allocation using some strategy
|
java.lang.String |
toXML()
Generates the XML required for the specification file
|
addKey, addParam, addParams, compareTo, equals, evaluate, getCanonicalName, getClassName, getDescription, getDisplayName, getInformation, getKeys, getName, getParamKeys, getParams, getParamValue, hashCode, intersection, reconstitute, setCanonicalName, setDescription, setDisplayName, setKeyValue, setName, setParams, toString, union, unmarshalParams
public AbstractAllocator()
public AbstractAllocator(java.lang.String name)
public AbstractAllocator(java.lang.String name, java.util.HashMap<java.lang.String,java.lang.String> params)
public AbstractAllocator(java.lang.String name, java.lang.String description)
public AbstractAllocator(java.lang.String name, java.lang.String desc, java.util.HashMap<java.lang.String,java.lang.String> params)
public java.lang.String toXML()
toXML
in class AbstractSelector
protected java.util.List getLoggedEvents(WorkItemRecord wir, EventLogger.event event)
wir
- a workitem record which is an instance of the specification+task in
question.event
- the type of event to get records forprotected java.util.Map<java.lang.String,Participant> participantSetToMap(java.util.Set<Participant> pSet)
pSet
- the set of participantsprotected java.util.Map<java.lang.String,XNode> getCostMap(java.util.Set<java.lang.String> pids, WorkItemRecord wir)
pids
- a set of participant idswir
- the work item to allocateprotected double getCost(XNode resNode, java.lang.String duration)
protected java.util.Map<java.lang.String,java.lang.Long> getAvgDurations(EventLogger.event fromEvent, EventLogger.event toEvent, WorkItemRecord wir)
fromEvent
- the earlier event (start of duration)toEvent
- the later event (end of duration)wir
- a work item to allocateprotected java.util.Map<java.lang.String,java.lang.Long> getAvgDurations(java.util.Collection<AbstractAllocator.EventPair> pairs)
public abstract Participant performAllocation(java.util.Set<Participant> resources, WorkItemRecord wir)
resources
- the distribution set of participantswir
- the work item to allocateCopyright © 2004-2014 The YAWL Foundation.