MATSIM
RunFromConfigfileExample.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * MyControler1.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2007 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 tutorial.config;
22 
23 import org.matsim.api.core.v01.Scenario;
24 import org.matsim.core.config.Config;
28 
29 
37 
38  public static void main(final String[] args) {
39  String configFile ;
40  if ( args!=null && args.length>=1 ) {
41  configFile = args[0] ;
42  } else {
43  configFile = "examples/tutorial/config/example1-config.xml" ;
44 // configFile = "examples/tutorial/config/example5-config.xml" ;
45 // configFile = "examples/tutorial/config/example5trips-config.xml" ;
46  }
47 
48  Config config = ConfigUtils.loadConfig(configFile);
49 
50  Scenario scenario = ScenarioUtils.loadScenario(config);
51 
52  Controler controler = new Controler(scenario);
53  controler.run();
54  }
55 
56 }
static Config loadConfig(final String filename, ConfigGroup...customModules)
static Scenario loadScenario(final Config config)