Class ActivityInstanceList

java.lang.Object
gov.nasa.jpl.activity.ActivityInstanceList

public class ActivityInstanceList extends Object
A list of Activity objects. The main engine holds a semi-singleton instance, but other instances can be used for IO.
  • Constructor Details

    • ActivityInstanceList

      public ActivityInstanceList()
  • Method Details

    • getActivityList

      public static ActivityInstanceList 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

      public void add(Activity act)
    • remove

      public void remove(Activity act)
      Takes in an activity instance and removes it from the ActivityInstanceList.
      Parameters:
      act -
    • remove

      public void remove(UUID id)
      Takes in an activity id and removes it from the ActivityInstanceList.
      Parameters:
      id -
    • length

      public int length()
    • clear

      public void clear()
    • get

      public Activity get(int i)
    • getAllActivitiesOfType

      public List<Activity> getAllActivitiesOfType(Class... activityTypes)
      Parameters:
      activityTypes - that you want to get all instances of
      Returns:
      List of activity instances of given types
    • getInstanceCountForEachType

      public List<Map.Entry<String,Integer>> 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 returned
      end - activities with a start (or end, see 'mustContainAll') Time equal to or earlier than this (and >= start) will be returned
      mustContainAll - true if an activity must end before 'end', false if it only must start before 'end' to be returned
      activityTypes - 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 returned
      start - activities with a start Time equal to this or later (and <= end) will be returned
      end - activities with a start (or end, see 'mustContainAll') Time equal to or earlier than this (and >= start) will be returned
      mustContainAll - true if an activity must end before 'end', false if it only must start before 'end' to be returned
      Returns:
    • findActivityByID

      public Activity findActivityByID(UUID activityID)
      Returns an activity instance from the ActivityInstanceList given an input activity id.
      Parameters:
      activityID -
      Returns:
    • containsID

      public boolean containsID(UUID activityID)
      Returns true if the ID can be found in the activity instance list, false if not.
      Parameters:
      activityID -
      Returns:
    • getFirstActivityStartTime

      public Time getFirstActivityStartTime()
    • getLastActivityEndTime

      public Time getLastActivityEndTime()
    • createListOfActivityBeginAndEndTimes

      public List<Map.Entry<Time,Map.Entry<Boolean,Activity>>> createListOfActivityBeginAndEndTimes()
    • createListOfActivityBeginTimes

      public List<Map.Entry<Time,Map.Entry<Boolean,Activity>>> createListOfActivityBeginTimes()