From e5fa06c5beae40210e150d70556e30e929ce1818 Mon Sep 17 00:00:00 2001 From: jzhou Date: Tue, 3 Mar 2009 16:33:04 +0000 Subject: [PATCH] bug fix: can not print out the selected scheduling --- .../Analysis/Scheduling/MCImplSynthesis.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Robust/src/Analysis/Scheduling/MCImplSynthesis.java b/Robust/src/Analysis/Scheduling/MCImplSynthesis.java index 983af365..b03d5e3c 100644 --- a/Robust/src/Analysis/Scheduling/MCImplSynthesis.java +++ b/Robust/src/Analysis/Scheduling/MCImplSynthesis.java @@ -158,8 +158,11 @@ public class MCImplSynthesis { for(int i = 0; i < scheduleGraphs.size(); i++) { Vector tmpgraph = scheduleGraphs.elementAt(i); for(int j = 0; j < tmpgraph.size(); j++) { - tmpgraph.elementAt(j).getEdgeVector().clear(); - tmpgraph.elementAt(j).getInedgeVector().clear(); + ScheduleNode snode = tmpgraph.elementAt(j); + snode.getEdgeVector().clear(); + snode.getInedgeVector().clear(); + snode.getScheduleEdges().clear(); + snode.getClassNodes().clear(); } tmpgraph.clear(); tmpgraph = null; @@ -185,13 +188,18 @@ public class MCImplSynthesis { int tmpexetime = this.scheduleSimulator.simulate(schedulings, selectedSchedulings, selectedSimExeGraphs); + boolean remove = false; if(tmpexetime < bestexetime) { + remove = true; bestexetime = tmpexetime; if(scheduling != null) { scheduling.clear(); for(int j = 0; j < schedulinggraph.size(); j++) { - schedulinggraph.elementAt(j).getEdgeVector().clear(); - schedulinggraph.elementAt(j).getInedgeVector().clear(); + ScheduleNode snode = schedulinggraph.elementAt(j); + snode.getEdgeVector().clear(); + snode.getInedgeVector().clear(); + snode.getScheduleEdges().clear(); + snode.getClassNodes().clear(); } schedulinggraph.clear(); } @@ -217,8 +225,8 @@ public class MCImplSynthesis { selectedSimExeGraphs, gid, this.scheduleThreshold); - if(tmpexetime < bestexetime) { - scheduleGraphs.remove(selectedSchedulings.elementAt(0)); + if(remove) { + scheduleGraphs.removeElementAt(selectedSchedulings.elementAt(0)); } }while(newscheduleGraphs != null); // TODO: could it possibly lead to endless loop? -- 2.34.1