package bootstrap;

import com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar;
import os.OperatingSystem;
import os.OperatingSystemImpl;
import readinstruction.ReadInstruction;
import scheduler.*;
import utils.Clock;

import java.util.List;

/**
 * Created by Karol on 2017-04-20.
 */
public class Runtime {
    public static void main(String[] args) {
        String directory = "./inputdata/";
        String fileName = "RAND_CONST_TRUE";
        String extension = ".csv";
        String loadPath = directory + fileName + extension;
        Clock systemClock = new Clock();
        List<ReadInstruction> instructionList = ReadInstruction.parseList(loadPath);
        Scheduler[] systemSchedulers = {
//                new FcfsScheduler(),
//                new ScanScheduler(1024),
//                new CScanScheduler(1024),
                new SstfScheduler(false),
                new SstfScheduler(true),
                new EdfScheduler(false),
                new EdfScheduler(true)
        };


        OperatingSystem myOS;
        for (Scheduler systemScheduler : systemSchedulers) {
            myOS = OperatingSystemImpl.builder()
                    .withClock(systemClock)
                    .withSystemScheduler(systemScheduler)
                    .withReadInstructions(instructionList)
//                    .withConsoleOutput()
                    .build();
            myOS.run();
            systemClock.reset();
            System.out.println(myOS.generateReport(loadPath));
            System.out.println();
            System.out.println();
        }
    }
}

@@ -409,16 +409,18 @@
   String
+%5B%5D
  fileNam
@@ -424,65 +424,372 @@
 Name
+s
  = 
-%22RAND_CONST_TRUE%22;%0A        String extension = %22.csv%22;%0A
+%7B%0A                %22GOOD_IMMIDIATE_FALSE%22,%0A                %22BAD_IMMIDIATE_FALSE%22,%0A                %22RAND_IMMIDIATE_FALSE%22,%0A                %22GOOD_CONST_TRUE%22,%0A                %22BAD_CONST_TRUE%22,%0A                %22RAND_CONST_TRUE%22%0A        %7D;%0A        String extension = %22.csv%22;%0A        Clock systemClock = new Clock();%0A%0A        for (String fileName : fileNames) %7B%0A    
     
@@ -852,45 +852,8 @@
     
-    Clock systemClock = new Clock();%0A
     
@@ -941,16 +941,20 @@
         
+ 
+   
 Schedule
@@ -978,18 +978,16 @@
 ers = %7B%0A
-//
         
@@ -1015,18 +1015,16 @@
 uler(),%0A
-//
         
@@ -1056,18 +1056,16 @@
 (1024),%0A
-//
         
@@ -1261,16 +1261,20 @@
 r(true)%0A
+    
         
@@ -1286,16 +1286,20 @@
         
+    
 Operatin
@@ -1312,16 +1312,20 @@
 m myOS;%0A
+    
         
@@ -1385,24 +1385,28 @@
             
+    
 myOS = Opera
@@ -1446,24 +1446,28 @@
             
+ 
+   
 .withClock(s
@@ -1478,16 +1478,20 @@
 mClock)%0A
+    
         
@@ -1556,24 +1556,28 @@
             
+    
 .withReadIns
@@ -1621,24 +1621,28 @@
             
+   
+ 
 .withConsole
@@ -1670,16 +1670,20 @@
         
+    
 .build()
@@ -1692,24 +1692,28 @@
             
+  
+  
 myOS.run();%0A
@@ -1708,24 +1708,28 @@
 myOS.run();%0A
+    
             
@@ -1753,32 +1753,36 @@
 ();%0A            
+    
 System.out.print
@@ -1820,32 +1820,36 @@
 ));%0A            
+   
+ 
 System.out.print
@@ -1858,32 +1858,36 @@
 ();%0A            
+    
 System.out.print
@@ -1884,32 +1884,46 @@
 .out.println();%0A
+            %7D%0A
         %7D%0A    %7D%0A

Fix ReadInstruction read method