From 76589e118255173a5a7e073b51cdbd890fd8a153 Mon Sep 17 00:00:00 2001 From: Andreas Egger Date: Tue, 21 May 2013 21:29:15 +0200 Subject: [PATCH] some fixes --- src/at/ac/tuwien/lsdc/SchedSimulator.java | 4 +++- .../ac/tuwien/lsdc/sched/AbstractScheduler.java | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/at/ac/tuwien/lsdc/SchedSimulator.java b/src/at/ac/tuwien/lsdc/SchedSimulator.java index da0d663..cd753c5 100644 --- a/src/at/ac/tuwien/lsdc/SchedSimulator.java +++ b/src/at/ac/tuwien/lsdc/SchedSimulator.java @@ -52,7 +52,9 @@ public class SchedSimulator { log.info(USAGE); System.exit(1); } + log.info("TEST ================================="); LinkedList apps = CSVParser.parseFile(inputFile); + log.info("apps size = "+apps.size()); Collections.sort(apps); AbstractScheduler scheduler; switch (schedulerType) { @@ -65,7 +67,7 @@ public class SchedSimulator { } ScenarioData data = scheduler.initAndStart(apps); CSVLogger logger = new CSVLogger(generalLog); - logger.logScenarioData(data); +// logger.logScenarioData(data); logger.close(); } diff --git a/src/at/ac/tuwien/lsdc/sched/AbstractScheduler.java b/src/at/ac/tuwien/lsdc/sched/AbstractScheduler.java index da6df0b..6b6dc20 100644 --- a/src/at/ac/tuwien/lsdc/sched/AbstractScheduler.java +++ b/src/at/ac/tuwien/lsdc/sched/AbstractScheduler.java @@ -89,13 +89,17 @@ public abstract class AbstractScheduler { insertStartEvent(app.getTimestamp(), app); insertStopEvent(app.getTimestamp() + app.getDuration(), app); } + + log.info("event map = "+ eventMap.size()); startScheduling(); try { logger.close(); } catch (IOException e) { log.error("couldn't close logger"); } - return doEndLogging(); + // TODO make end logging work + return null; +// return doEndLogging(); } /** @@ -141,15 +145,18 @@ public abstract class AbstractScheduler { */ protected void startScheduling() { while (true) { - LinkedList events = eventMap.get(currTime); - handleEvents(events); - doStateLogging(); + if(eventMap.containsKey(currTime)) { + LinkedList events = eventMap.get(currTime); + log.info(events.size()+" events at timestamp "+currTime); + handleEvents(events); + doStateLogging(); + } //advance Time to next Event currTime++; if (currTime == endTime) { // reached last Event, Scheduler will shut down - log.debug("Last event reached at time "+currTime); + log.info("Last event reached at time "+currTime); break; } } -- 2.43.0