MATSIM
core
controler
ControlerDefaultsModule.java
Go to the documentation of this file.
1
/*
2
* *********************************************************************** *
3
* * project: org.matsim.*
4
* * DefaultControlerModules.java
5
* * *
6
* * *********************************************************************** *
7
* * *
8
* * copyright : (C) 2014 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
23
package
org.matsim.core.controler;
24
25
import
com.google.inject.Inject;
26
import
org
.
matsim
.
analysis
.
IterationTravelStatsModule
;
27
import
org
.
matsim
.
analysis
.
LegHistogramModule
;
28
import
org
.
matsim
.
analysis
.
LegTimesModule
;
29
import
org
.
matsim
.
analysis
.
LinkStatsModule
;
30
import
org
.
matsim
.
analysis
.
ModeStatsModule
;
31
import
org
.
matsim
.
analysis
.
ScoreStatsModule
;
32
import
org
.
matsim
.
analysis
.
VolumesAnalyzerModule
;
33
import
org
.
matsim
.
core
.
controler
.
events
.
StartupEvent
;
34
import
org
.
matsim
.
core
.
controler
.
listener
.
StartupListener
;
35
import
org
.
matsim
.
core
.
events
.
EventsManagerModule
;
36
import
org
.
matsim
.
core
.
mobsim
.
DefaultMobsimModule
;
37
import
org
.
matsim
.
core
.
population
.
VspPlansCleanerModule
;
38
import
org
.
matsim
.
core
.
replanning
.
StrategyManagerModule
;
39
import
org
.
matsim
.
core
.
replanning
.
annealing
.
ReplanningAnnealer
;
40
import
org
.
matsim
.
core
.
replanning
.
inheritance
.
PlanInheritanceModule
;
41
import
org
.
matsim
.
core
.
router
.
TripRouterModule
;
42
import
org
.
matsim
.
core
.
router
.
costcalculators
.
TravelDisutilityModule
;
43
import
org
.
matsim
.
core
.
scoring
.
functions
.
CharyparNagelScoringFunctionModule
;
44
import
org
.
matsim
.
core
.
trafficmonitoring
.
TravelTimeCalculatorModule
;
45
import
org
.
matsim
.
core
.
utils
.
timing
.
TimeInterpretationModule
;
46
import
org
.
matsim
.
counts
.
CountsModule
;
47
import
org
.
matsim
.
guice
.
DependencyGraphModule
;
48
import
org
.
matsim
.
vis
.
snapshotwriters
.
SnapshotWritersModule
;
49
50
import
javax.imageio.ImageIO;
51
import
java.io.File;
52
53
public
final
class
ControlerDefaultsModule
extends
AbstractModule
{
54
55
@Override
56
public
void
install
() {
57
install
(
new
EventsManagerModule
());
58
install
(
new
DefaultMobsimModule
());
59
install
(
new
TravelTimeCalculatorModule
());
60
install
(
new
TravelDisutilityModule
());
61
install
(
new
CharyparNagelScoringFunctionModule
());
62
install
(
new
TripRouterModule
());
63
install
(
new
StrategyManagerModule
());
64
install
(
new
TimeInterpretationModule
());
65
if
(
getConfig
().replanningAnnealer().isActivateAnnealingModule()) {
66
addControlerListenerBinding
().to(
ReplanningAnnealer
.class);
67
}
68
69
// I think that the ones coming here are all for analysis only, and thus not central to the iterations. kai, apr'18
70
install
(
new
LinkStatsModule
());
71
install
(
new
VolumesAnalyzerModule
());
72
install
(
new
LegHistogramModule
());
73
install
(
new
LegTimesModule
());
74
install
(
new
IterationTravelStatsModule
());
75
install
(
new
ScoreStatsModule
());
76
install
(
new
ModeStatsModule
());
77
install
(
new
CountsModule
());
78
install
(
new
VspPlansCleanerModule
());
79
install
(
new
SnapshotWritersModule
());
80
install
(
new
DependencyGraphModule
());
81
install
(
new
PlanInheritanceModule
());
82
83
// Comment by Tarek Chouaki.
84
// To make sure the cache files used under ChartUtils are located in tmp folder in the output directory
85
// The ImageIO.setCacheDirectory method checks if the provided directory exists so it needs to be created first
86
// Maybe not the best place to but this but since ChartUtils is used by many modules, including default ones,
87
// the cache needs to be always set correctly.
88
addControlerListenerBinding
().toInstance(
new
StartupListener
() {
89
90
@Override
91
public
void
notifyStartup(
StartupEvent
event) {
92
ImageIO.setCacheDirectory(
new
File(event.
getServices
().
getControlerIO
().
getTempPath
()));
93
}
94
});
95
96
/* Comment by kai (mz thinks it is not helpful): The framework eventually calls the above method, which calls the include
97
* methods , which (fairly quickly) call their own install methods, etc. Eventually, everything is resolved down to the
98
* "bindTo..." methods, which are the leaves.
99
*/
100
101
}
102
}
org.matsim.guice.DependencyGraphModule
Definition:
DependencyGraphModule.java:5
org.matsim.analysis.VolumesAnalyzerModule
Definition:
VolumesAnalyzerModule.java:28
org.matsim.core.replanning
org.matsim.core.controler.listener
Definition:
AfterMobsimListener.java:21
org.matsim.core.mobsim.DefaultMobsimModule
Definition:
DefaultMobsimModule.java:31
org.matsim.core.controler.ControlerDefaultsModule.install
void install()
Definition:
ControlerDefaultsModule.java:56
org.matsim.core.replanning.inheritance
Definition:
PlanInheritanceModule.java:1
org.matsim.core.scoring.functions
Definition:
ActivityTypeOpeningIntervalCalculator.java:22
org.matsim.core.replanning.inheritance.PlanInheritanceModule
Definition:
PlanInheritanceModule.java:64
org.matsim.core.replanning.annealing
Definition:
ReplanningAnnealer.java:20
org.matsim.core.scoring.functions.CharyparNagelScoringFunctionModule
Definition:
CharyparNagelScoringFunctionModule.java:34
org.matsim.core.utils.timing.TimeInterpretationModule
Definition:
TimeInterpretationModule.java:8
org.matsim.core.trafficmonitoring.TravelTimeCalculatorModule
Definition:
TravelTimeCalculatorModule.java:49
org.matsim.core.router.costcalculators.TravelDisutilityModule
Definition:
TravelDisutilityModule.java:28
org.matsim.core.replanning.StrategyManagerModule
Definition:
StrategyManagerModule.java:40
org.matsim.core.controler.events
Definition:
AbstractIterationEvent.java:1
org.matsim.core.controler.MatsimServices.getControlerIO
OutputDirectoryHierarchy getControlerIO()
org
org.matsim.analysis.ModeStatsModule
Definition:
ModeStatsModule.java:28
org.matsim.analysis
Definition:
ActivityWriter.java:1
org.matsim.core.router.costcalculators
Definition:
FreespeedTravelTimeAndDisutility.java:21
org.matsim.core.utils
org.matsim.analysis.LinkStatsModule
Definition:
LinkStatsModule.java:27
org.matsim.core.events.EventsManagerModule
Definition:
EventsManagerModule.java:33
org.matsim.vis.snapshotwriters
Definition:
AgentSnapshotInfo.java:20
org.matsim.guice
Definition:
DependencyGraphControlerListener.java:23
org.matsim.core.controler.listener.StartupListener
Definition:
StartupListener.java:28
org.matsim.core.population
Definition:
ActivityImpl.java:21
org.matsim.core.mobsim
Definition:
DefaultMobsimModule.java:23
org.matsim.analysis.ScoreStatsModule
Definition:
ScoreStatsModule.java:28
org.matsim.core.population.VspPlansCleanerModule
Definition:
VspPlansCleanerModule.java:28
org.matsim.core.controler
Definition:
AbstractController.java:20
org.matsim.core
org.matsim.vis.snapshotwriters.SnapshotWritersModule
Definition:
SnapshotWritersModule.java:37
org.matsim.core.router
Definition:
AnalysisMainModeIdentifier.java:20
org.matsim.core.controler.AbstractModule.addControlerListenerBinding
final LinkedBindingBuilder< ControlerListener > addControlerListenerBinding()
Definition:
AbstractModule.java:143
org.matsim.counts
org.matsim.core.scoring
Definition:
EventsToActivities.java:21
org.matsim.core.events
org.matsim.core.utils.timing
Definition:
TimeInterpretation.java:1
org.matsim.core.controler.ControlerDefaultsModule
Definition:
ControlerDefaultsModule.java:53
org.matsim.core.controler.events.ControlerEvent.getServices
MatsimServices getServices()
Definition:
ControlerEvent.java:47
org.matsim.analysis.IterationTravelStatsModule
Definition:
IterationTravelStatsModule.java:27
org.matsim.core.router.TripRouterModule
Definition:
TripRouterModule.java:33
org.matsim.vis
org.matsim.core.controler.AbstractModule
Definition:
AbstractModule.java:76
org.matsim.core.replanning.annealing.ReplanningAnnealer
Definition:
ReplanningAnnealer.java:51
org.matsim.counts.CountsModule
Definition:
CountsModule.java:38
org.matsim.core.trafficmonitoring
Definition:
AveragingTravelTimeGetter.java:21
org.matsim.analysis.LegTimesModule
Definition:
LegTimesModule.java:28
org.matsim
org.matsim.core.controler.AbstractModule.getConfig
final Config getConfig()
Definition:
AbstractModule.java:120
org.matsim.analysis.LegHistogramModule
Definition:
LegHistogramModule.java:27
org.matsim.core.controler.OutputDirectoryHierarchy.getTempPath
final String getTempPath()
Definition:
OutputDirectoryHierarchy.java:112
org.matsim.core.controler.events.StartupEvent
Definition:
StartupEvent.java:30
Generated by
1.8.13