MATSIM
core
mobsim
qsim
components
QSimComponentsFromConfigConfigurator.java
Go to the documentation of this file.
1
2
/* *********************************************************************** *
3
* project: org.matsim.*
4
* QSimComponentsFromConfigConfigurator.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.components;
23
24
import
org
.
matsim
.
core
.
config
.
Config
;
25
26
public
class
QSimComponentsFromConfigConfigurator
implements
QSimComponentsConfigurator
{
27
final
private
Config
config
;
28
29
public
QSimComponentsFromConfigConfigurator
(
Config
config) {
30
this.config =
config
;
31
}
32
33
@Override
34
public
void
configure
(
QSimComponentsConfig
components) {
35
QSimComponentsConfigGroup
componentsConfig = (
QSimComponentsConfigGroup
) config.
getModules
()
36
.get(
QSimComponentsConfigGroup
.
GROUP_NAME
);
37
// we do not want addOrCreateModule(...) since the design has a specific execution path for "null" (see below). kai, nov'19
38
39
if
(componentsConfig != null) {
40
components.
clear
();
41
42
// TODO: Eventually, here a translation of strings to more specific annotations
43
// could happen if we ever want a full config-configurable QSim.
44
componentsConfig.
getActiveComponents
().forEach(components::addNamedComponent);
45
}
46
}
47
}
org.matsim.core.mobsim.qsim.components.QSimComponentsFromConfigConfigurator.configure
void configure(QSimComponentsConfig components)
Definition:
QSimComponentsFromConfigConfigurator.java:34
org.matsim.core.mobsim.qsim.components.QSimComponentsConfigurator
Definition:
QSimComponentsConfigurator.java:24
org
org.matsim.core.config.Config
Definition:
Config.java:73
org.matsim.core.config
Definition:
CommandLine.java:22
org.matsim.core.mobsim.qsim.components.QSimComponentsConfigGroup.getActiveComponents
List< String > getActiveComponents()
Definition:
QSimComponentsConfigGroup.java:62
org.matsim.core.mobsim.qsim.components.QSimComponentsConfig.clear
void clear()
Definition:
QSimComponentsConfig.java:151
org.matsim.core.mobsim.qsim.components.QSimComponentsConfigGroup
Definition:
QSimComponentsConfigGroup.java:36
org.matsim.core.mobsim.qsim.components.QSimComponentsFromConfigConfigurator
Definition:
QSimComponentsFromConfigConfigurator.java:26
org.matsim.core
org.matsim.core.mobsim.qsim.components.QSimComponentsConfig
Definition:
QSimComponentsConfig.java:43
org.matsim.core.mobsim.qsim.components.QSimComponentsFromConfigConfigurator.config
final Config config
Definition:
QSimComponentsFromConfigConfigurator.java:27
org.matsim.core.mobsim.qsim.components.QSimComponentsConfigGroup.GROUP_NAME
static final String GROUP_NAME
Definition:
QSimComponentsConfigGroup.java:37
org.matsim
org.matsim.core.config.Config.getModules
final TreeMap< String, ConfigGroup > getModules()
Definition:
Config.java:288
org.matsim.core.mobsim.qsim.components.QSimComponentsFromConfigConfigurator.QSimComponentsFromConfigConfigurator
QSimComponentsFromConfigConfigurator(Config config)
Definition:
QSimComponentsFromConfigConfigurator.java:29
Generated by
1.8.13