Class ActivityPrecedence

java.lang.Object
jline.lang.layered.ActivityPrecedence

public class ActivityPrecedence extends Object
A class modeling precedence relationships among activities
  • Field Details

    • preActs

      protected List<String> preActs
    • postActs

      protected List<String> postActs
    • preType

      protected String preType
    • postType

      protected String postType
    • preParams

      protected Matrix preParams
    • postParams

      protected Matrix postParams
  • Constructor Details

    • ActivityPrecedence

      public ActivityPrecedence(List<String> preActs, List<String> postActs, String preType, String postType, Matrix preParams, Matrix postParams)
      Constructs an ActivityPrecedence with the specified parameters.
      Parameters:
      preActs - the list of preceding activity names
      postActs - the list of following activity names
      preType - the type of the precedence relationship before the activity
      postType - the type of the precedence relationship after the activity
      preParams - the parameters for the preceding activities
      postParams - the parameters for the following activities
    • ActivityPrecedence

      public ActivityPrecedence(List<String> preActs, List<String> postActs, String preType, String postType, Matrix preParams)
      Constructs an ActivityPrecedence with the specified parameters, without postParams.
      Parameters:
      preActs - the list of preceding activity names
      postActs - the list of following activity names
      preType - the type of the precedence relationship before the activity
      postType - the type of the precedence relationship after the activity
      preParams - the parameters for the preceding activities
    • ActivityPrecedence

      public ActivityPrecedence(List<String> preActs, List<String> postActs, String preType, String postType)
      Constructs an ActivityPrecedence with the specified parameters, without preParams and postParams.
      Parameters:
      preActs - the list of preceding activity names
      postActs - the list of following activity names
      preType - the type of the precedence relationship before the activity
      postType - the type of the precedence relationship after the activity
    • ActivityPrecedence

      public ActivityPrecedence(List<String> preActs, List<String> postActs, String preType)
      Constructs an ActivityPrecedence with the specified parameters, assuming POST_SEQ as postType.
      Parameters:
      preActs - the list of preceding activity names
      postActs - the list of following activity names
      preType - the type of the precedence relationship before the activity
    • ActivityPrecedence

      public ActivityPrecedence(List<String> preActs, List<String> postActs)
      Constructs an ActivityPrecedence with the specified parameters, assuming PRE_SEQ as preType and POST_SEQ as postType.
      Parameters:
      preActs - the list of preceding activity names
      postActs - the list of following activity names
  • Method Details

    • fromActivities

      public static ActivityPrecedence fromActivities(List<Activity> preActs, List<Activity> postActs, String preType, String postType, Matrix preParams, Matrix postParams)
      Creates an ActivityPrecedence with Activity objects.
      Parameters:
      preActs - the list of preceding activities
      postActs - the list of following activities
      preType - the type of the precedence relationship before the activity
      postType - the type of the precedence relationship after the activity
      preParams - the parameters for the preceding activities
      postParams - the parameters for the following activities
      Returns:
      an ActivityPrecedence object
    • fromActivities

      public static ActivityPrecedence fromActivities(List<Activity> preActs, List<Activity> postActs, String preType, String postType, Matrix preParams)
      Creates an ActivityPrecedence with Activity objects, without postParams.
      Parameters:
      preActs - the list of preceding activities
      postActs - the list of following activities
      preType - the type of the precedence relationship before the activity
      postType - the type of the precedence relationship after the activity
      preParams - the parameters for the preceding activities
      Returns:
      an ActivityPrecedence object
    • fromActivities

      public static ActivityPrecedence fromActivities(List<Activity> preActs, List<Activity> postActs, String preType, String postType)
      Creates an ActivityPrecedence with Activity objects, without preParams and postParams.
      Parameters:
      preActs - the list of preceding activities
      postActs - the list of following activities
      preType - the type of the precedence relationship before the activity
      postType - the type of the precedence relationship after the activity
      Returns:
      an ActivityPrecedence object
    • fromActivities

      public static ActivityPrecedence fromActivities(List<Activity> preActs, List<Activity> postActs, String preType)
      Creates an ActivityPrecedence with Activity objects, assuming POST_SEQ as postType.
      Parameters:
      preActs - the list of preceding activities
      postActs - the list of following activities
      preType - the type of the precedence relationship before the activity
      Returns:
      an ActivityPrecedence object
    • fromActivities

      public static ActivityPrecedence fromActivities(List<Activity> preActs, List<Activity> postActs)
      Creates an ActivityPrecedence with Activity objects, assuming PRE_SEQ as preType and POST_SEQ as postType.
      Parameters:
      preActs - the list of preceding activities
      postActs - the list of following activities
      Returns:
      an ActivityPrecedence object
    • AndFork

      public static ActivityPrecedence AndFork(Activity preAct, List<Activity> postActs)
      Creates an ActivityPrecedence object representing an AND-fork relationship.
      Parameters:
      preAct - the preceding activity
      postActs - the list of following activities
      Returns:
      an ActivityPrecedence object
    • AndFork

      public static ActivityPrecedence AndFork(String preAct, List<String> postActs)
      Creates an ActivityPrecedence object representing an AND-fork relationship.
      Parameters:
      preAct - the preceding activity
      postActs - the list of following activities
      Returns:
      an ActivityPrecedence object
    • AndFork

      public static ActivityPrecedence AndFork(String preAct, List<String> postActs, Matrix fanout)
      Creates an ActivityPrecedence object representing an AND-fork relationship with a specified fanout matrix.
      Parameters:
      preAct - the preceding activity
      postActs - the list of following activities
      fanout - the fanout matrix
      Returns:
      an ActivityPrecedence object
    • AndFork

      public static ActivityPrecedence AndFork(Activity preAct, List<Activity> postActs, Matrix fanout)
      Creates an ActivityPrecedence object representing an AND-fork relationship with a specified fanout matrix.
      Parameters:
      preAct - the preceding activity
      postActs - the list of following activities
      fanout - the fanout matrix
      Returns:
      an ActivityPrecedence object
    • AndJoin

      public static ActivityPrecedence AndJoin(List<String> preActs, String postAct)
      Creates an ActivityPrecedence object representing an AND-join relationship.
      Parameters:
      preActs - the list of preceding activities
      postAct - the following activity
      Returns:
      an ActivityPrecedence object
    • AndJoin

      public static ActivityPrecedence AndJoin(List<Activity> preActs, Activity postAct)
      Creates an ActivityPrecedence object representing an AND-join relationship.
      Parameters:
      preActs - the list of preceding activities
      postAct - the following activity
      Returns:
      an ActivityPrecedence object
    • AndJoin

      public static ActivityPrecedence AndJoin(List<Activity> preActs, Activity postAct, Matrix quorum)
      Creates an ActivityPrecedence object representing an AND-join relationship with a specified quorum matrix.
      Parameters:
      preActs - the list of preceding activities
      postAct - the following activity
      quorum - the quorum matrix
      Returns:
      an ActivityPrecedence object
    • AndJoin

      public static ActivityPrecedence AndJoin(List<String> preActs, String postAct, Matrix quorum)
      Creates an ActivityPrecedence object representing an AND-join relationship with a specified quorum matrix.
      Parameters:
      preActs - the list of preceding activities
      postAct - the following activity
      quorum - the quorum matrix
      Returns:
      an ActivityPrecedence object
    • CacheAccess

      public static ActivityPrecedence CacheAccess(Activity preAct, List<Activity> postActs)
      Creates an ActivityPrecedence object representing a cache access relationship.
      Parameters:
      preAct - the preceding activity
      postActs - the list of following activities
      Returns:
      an ActivityPrecedence object
    • CacheAccess

      public static ActivityPrecedence CacheAccess(String preAct, List<String> postActs)
      Creates an ActivityPrecedence object representing a cache access relationship.
      Parameters:
      preAct - the preceding activity
      postActs - the list of following activities
      Returns:
      an ActivityPrecedence object
    • Loop

      public static ActivityPrecedence Loop(Activity preAct, Activity loopAct, Activity endAct, double nloops)
      Creates an ActivityPrecedence object representing a loop relationship.
      Parameters:
      preAct - the preceding activity
      loopAct - the activity that is looped
      endAct - the activity after the loop completes
      nloops - the number of loops
      Returns:
      an ActivityPrecedence object
    • Loop

      public static ActivityPrecedence Loop(String preAct, String loopAct, String endAct, double nloops)
      Creates an ActivityPrecedence object representing a loop relationship.
      Parameters:
      preAct - the preceding activity
      loopAct - the activity that is looped
      endAct - the activity after the loop completes
      nloops - the number of loops
      Returns:
      an ActivityPrecedence object
    • Loop

      public static ActivityPrecedence Loop(Activity preAct, List<Activity> postActs, double nloops)
      Creates an ActivityPrecedence object representing a loop relationship.
      Parameters:
      preAct - the preceding activity
      postActs - a list with loopAct and endAct (see 4-parameter Loop constructor)
      nloops - the number of loops
      Returns:
      an ActivityPrecedence object
    • Loop

      public static ActivityPrecedence Loop(String preAct, List<String> postActs, double nloops)
      Creates an ActivityPrecedence object representing a loop relationship.
      Parameters:
      preAct - the preceding activity
      postActs - a list with loopAct and endAct (see 4-parameter Loop constructor)
      nloops - the number of loops
      Returns:
      an ActivityPrecedence object
    • Loop

      public static ActivityPrecedence Loop(String preAct, List<String> postActs, String endAct, Matrix nloops)
    • Loop

      public static ActivityPrecedence Loop(Activity preAct, List<Activity> postActs, Activity endAct, Matrix nloops)
    • Loop

      public static ActivityPrecedence Loop(Activity preAct, List<Activity> postActs, Matrix nloops)
      Creates an ActivityPrecedence object representing a loop relationship.
      Parameters:
      preAct - the preceding activity
      postActs - a list with loopAct and endAct (see 4-parameter Loop constructor)
      nloops - the number of loops
      Returns:
      an ActivityPrecedence object
    • Loop

      public static ActivityPrecedence Loop(String preAct, List<String> postActs, Matrix nloops)
      Creates an ActivityPrecedence object representing a loop relationship.
      Parameters:
      preAct - the preceding activity
      postActs - a list with loopAct and endAct (see 4-parameter Loop constructor)
      nloops - the number of loops
      Returns:
      an ActivityPrecedence object
    • Loop

      public static ActivityPrecedence Loop(Activity preAct, Activity loopAct, Activity endAct, Matrix nloops)
      Creates an ActivityPrecedence object representing a loop relationship.
      Parameters:
      preAct - the preceding activity
      loopAct - the activity that is looped
      endAct - the activity after the loop completes
      nloops - the number of loops
      Returns:
      an ActivityPrecedence object
    • Loop

      public static ActivityPrecedence Loop(String preAct, String loopAct, String endAct, Matrix nloops)
      Creates an ActivityPrecedence object representing a loop relationship.
      Parameters:
      preAct - the preceding activity
      loopAct - the activity that is looped
      endAct - the activity after the loop completes
      nloops - the number of loops
      Returns:
      an ActivityPrecedence object
    • OrFork

      public static ActivityPrecedence OrFork(Activity preAct, List<Activity> postActs, Matrix probs)
      Creates an ActivityPrecedence object representing an OR-fork relationship with a specified probability matrix.
      Parameters:
      preAct - the preceding activity
      postActs - the list of following activities
      probs - the probability matrix
      Returns:
      an ActivityPrecedence object
    • OrFork

      public static ActivityPrecedence OrFork(String preAct, List<String> postActs, Matrix probs)
      Creates an ActivityPrecedence object representing an OR-fork relationship with a specified probability matrix.
      Parameters:
      preAct - the preceding activity
      postActs - the list of following activities
      probs - the probability matrix
      Returns:
      an ActivityPrecedence object
    • OrJoin

      public static ActivityPrecedence OrJoin(List<String> preActs, String postAct)
      Creates an ActivityPrecedence object representing an OR-join relationship.
      Parameters:
      preActs - the list of preceding activities
      postAct - the following activity
      Returns:
      an ActivityPrecedence object
    • OrJoin

      public static ActivityPrecedence OrJoin(List<Activity> preActs, Activity postAct)
      Creates an ActivityPrecedence object representing an OR-join relationship.
      Parameters:
      preActs - the list of preceding activities
      postAct - the following activity
      Returns:
      an ActivityPrecedence object
    • Serial

      public static ActivityPrecedence[] Serial(List<?> varargin)
      Creates an array of ActivityPrecedence objects representing a sequence.
      Parameters:
      varargin - the list of activity names
      Returns:
      an array of ActivityPrecedence objects
    • Serial

      public static ActivityPrecedence Serial(String preAct, String postAct)
      Creates an ActivityPrecedence object representing a sequence relationship.
      Parameters:
      preAct - the preceding activity
      postAct - the following activity
      Returns:
      an ActivityPrecedence object
    • Serial

      public static ActivityPrecedence Serial(Activity preAct, Activity postAct)
      Creates an ActivityPrecedence object representing a sequence relationship.
      Parameters:
      preAct - the preceding activity
      postAct - the following activity
      Returns:
      an ActivityPrecedence object
    • Serial

      public static ActivityPrecedence[] Serial(Activity... activities)
      Creates an array of ActivityPrecedence objects representing a sequence from varargs.
      Parameters:
      activities - the activities to form a serial sequence
      Returns:
      an array of ActivityPrecedence objects
    • Serial

      public static ActivityPrecedence[] Serial(String... activities)
      Creates an array of ActivityPrecedence objects representing a sequence from varargs.
      Parameters:
      activities - the activity names to form a serial sequence
      Returns:
      an array of ActivityPrecedence objects
    • Xor

      public static ActivityPrecedence Xor(Activity preAct, List<Activity> postActs, Matrix probs)
      Creates an ActivityPrecedence object representing an XOR relationship.
      Parameters:
      preAct - the preceding activity
      postActs - the list of following activities
      probs - the probability matrix
      Returns:
      an ActivityPrecedence object
    • Xor

      public static ActivityPrecedence Xor(String preAct, List<String> postActs, Matrix probs)
      Creates an ActivityPrecedence object representing an XOR relationship.
      Parameters:
      preAct - the preceding activity
      postActs - the list of following activities
      probs - the probability matrix
      Returns:
      an ActivityPrecedence object
    • getPreActs

      public List<String> getPreActs()
      Returns the list of preceding activity names.
      Returns:
      the list of preceding activity names
    • getPostActs

      public List<String> getPostActs()
      Returns the list of following activity names.
      Returns:
      the list of following activity names
    • getPreType

      public String getPreType()
      Returns the type of the precedence relationship before the activity.
      Returns:
      the pre-type string
    • getPostType

      public String getPostType()
      Returns the type of the precedence relationship after the activity.
      Returns:
      the post-type string
    • getPreParams

      public Matrix getPreParams()
      Returns the parameters for the preceding activities.
      Returns:
      the pre-parameters matrix
    • getPostParams

      public Matrix getPostParams()
      Returns the parameters for the following activities.
      Returns:
      the post-parameters matrix
    • getPrecedenceId

      public static int getPrecedenceId(String precedence)
      Retrieves the precedence ID based on the precedence type string.
      Parameters:
      precedence - the precedence type string
      Returns:
      the precedence ID