From 1a60e40d853f6675983f115ec47bc95211c9f266 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 14 Sep 2009 08:41:16 +0000 Subject: [PATCH] fixed some bugs support more scheduling policies --- Robust/TransSim/Executor.java | 16 ++++- Robust/TransSim/FlexScheduler.java | 16 ++++- Robust/TransSim/Scheduler.java | 19 ++---- Robust/TransSim/ThreadClass.java | 9 +++ Robust/TransSim/TransSim.java | 103 ++++++++++++++++------------- Robust/TransSim/Transaction.java | 14 ++++ 6 files changed, 116 insertions(+), 61 deletions(-) diff --git a/Robust/TransSim/Executor.java b/Robust/TransSim/Executor.java index ab85935b..0707eed2 100644 --- a/Robust/TransSim/Executor.java +++ b/Robust/TransSim/Executor.java @@ -15,6 +15,15 @@ public class Executor { Random r; ThreadClass[] threads; + public String toString() { + String s=""; + for(int i=0;istarttime) starttime=newstart; - newstart=lastrd[step][evobject]-evtime; + + newstart=lastrd[step][evobject]-trans.getTime(trans.numEvents()-1); if (newstart>starttime) starttime=newstart; break; @@ -175,6 +176,7 @@ public class Scheduler { if (!lgood||step==lastEvent) { //go backwards + step--; for(;step>=0;step--) { //check for delay transaction...just skip them Transaction oldtrans=e.getThread(turn[step]).getTransaction(schedule[0][turn[step]]-schedule[step][turn[step]]); @@ -183,19 +185,8 @@ public class Scheduler { iturn=turn[step]+1; for(;iturn0) { - if (step==0) - break; - - int lastturn=turn[step-1]; - if (iturn0) + break; } if (iturn