MATSIM
WithinDayQSimModule.java
Go to the documentation of this file.
1 
2 /* *********************************************************************** *
3  * project: org.matsim.*
4  * WithinDayQSimModule.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.withinday.mobsim;
23 
28 
30  public final static String COMPONENT_NAME = "WithinDay";
31  public final static String FIXED_ORDER_LISTENER_COMPONENT_NAME = "FixedOrderSimulationListener";
32 
36 
37  public WithinDayQSimModule(WithinDayEngine withinDayEngine,
38  FixedOrderSimulationListener fixedOrderSimulationListener, WithinDayTravelTime withinDayTravelTime) {
39  this.withinDayEngine = withinDayEngine;
40  this.fixedOrderSimulationListener = fixedOrderSimulationListener;
41  this.withinDayTravelTime = withinDayTravelTime;
42  }
43 
44  @Override
45  protected void configureQSim() {
46  bind(WithinDayEngine.class).toInstance(withinDayEngine);
47  bind(FixedOrderSimulationListener.class).toInstance(fixedOrderSimulationListener);
48  bind(WithinDayTravelTime.class).toInstance(withinDayTravelTime);
49 
50  addQSimComponentBinding( FIXED_ORDER_LISTENER_COMPONENT_NAME ).to( FixedOrderSimulationListener.class );
51  addQSimComponentBinding( COMPONENT_NAME ).to( WithinDayTravelTime.class );
52  addQSimComponentBinding( COMPONENT_NAME ).to( WithinDayEngine.class );
53  }
54 
55  static public void configureComponents(QSimComponentsConfig components) {
56  components.addNamedComponent(COMPONENT_NAME);
57  components.addNamedComponent(FIXED_ORDER_LISTENER_COMPONENT_NAME);
58  }
59 }
WithinDayQSimModule(WithinDayEngine withinDayEngine, FixedOrderSimulationListener fixedOrderSimulationListener, WithinDayTravelTime withinDayTravelTime)
final FixedOrderSimulationListener fixedOrderSimulationListener
final LinkedBindingBuilder< QSimComponent > addQSimComponentBinding(Annotation annotation)
static void configureComponents(QSimComponentsConfig components)