123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- 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\\Eval\\inputs\\scenario02-25h_"+System.currentTimeMillis();
- String path = "C:\\Users\\Jonas\\Dropbox\\Mein PC (DESKTOP-L7IQHES)\\Documents\\Uni\\TUD\\Bachelorarbeit\\HOLEG\\exampleNetworks\\MyExamples\\scenario02-25h.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);
- }
- }
|