package holon_control_unit_evaluation; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintStream; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import org.apache.commons.compress.archivers.ArchiveException; import ui.controller.Control; import ui.model.Model; import ui.view.GUI; import ui.view.IndexTranslator; public class Main { public static void main(String[] args) throws FileNotFoundException { if (!System.getProperty("os.name").startsWith("Linux")) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { e.printStackTrace(); } } // Model model = new Model(); // Control control = new Control(model); // GUI view = new GUI(control); // IndexTranslator.model = model; // view.getFrmCyberPhysical().setVisible(true); String fileName = "C:\\Users\\Jonas\\Dropbox\\Mein PC (DESKTOP-L7IQHES)\\Documents\\Uni\\TUD\\Bachelorarbeit\\bachelor-evaluation\\Eval\\inputs\\scenario03-50h_"+System.currentTimeMillis(); String path = "C:\\Users\\Jonas\\Dropbox\\Mein PC (DESKTOP-L7IQHES)\\Documents\\Uni\\TUD\\Bachelorarbeit\\HOLEG\\exampleNetworks\\MyExamples\\scenario03-50h.holon"; PrintStream systemOut = System.out; Model model = new Model(); Control control = new Control(model); GUI view = new GUI(control); IndexTranslator.model = model; view.getFrmCyberPhysical().setVisible(true); File outputFile = new File(fileName+".txt"); PrintStream printStream = new PrintStream(outputFile); System.setOut(printStream); for(int i=0; i<50; i++) { try { control.loadFile(path); } catch (IOException | ArchiveException e) { // TODO Auto-generated catch block e.printStackTrace(); return; } for(int j=0; j<100; j++) { control.getSimManager().calculateStateForTimeStep(j, true); } } printStream.close(); System.setOut(systemOut); } }