Commit 0cf9db3d authored by HELOUET Loic's avatar HELOUET Loic
Browse files

timetable example updated, delay propagation corrected

parent de8444e0
Pipeline #184172 failed with stages
in 1 minute and 59 seconds
event:1:100:e1:5
event:2:200:e2:6:7
dependency:1:2:150
\ No newline at end of file
event:2:260:e2:6:7
event:3:400:e3:2:3
dependency:1:2:150
dependency:2:3:100
\ No newline at end of file
......@@ -82,6 +82,9 @@ public class TTConfig {
// current date then the event can be realized
if (foundev.date <= currentDate) {
System.out.println("Firing Event "+nb+"@date"+currentDate);
int oldDate=foundev.date; //remember the last expected firing date of fired event
foundev.realize(currentDate);
// Compute the new minimal list
......@@ -97,9 +100,14 @@ public class TTConfig {
}
}
if (foundev.date < currentDate) {
if (oldDate < currentDate) {
// propagate delay if needed
table.PropagateDelay(nb,currentDate-foundev.date);
int delay=currentDate-oldDate;
System.out.println("Late by: "+delay);
table.PropagateDelay(nb,delay);
System.out.println("Delay Propagation:"+ nb + "@"+ foundev.date+ ":" + delay);
}
}
}
......
......@@ -6,7 +6,7 @@ import java.util.ArrayList;
public class TableEvent {
int number; // a unique identifier for the event
int date; // the expected date for the realization of this event
int date; // the currently expected date for the realization of this event
int initialDate;// the original date set for this event
String label; // a label describing the event (number are not informative enough)
ArrayList<Integer> transnames; // a list of transitions that could be realizations of this event
......@@ -110,6 +110,8 @@ TableEvent(){
*/
void realize(int date) {
this.recordedDate=date;
this.date=date;
this.realized=true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment