- java.lang.Object
-
- fr.inria.mochy.core.abstractClass.Schedular
-
- fr.inria.mochy.core.timetable.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
-
-
Field Summary
Fields Modifier and Type Field Description HashMap<Integer,TableEvent>
events
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayList<TableDependency>
DependenciesFromEvent(Integer evtid)
String
dropConfig()
String
fileLoading()
load the input fileArrayList<TableDependency>
getDependencies()
return the list of the dependencies between the eventsTableEvent
getEvent(Integer evtid)
retrieve an evenet by its idHashMap<Integer,TableEvent>
getEvents()
list the events which can be retrieved by their id numberString
getFilename()
protected String
handleLine(String ln, int lineNb)
Handles a line of a timetable read from a file Lines are either of the form event:: : ArrayList<TableEvent>
minList()
returns the list of minimal events for a timetableArrayList<TableEvent>
minListUnexecuted()
returns the list of minimal events that are not yet executed in a timetable we search every event that has only executed predecessorsArrayList<Integer>
nextEvents(Integer evtid)
ArrayList<Integer>
PredecessorEvents(Integer evtid)
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 predecessorsvoid
resetMarked()
Resets the marked field for all events in the table, i.e.int
size()
-
-
-
Field Detail
-
events
public HashMap<Integer,TableEvent> events
-
-
Constructor Detail
-
TimeTable
public TimeTable(String filename)
Creates a timetable from a file- Parameters:
filename
-
-
-
Method Detail
-
fileLoading
public String fileLoading()
Description copied from class:Schedular
load the input file- Specified by:
fileLoading
in classSchedular
-
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:: : :t1:t2:....tk now the load of the transition is done through the cor file and tag have been added : event: :{tag1,tag2,...tagk}: : dependency: : : - Specified by:
handleLine
in classSchedular
- Parameters:
ln
-
-
getEvents
public HashMap<Integer,TableEvent> getEvents()
Description copied from class:Schedular
list the events which can be retrieved by their id number
-
getDependencies
public ArrayList<TableDependency> getDependencies()
Description copied from class:Schedular
return the list of the dependencies between the events- Specified by:
getDependencies
in classSchedular
-
getEvent
public TableEvent getEvent(Integer evtid)
Description copied from class:Schedular
retrieve an evenet by its id
-
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
-
minList
public ArrayList<TableEvent> minList()
returns the list of minimal events for a timetable
-
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 classSchedular
- 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 classSchedular
- Parameters:
nb
- : the event that is delayedDelay
- : 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()
-
-