se.liu.ida.critiquer.scenarios.standard
Class DispatchActivity

java.lang.Object
  extended by se.liu.ida.critiquer.activities.Activity
      extended by se.liu.ida.critiquer.scenarios.standard.DispatchActivity
All Implemented Interfaces:
Serializable, TransportationActivity

public class DispatchActivity
extends Activity
implements TransportationActivity

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class se.liu.ida.critiquer.activities.Activity
Activity.Properties
 
Field Summary
 
Fields inherited from class se.liu.ida.critiquer.activities.Activity
type
 
Constructor Summary
DispatchActivity(Activity parent)
           
 
Method Summary
 void addDefaultParams()
          Add name, description, start and end time for all activities
 boolean canBeSimulated()
          Check that locations and agents are defined
 Location getEndLocation()
          Return the value of the destination location parameter
 int getNumActivities()
          Each subclass of Activity should have a static counter of how many activities have been created, so that we may create unique new names for newly created activities.
 Location getStartLocation()
          Return value of the starting location parameter
 void order(Activity laterActivity)
          Add location parameter dependency
 void removeOrder(Activity laterActivity)
          When removing ordering constraints, create a new stationary location for the activity that is decuopled from this one.
 long simulate()
          Return the maximum time taken by any agent to complete this activity
 
Methods inherited from class se.liu.ida.critiquer.activities.Activity
acquirePendingUpdatesLock, addActivityUpdateListener, addAll, addChild, addNameChangeListener, addParam, addPrivateUpdateListener, addStaticConsistencyChecker, canBeChildOf, canComeBefore, debug, endParentRelationship, equals, error, fatal, getAtomicUpdateLock, getChildren, getEndTime, getMaxTime, getParams, getParent, getPendingupdates, getRootActivity, getStartTime, getStaticConsistencyCheckers, getStaticUpdateListeners, getTemporalConstraints, hasParent, indexOfChild, info, initParentRelationship, isAgentAssignable, isConsistent, postLoad, preSave, releasePendingUpdatesLock, removeChild, removeChildren, removePrivateUpdateListener, setParent, signalActivityRemoved, signalActivityUpdated, signalParamChanged, signalParamChanged, toString, warn
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DispatchActivity

public DispatchActivity(Activity parent)
Parameters:
parent -
Method Detail

addDefaultParams

public void addDefaultParams()
Description copied from class: Activity
Add name, description, start and end time for all activities

Overrides:
addDefaultParams in class Activity

simulate

public long simulate()
Return the maximum time taken by any agent to complete this activity

Specified by:
simulate in class Activity
See Also:
se.liu.ida.critiquer.activities.Activity#calculateTimeToComplete(java.util.HashSet)

order

public void order(Activity laterActivity)
Add location parameter dependency

Overrides:
order in class Activity
Parameters:
laterActivity - The activity that should come after this
See Also:
Activity.order(se.liu.ida.critiquer.activities.Activity)

removeOrder

public void removeOrder(Activity laterActivity)
When removing ordering constraints, create a new stationary location for the activity that is decuopled from this one.

Overrides:
removeOrder in class Activity
Parameters:
laterActivity - the activity that was ordered after this
See Also:
Activity.removeOrder(se.liu.ida.critiquer.activities.Activity)

getNumActivities

public int getNumActivities()
Description copied from class: Activity
Each subclass of Activity should have a static counter of how many activities have been created, so that we may create unique new names for newly created activities.

Specified by:
getNumActivities in class Activity
Returns:
the number of objects of this class that have been created.

getStartLocation

public Location getStartLocation()
Return value of the starting location parameter

Specified by:
getStartLocation in interface TransportationActivity
See Also:
TransportationActivity.getStartLocation()

getEndLocation

public Location getEndLocation()
Return the value of the destination location parameter

Specified by:
getEndLocation in interface TransportationActivity
See Also:
TransportationActivity.getEndLocation()

canBeSimulated

public boolean canBeSimulated()
Check that locations and agents are defined

Specified by:
canBeSimulated in class Activity
Returns:
See Also:
Activity.canBeSimulated()