Package gov.nasa.jpl.activity
Class ActivityInstanceList
java.lang.Object
gov.nasa.jpl.activity.ActivityInstanceList
A list of Activity objects. The main engine holds a semi-singleton instance, but other instances can be used for IO.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clear()
boolean
containsID
(UUID activityID) Returns true if the ID can be found in the activity instance list, false if not.findActivityByID
(UUID activityID) Returns an activity instance from the ActivityInstanceList given an input activity id.get
(int i) getActivitiesOfTypeBetween
(Time start, Time end, boolean mustContainAll, Class... activityTypes) getActivityInstancesWithSubsystem
(String subsystem, Time start, Time end, boolean mustContainAll) static ActivityInstanceList
getAllActivitiesOfType
(Class... activityTypes) int
length()
void
void
For now we only need to sort the activities before sequencing.void
Takes in an activity instance and removes it from the ActivityInstanceList.void
Takes in an activity id and removes it from the ActivityInstanceList.void
-
Constructor Details
-
ActivityInstanceList
public ActivityInstanceList()
-
-
Method Details
-
getActivityList
-
prepareActivitiesForModeling
public void prepareActivitiesForModeling() -
prepareActivitiesForSequencing
public void prepareActivitiesForSequencing()For now we only need to sort the activities before sequencing. -
stopAllSchedulers
public void stopAllSchedulers() -
add
-
remove
Takes in an activity instance and removes it from the ActivityInstanceList.- Parameters:
act
-
-
remove
Takes in an activity id and removes it from the ActivityInstanceList.- Parameters:
id
-
-
length
public int length() -
clear
public void clear() -
get
-
getAllActivitiesOfType
- Parameters:
activityTypes
- that you want to get all instances of- Returns:
- List of activity instances of given types
-
getInstanceCountForEachType
- Returns:
- List of entries that map activity type name to a count of instances of that type in the whole plan as loaded in memory. Generally to be used for diagnostic purposes when profiling adaptation speed, especially I/O
-
getActivitiesOfTypeBetween
public List<Activity> getActivitiesOfTypeBetween(Time start, Time end, boolean mustContainAll, Class... activityTypes) - Parameters:
start
- activities with a start Time equal to this or later (and <= end) will be returnedend
- activities with a start (or end, see 'mustContainAll') Time equal to or earlier than this (and >= start) will be returnedmustContainAll
- true if an activity must end before 'end', false if it only must start before 'end' to be returnedactivityTypes
- the types you want to get instances of- Returns:
-
getActivityInstancesWithSubsystem
public List<Activity> getActivityInstancesWithSubsystem(String subsystem, Time start, Time end, boolean mustContainAll) - Parameters:
subsystem
- activity instances with this subsystem will be returnedstart
- activities with a start Time equal to this or later (and <= end) will be returnedend
- activities with a start (or end, see 'mustContainAll') Time equal to or earlier than this (and >= start) will be returnedmustContainAll
- true if an activity must end before 'end', false if it only must start before 'end' to be returned- Returns:
-
findActivityByID
Returns an activity instance from the ActivityInstanceList given an input activity id.- Parameters:
activityID
-- Returns:
-
containsID
Returns true if the ID can be found in the activity instance list, false if not.- Parameters:
activityID
-- Returns:
-
getFirstActivityStartTime
-
getLastActivityEndTime
-
createListOfActivityBeginAndEndTimes
-
createListOfActivityBeginTimes
-