/** * Create an instance of {@link Consumption } * */ public Consumption createConsumption() { return new Consumption(); }
private void createConsumptionModels(Consumption movsimInput) { for (ConsumptionModel modelInput : movsimInput.getConsumptionModels().getConsumptionModel()) { EnergyFlowModel energyFlowModel = EnergyFlowModels.create(modelInput); consumptionModelPool.put(modelInput.getLabel(), energyFlowModel); } }
private void run() { int batchSize = inputData.getConsumption().getBatchJobs().getBatchData().size(); LOG.info("size of batches={}", batchSize); 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 = createWriter(batch, ProjectMetaData.getInstance().getOutputPath()); writer.write(records); } LOG.info("{} batches done.", batchSize); }
public VehicleFactory(double simulationTimestep, VehiclePrototypes vehPrototypes, @Nullable Consumption consumption, Routing routing, @Nullable ServiceProviders serviceProviders) { Preconditions.checkNotNull(vehPrototypes); this.routing = Preconditions.checkNotNull(routing); this.serviceProviders = serviceProviders; if (consumption != null) { fuelModelFactory.add(consumption.getConsumptionModels()); } initialize(simulationTimestep, vehPrototypes.getVehiclePrototypeConfiguration(), consumption); if (vehPrototypes.isSetWriteFundDiagrams() && vehPrototypes.isWriteFundDiagrams()) { writeFundamentalDiagrams(simulationTimestep); } if (vehPrototypes.isSetWriteAccFunctions() && vehPrototypes.isWriteAccFunctions()) { writeAccelerationFunctions(simulationTimestep); } }