Examples of Movsim


Examples of org.movsim.autogen.Movsim

        return new FileUnmarshaller<Movsim>().load(xmlFile, Movsim.class, SCENARIO_FACTORY, SCENARIO_XSD_URL);
    }

    public static Movsim getInputData(File xmlFile)  {
        // testwise jaxb unmarshalling
        Movsim inputData = null;
        try {
            System.out.println("try to open file = " + xmlFile.getName());
            inputData = MovsimInputLoader.validateAndLoadScenarioInput(xmlFile);
        } catch (JAXBException  | SAXException e){
            throw new IllegalArgumentException(e.toString());
View Full Code Here

Examples of org.movsim.autogen.Movsim

        ConsumptionLogger.initializeLogger();

        // ConsumptionCommandLine.parse(ProjectMetaData.getInstance(), args);
        MovsimCommandLine.parse(args);

        Movsim inputData = MovsimInputLoader.getInputData(ProjectMetaData.getInstance().getInputFile());

        if (!inputData.isSetConsumption()) {
            System.err.println("no consumption element configured in input file");
            System.exit(1);
        }

        createConsumptionModels(inputData.getConsumption());

        System.out.println("size of batches = " + inputData.getConsumption().getBatchJobs().getBatchData().size());
        for (BatchData batch : inputData.getConsumption().getBatchJobs().getBatchData()) {
            InputReader reader = InputReader.create(batch);
            List<ConsumptionDataRecord> records = reader.getRecords();

            EnergyFlowModel model = consumptionModelPool.get(batch.getModel());
            Preconditions.checkNotNull(model, "model not available with name=" + batch.getModel());
            ConsumptionCalculation calculation = new ConsumptionCalculation(model);

            calculation.process(records);

            OutputWriter writer = OutputWriter.create(batch, ProjectMetaData.getInstance().getOutputPath());
            writer.write(records);
        }

        System.out.println(inputData.getConsumption().getBatchJobs().getBatchData().size() + " batches done.");

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.