|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.liu.ida.critiquer.activities.Activity
public abstract class Activity
Base class for all types of activities in a plan.
Nested Class Summary | |
---|---|
static interface |
Activity.Properties
Interface for recognizing state properties of activities during simulation. |
Field Summary | |
---|---|
String |
type
|
Constructor Summary | |
---|---|
Activity()
Creates a dummy placeholder activity, not to be used in tasks |
|
Activity(Activity parent)
|
|
Activity(String type,
Activity parent)
|
Method Summary | ||
---|---|---|
void |
acquirePendingUpdatesLock()
|
|
static void |
addActivityUpdateListener(ActivityUpdateListener ul)
|
|
void |
addAll(ArrayList<Activity> c)
|
|
void |
addChild(Activity child)
|
|
void |
addDefaultParams()
Add name, description, start and end time for all activities |
|
static void |
addNameChangeListener(NameChangeListener listener)
|
|
|
addParam(ActivityParameter<T> p)
|
|
void |
addPrivateUpdateListener(ActivityUpdateListener l)
Adds an activity update listener |
|
static void |
addStaticConsistencyChecker(ActivityConsistencyCheck checker)
|
|
boolean |
canBeChildOf(Activity parent)
Can this activity be a child of parent? |
|
abstract boolean |
canBeSimulated()
Test if this activity can be simulated. |
|
boolean |
canComeBefore(Activity activity)
Can this activity come before activity in a mission? |
|
void |
debug(Object arg0)
|
|
void |
endParentRelationship()
Decouple this agent from its parent |
|
boolean |
equals(Object o)
|
|
void |
error(Object arg0)
|
|
void |
fatal(Object arg0)
|
|
Semaphore |
getAtomicUpdateLock()
|
|
ArrayList<Activity> |
getChildren()
|
|
Date |
getEndTime()
|
|
long |
getMaxTime()
|
|
(package private) ArrayList<ActivityUpdateListener> |
getMyUpdateListeners()
|
|
abstract 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. |
|
ArrayList<ActivityParameter> |
getParams()
|
|
Activity |
getParent()
|
|
int |
getPendingupdates()
|
|
Activity |
getRootActivity()
|
|
Date |
getStartTime()
|
|
static ArrayList<ActivityConsistencyCheck> |
getStaticConsistencyCheckers()
|
|
static ArrayList<ActivityUpdateListener> |
getStaticUpdateListeners()
|
|
HashSet<TimeParameterOrdering> |
getTemporalConstraints()
|
|
boolean |
hasParent()
|
|
int |
indexOfChild(Activity activity)
|
|
void |
info(Object arg0)
|
|
void |
initParentRelationship(Activity parent)
Called when an activity is added to an overarching activity. |
|
boolean |
isAgentAssignable()
This method indicates whether or not an activity can be assigned an agent or if it should inherit agents from parent activities. |
|
static
|
isConsistent(Activity a,
Parameter<T> p,
T newValue)
|
|
void |
order(Activity laterActivity)
Introduce an ordering between two activities by ordering the end time parameter of the current activity before the start time parameter of a2. |
|
void |
postLoad()
This function is called when an activity is deserialized. |
|
void |
preSave()
|
|
void |
releasePendingUpdatesLock()
|
|
void |
removeChild(Activity currentActivity)
|
|
void |
removeChildren()
|
|
void |
removeOrder(Activity laterActivity)
Remove the temporal ordering between the current activity and a2 TODO: This could be an instance method so that additional ordering information could be added by subclasses, if location parameters need to be syncronized for instance |
|
void |
removePrivateUpdateListener(ActivityUpdateListener l)
|
|
void |
setParent(Activity parent)
|
|
void |
signalActivityRemoved()
Notify activity listeners that this activity has been removed from the plan |
|
void |
signalActivityUpdated()
When the activity is updated in some way, but not through parameter values, this method is called |
|
void |
signalParamChanged()
create a new activity parameter nobody should be interested in per se and fire a paramChanged event with that parameter |
|
|
signalParamChanged(Parameter<T> p)
|
|
abstract long |
simulate()
Calculates the effects of performing a mission with respect to some state. |
|
String |
toString()
|
|
void |
warn(Object arg0)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public String type
Constructor Detail |
---|
public Activity()
public Activity(Activity parent)
public Activity(String type, Activity parent)
Method Detail |
---|
public int getPendingupdates()
public void acquirePendingUpdatesLock()
public void releasePendingUpdatesLock()
public abstract int getNumActivities()
public Activity getRootActivity()
public void initParentRelationship(Activity parent)
parent
- public boolean isAgentAssignable()
public void endParentRelationship()
public static void addActivityUpdateListener(ActivityUpdateListener ul)
public ArrayList<ActivityParameter> getParams()
public <T> void addParam(ActivityParameter<T> p)
public static <T> boolean isConsistent(Activity a, Parameter<T> p, T newValue)
public void signalParamChanged()
public void signalActivityUpdated()
public void signalActivityRemoved()
public <T> void signalParamChanged(Parameter<T> p)
public void addPrivateUpdateListener(ActivityUpdateListener l)
l
- public void removePrivateUpdateListener(ActivityUpdateListener l)
public String toString()
toString
in class Object
public boolean hasParent()
public Activity getParent()
public void setParent(Activity parent)
parent
- The parent to set.public void addDefaultParams()
public void addChild(Activity child)
public void removeChild(Activity currentActivity)
public ArrayList<Activity> getChildren()
public void addAll(ArrayList<Activity> c)
public void removeChildren()
public Date getStartTime()
public Date getEndTime()
public static void addNameChangeListener(NameChangeListener listener)
public boolean equals(Object o)
equals
in class Object
public static ArrayList<ActivityUpdateListener> getStaticUpdateListeners()
ArrayList<ActivityUpdateListener> getMyUpdateListeners()
public int indexOfChild(Activity activity)
public abstract long simulate() throws IncompleteActivityException
-
IncompleteActivityException
public abstract boolean canBeSimulated()
public long getMaxTime()
public void postLoad()
This function is called when an activity is deserialized.
public HashSet<TimeParameterOrdering> getTemporalConstraints()
public void preSave()
public void removeOrder(Activity laterActivity)
Remove the temporal ordering between the current activity and a2
TODO: This could be an instance method so that additional ordering information could be added by subclasses, if location parameters need to be syncronized for instance
laterActivity
- the activity that was ordered after this
for more information.
public void order(Activity laterActivity)
Introduce an ordering between two activities by ordering the end time parameter of the current activity before the start time parameter of a2.
TODO: Possibly add other constraints that relate to ordering two consecutive actions
laterActivity
- The activity that should come after this
public boolean canBeChildOf(Activity parent)
public boolean canComeBefore(Activity activity)
public static ArrayList<ActivityConsistencyCheck> getStaticConsistencyCheckers()
public static void addStaticConsistencyChecker(ActivityConsistencyCheck checker)
checker
- The ActivityConsistencyChecker to add.public Semaphore getAtomicUpdateLock()
public void debug(Object arg0)
Category.debug(java.lang.Object)
public void error(Object arg0)
Category.error(java.lang.Object)
public void fatal(Object arg0)
Category.fatal(java.lang.Object)
public void info(Object arg0)
Category.info(java.lang.Object)
public void warn(Object arg0)
Category.warn(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |