MATSIM
TransitEngineModule.java
Go to the documentation of this file.
1 
2 /* *********************************************************************** *
3  * project: org.matsim.*
4  * TransitEngineModule.java
5  * *
6  * *********************************************************************** *
7  * *
8  * copyright : (C) 2019 by the members listed in the COPYING, *
9  * LICENSE and WARRANTY file. *
10  * email : info at matsim dot org *
11  * *
12  * *********************************************************************** *
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * See also COPYING, LICENSE and WARRANTY file *
19  * *
20  * *********************************************************************** */
21 
22  package org.matsim.core.mobsim.qsim.pt;
23 
24 import com.google.inject.Provides;
25 import com.google.inject.Singleton;
26 import com.google.inject.multibindings.OptionalBinder;
28 import org.matsim.core.mobsim.qsim.QSim;
30 import org.matsim.pt.UmlaufBuilder;
31 
33  public final static String TRANSIT_ENGINE_NAME = "TransitEngine";
34 
35  @Override
36  protected void configureQSim() {
37  bind(TransitQSimEngine.class).asEagerSingleton();
38  addQSimComponentBinding( TRANSIT_ENGINE_NAME ).to( TransitQSimEngine.class );
39 
40  if ( this.getConfig().transit().isUseTransit() && this.getConfig().transit().isUsingTransitInMobsim() ) {
42  } else {
43  // Explicit bindings are required, so although it may not be used, we need provide something.
45  }
46 
47  bind( UmlaufBuilder.class ).to( ReconstructingUmlaufBuilder.class );
48 
49  OptionalBinder.newOptionalBinder(binder(), TransitDriverAgentFactory.class)
50  .setDefault().to( DefaultTransitDriverAgentFactory.class );
51  }
52 
53  @Provides
54  @Singleton
56  return new TransitStopAgentTracker(qSim.getEventsManager());
57  }
58 }
final LinkedBindingBuilder< QSimComponent > addQSimComponentBinding(Annotation annotation)
EventsManager getEventsManager()
Definition: QSim.java:565
TransitStopAgentTracker transitStopAgentTracker(QSim qSim)