Skip to content

Commit

Permalink
make all profiles optional
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl committed Dec 7, 2024
1 parent b369bbb commit 4662e90
Showing 1 changed file with 29 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,38 @@ public void install() {
addEventHandlerBinding().to(ChargingEventSequenceCollector.class);
addControlerListenerBinding().to(ChargingProceduresCSVWriter.class).in(Singleton.class);

installQSimModule(new AbstractQSimModule() {
@Override
protected void configureQSim() {
if (evCfg.timeProfiles) {
addQSimComponentBinding(EvModule.EV_COMPONENT).toProvider(SocHistogramTimeProfileCollectorProvider.class);
addQSimComponentBinding(EvModule.EV_COMPONENT).toProvider(IndividualChargeTimeProfileCollectorProvider.class);
addQSimComponentBinding(EvModule.EV_COMPONENT).toProvider(ChargerOccupancyTimeProfileCollectorProvider.class);
addQSimComponentBinding(EvModule.EV_COMPONENT).to(ChargerOccupancyXYDataCollector.class).asEagerSingleton();
addQSimComponentBinding(EvModule.EV_COMPONENT).toProvider(VehicleTypeAggregatedChargeTimeProfileCollectorProvider.class);
if (evCfg.timeProfiles) {
installQSimModule(new AbstractQSimModule() {
@Override
protected void configureQSim() {
addQSimComponentBinding(EvModule.EV_COMPONENT).toProvider(SocHistogramTimeProfileCollectorProvider.class);
addQSimComponentBinding(EvModule.EV_COMPONENT).toProvider(IndividualChargeTimeProfileCollectorProvider.class);
addQSimComponentBinding(EvModule.EV_COMPONENT).toProvider(ChargerOccupancyTimeProfileCollectorProvider.class);
addQSimComponentBinding(EvModule.EV_COMPONENT).to(ChargerOccupancyXYDataCollector.class).asEagerSingleton();
addQSimComponentBinding(EvModule.EV_COMPONENT).toProvider(VehicleTypeAggregatedChargeTimeProfileCollectorProvider.class);

bind(EnergyConsumptionCollector.class).asEagerSingleton();
addMobsimScopeEventHandlerBinding().to(EnergyConsumptionCollector.class);
addQSimComponentBinding(EvModule.EV_COMPONENT).to(EnergyConsumptionCollector.class);
// add more time profiles if necessary
bind(EnergyConsumptionCollector.class).asEagerSingleton();
addMobsimScopeEventHandlerBinding().to(EnergyConsumptionCollector.class);
addQSimComponentBinding(EvModule.EV_COMPONENT).to(EnergyConsumptionCollector.class);
// add more time profiles if necessary
}
}
}
});
bind(ChargerPowerTimeProfileCalculator.class).asEagerSingleton();
addEventHandlerBinding().to(ChargerPowerTimeProfileCalculator.class);
addControlerListenerBinding().toProvider(new Provider<>() {
@Inject
private ChargerPowerTimeProfileCalculator calculator;
@Inject
private MatsimServices matsimServices;
});
bind(ChargerPowerTimeProfileCalculator.class).asEagerSingleton();
addEventHandlerBinding().to(ChargerPowerTimeProfileCalculator.class);
addControlerListenerBinding().toProvider(new Provider<>() {
@Inject
private ChargerPowerTimeProfileCalculator calculator;
@Inject
private MatsimServices matsimServices;

@Override
public ControlerListener get() {
var profileView = new ChargerPowerTimeProfileView(calculator);
return new ProfileWriter(matsimServices,"ev",profileView,"charger_power_time_profiles");
@Override
public ControlerListener get() {
var profileView = new ChargerPowerTimeProfileView(calculator);
return new ProfileWriter(matsimServices,"ev",profileView,"charger_power_time_profiles");

}
});
}
});
}
}
}

0 comments on commit 4662e90

Please sign in to comment.