MATSIM
SwissRailRaptorModule.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.* *
3  *
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2023 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package ch.sbb.matsim.routing.pt.raptor;
22 
27 
31 public class SwissRailRaptorModule extends AbstractModule {
32 
33  private final OccupancyData occupancyData = new OccupancyData();
34 
36  return this.occupancyData;
37  }
38 
39  @Override
40  public void install() {
41  if (getConfig().transit().isUseTransit()) {
42  bind(TransitRouter.class).toProvider(SwissRailRaptorFactory.class);
43  bind(SwissRailRaptor.class).toProvider(SwissRailRaptorFactory.class);
44 
45  for (String mode : getConfig().transit().getTransitModes()) {
47  }
48 
50 
51  if (srrConfig.isUseRangeQuery()) {
53  } else {
54  bind(RaptorRouteSelector.class).to(LeastCostRaptorRouteSelector.class); // just a simple default in case it ever gets used.
55  }
56 
57  switch (srrConfig.getScoringParameters()) {
58  case Default:
60  break;
61  case Individual:
63  break;
64  }
65 
66  bind(RaptorStopFinder.class).to(DefaultRaptorStopFinder.class);
67 
68  boolean useCapacityConstraints = srrConfig.isUseCapacityConstraints();
69  bind(OccupancyData.class).toInstance(this.occupancyData);
70  if (useCapacityConstraints) {
72  }
73 
77  }
78 
79  }
80 
81 }
static< T extends ConfigGroup > T addOrGetModule(Config config, Class< T > moduleClass)
final LinkedBindingBuilder< RoutingModule > addRoutingModuleBinding(String mode)
final LinkedBindingBuilder< EventHandler > addEventHandlerBinding()