Skip to content

Commit

Permalink
initialize imc config
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Apr 1, 2024
1 parent 346b81e commit 4764102
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.google.inject.TypeLiteral;
import com.google.inject.multibindings.MapBinder;
import com.google.inject.multibindings.Multibinder;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.controler.AbstractModule;
import org.matsim.core.controler.listener.ControlerListener;
import org.matsim.core.router.PlanRouter;
Expand Down Expand Up @@ -53,14 +54,13 @@ public static Builder newBuilder() {
@Override
public void install() {

bindAllModes(builder.fixedCosts, new TypeLiteral<>() {
});
bindAllModes(builder.legEstimators, new TypeLiteral<>() {
});
bindAllModes(builder.tripEstimators, new TypeLiteral<>() {
});
bindAllModes(builder.options, new TypeLiteral<>() {
});
// Make sure the config group is initialized
ConfigUtils.addOrGetModule(getConfig(), InformedModeChoiceConfigGroup.class);

bindAllModes(builder.fixedCosts, new TypeLiteral<>() {});
bindAllModes(builder.legEstimators, new TypeLiteral<>() {});
bindAllModes(builder.tripEstimators, new TypeLiteral<>() {});
bindAllModes(builder.options, new TypeLiteral<>() {});

bind(ActivityEstimator.class).to(builder.activityEstimator).in(Singleton.class);

Expand All @@ -74,8 +74,7 @@ public void install() {
bind(PlanModelService.class).asEagerSingleton();
addControlerListenerBinding().to(PlanModelService.class).asEagerSingleton();

Multibinder<TripConstraint<?>> tcBinder = Multibinder.newSetBinder(binder(), new TypeLiteral<>() {
});
Multibinder<TripConstraint<?>> tcBinder = Multibinder.newSetBinder(binder(), new TypeLiteral<>() {});
for (Class<? extends TripConstraint<?>> c : builder.constraints) {
tcBinder.addBinding().to(c).in(Singleton.class);
}
Expand Down

0 comments on commit 4764102

Please sign in to comment.