Class TimeTable


  • public class TimeTable
    extends Schedular
    A timetable is a list of events, with imposed dependencies. Timetables can be connected to a physical model of moving objects In MOCHY V 1.0, this physical model is a Stochastic Petri net Each event is the timetable description of a physiscal event occurring in the physical model This has two consequences during a joint simulation occurrences of physical events which are listed in the timetable fix the date during TT simulation when the current date has passed the date of a realizable event in the table it "allows" the corresponding event in the physical model

    TimeTable class diagram

    • Constructor Detail

      • TimeTable

        public TimeTable​(String filename)
        Creates a timetable from a file
        Parameters:
        filename -
    • Method Detail

      • handleLine

        protected String handleLine​(String ln,
                                    int lineNb)
        Handles a line of a timetable read from a file Lines are either of the form event:::
        Specified by:
        handleLine in class Schedular
        Parameters:
        ln -
      • getEvent

        public TableEvent getEvent​(Integer evtid)
        Description copied from class: Schedular
        retrieve an evenet by its id
        Specified by:
        getEvent in class Schedular
        Parameters:
        evtid - the number of event to search
        Returns:
        the found event
      • nextEvents

        public ArrayList<Integer> nextEvents​(Integer evtid)
        Parameters:
        evtid - an event id
        Returns:
        the list of successors of that event
      • PredecessorEvents

        public ArrayList<Integer> PredecessorEvents​(Integer evtid)
        Parameters:
        evtid - an event id
        Returns:
        the list of predecessors of that event
      • DependenciesFromEvent

        public ArrayList<TableDependency> DependenciesFromEvent​(Integer evtid)
        Parameters:
        evtid - an event
        Returns:
        a list off dependencies which origin is that event
      • minListUnexecuted

        public ArrayList<TableEvent> minListUnexecuted()
        returns the list of minimal events that are not yet executed in a timetable we search every event that has only executed predecessors
        Specified by:
        minListUnexecuted in class Schedular
        Returns:
      • PropagateDelay

        public void PropagateDelay​(Integer nb,
                                   float Delay)
        Propagates the effect of a delay in a timetable Important : we assume that the table is acyclic, so there is no need to mark events without predecessors
        Specified by:
        PropagateDelay in class Schedular
        Parameters:
        nb - : the event that is delayed
        Delay - : the value of delay
      • size

        public int size()
      • resetMarked

        public void resetMarked()
        Resets the marked field for all events in the table, i.e. all events are unexecuted and did not allow any transition in the net
      • dropConfig

        public String dropConfig()
      • getFilename

        public String getFilename()