Class TotalOrderUtils


  • public class TotalOrderUtils
    extends java.lang.Object
    Idea: state denotes the next activity to be executed.
    Author:
    sander
    • Constructor Summary

      Constructors 
      Constructor Description
      TotalOrderUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int[] addEvent​(int[] partialOrder, int transitionOrActivity)  
      static int[] emptyTotalOrder()  
      static int eventsLeft​(int[] totalOrder, int state)  
      static int getActivity​(int[] totalOrder, int eventIndex)  
      static int getNext​(int[] totalOrder, int state)  
      static int getNumberOfEvents​(int[] totalOrder)  
      static java.lang.String[] getStringTrace​(StochasticLanguage<TotalOrder> language, int traceIndex)  
      static boolean hasBeenExecuted​(int[] totalOrder, int state, int eventIndex)  
      static int reset​(int state)  
      static int takeStep​(int[] totalOrder, int state)
      Marks the given event as executed (in place)
      static java.lang.String toGraphVizString​(int[] totalOrder)
      Helper method that creates a GraphViz .dot string for the visualization of the total order
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TotalOrderUtils

        public TotalOrderUtils()
    • Method Detail

      • emptyTotalOrder

        public static int[] emptyTotalOrder()
      • addEvent

        public static int[] addEvent​(int[] partialOrder,
                                     int transitionOrActivity)
        Parameters:
        prefix -
        transitionOrActivity -
        Returns:
        a copy of the partial order with one event added with index length; concurrent with all other events.
      • getNumberOfEvents

        public static int getNumberOfEvents​(int[] totalOrder)
      • takeStep

        public static int takeStep​(int[] totalOrder,
                                   int state)
        Marks the given event as executed (in place)
        Parameters:
        totalOrder -
        eventIndex -
      • reset

        public static int reset​(int state)
      • eventsLeft

        public static int eventsLeft​(int[] totalOrder,
                                     int state)
      • getNext

        public static int getNext​(int[] totalOrder,
                                  int state)
      • getActivity

        public static int getActivity​(int[] totalOrder,
                                      int eventIndex)
      • hasBeenExecuted

        public static boolean hasBeenExecuted​(int[] totalOrder,
                                              int state,
                                              int eventIndex)
      • getStringTrace

        public static java.lang.String[] getStringTrace​(StochasticLanguage<TotalOrder> language,
                                                        int traceIndex)
        Parameters:
        traceIndex -
        Returns:
        a string array of the activities in the trace
      • toGraphVizString

        public static java.lang.String toGraphVizString​(int[] totalOrder)
        Helper method that creates a GraphViz .dot string for the visualization of the total order
        Parameters:
        totalOrder - Total order to be visualized