MATSIM
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 
27  final private Config config;
28 
30  this.config = config;
31  }
32 
33  @Override
34  public void configure(QSimComponentsConfig components) {
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 }
final TreeMap< String, ConfigGroup > getModules()
Definition: Config.java:288