]> git.somenet.org - pub/jan/lsdc.git/blob - src/at/ac/tuwien/lsdc/SchedSimulator.java
Protokoll vom Tutormeeting.
[pub/jan/lsdc.git] / src / at / ac / tuwien / lsdc / SchedSimulator.java
1 package at.ac.tuwien.lsdc;
2
3 import java.util.LinkedList;
4
5 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory;
7
8 import at.ac.tuwien.lsdc.sched.AbstractScheduler;
9 import at.ac.tuwien.lsdc.sched.SchedulerA;
10 import at.ac.tuwien.lsdc.sched.SchedulerB;
11 import at.ac.tuwien.lsdc.sched.SchedulerC;
12 import at.ac.tuwien.lsdc.types.Application;
13 import at.ac.tuwien.lsdc.types.ScenarioData;
14 import at.ac.tuwien.lsdc.util.CSVParser;
15 import at.ac.tuwien.lsdc.util.CSVScenariosLogger;
16
17 /**
18  * Read config (command line properties) and start Scheduler-Simulation.
19  */
20 public class SchedSimulator {
21         private static final Logger log = LoggerFactory.getLogger(SchedSimulator.class);
22         
23         private static String schedulerType;
24         private static String inputFile;
25         private static String scenario;
26
27         public static void main(String[] args) throws Exception {
28                 log.info("Hello World!");
29                 parseCommandLineArgs(args);
30                 CSVParser parser = new CSVParser(inputFile);
31                 LinkedList<Application> apps = parser.parseFile();
32                 AbstractScheduler scheduler;
33                 switch (schedulerType) {
34                 case "A":
35                         scheduler = new SchedulerA();
36                 case "B":
37                         scheduler = new SchedulerB();
38                 default:
39                         scheduler = new SchedulerC();
40                 }
41                 
42                 ScenarioData data = scheduler.initAndStart(apps);
43                 CSVScenariosLogger logger = new CSVScenariosLogger("out_scen"+scenario+"sched"+schedulerType+".csv");
44                 logger.appendScenarioData(data);
45         }
46         
47         private static void parseCommandLineArgs(String[] args) {
48                 
49         }
50 }