MATSIM
NetworkConfigGroup.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * NetworkConfigGroup.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 org.matsim.core.config.groups;
22 
25 
26 import java.net.URL;
27 
28 import java.util.Map;
29 
30 public final class NetworkConfigGroup extends ReflectiveConfigGroup {
31 
32  public static final String GROUP_NAME = "network";
33 
34  private static final String INPUT_FILE= "inputNetworkFile";
35 
36  private static final String TIME_VARIANT_NETWORK = "timeVariantNetwork";
37  private static final String CHANGE_EVENTS_INPUT_FILE = "inputChangeEventsFile";
38 
39  private static final String LANEDEFINITIONSINPUTFILE = "laneDefinitionsFile";
40  private static final String INPUT_CRS = "inputCRS";
41 
42  private String inputFile = null;
43 
44  @Deprecated private String inputCRS = null;
45 
46  private String changeEventsInputFile = null;
47 
48  private boolean timeVariantNetwork = false;
49 
50  private String laneDefinitionsFile = null;
51 
52  public NetworkConfigGroup() {
54  }
55 
56  @Override
57  public Map<String,String> getComments() {
58  final Map<String,String> comments = super.getComments();
59 
60  comments.put( INPUT_CRS , "(deprecated: rather express CRS in file) The Coordinates Reference System in which the coordinates are expressed in the input file." +
61  " At import, the coordinates will be converted to the coordinate system defined in \"global\", and will" +
62  "be converted back at export. If not specified, no conversion happens." );
63 
64  return comments;
65  }
66 
67  /* direct access */
68 
69  @StringGetter( INPUT_FILE )
70  public String getInputFile() {
71  return this.inputFile;
72  }
74  public void setInputFile(final String inputFile) {
75  testForLocked();
76  // (network is set locked after the (Mutable)Scenario is created ... since it needs to know about the time-dep network before that. Technically, the network file name
77  // could still be changed later. But we don't have (and maybe don't want) a separate switch for that. In general, the rule of thumb
78  // is: The config should be final _before_ the scenario is created. I don't think we need to accept every possible use case where
79  // this is not strictly necessary. kai, may'22
80 
81  this.inputFile = inputFile;
82  }
83 
84  public URL getInputFileURL(URL context) {
85  return ConfigGroup.getInputFileURL(context, this.inputFile);
86  }
87 
89  public void setChangeEventsInputFile(final String changeEventsInputFile) {
91  }
92 
94  public String getChangeEventsInputFile() {
95  return changeEventsInputFile;
96  }
97 
98 
99  public URL getChangeEventsInputFileUrl(URL context) {
100  return ConfigGroup.getInputFileURL(context, this.changeEventsInputFile);
101  }
102 
104  public void setTimeVariantNetwork(final boolean timeVariantNetwork) {
105  testForLocked();
107  }
109  public boolean isTimeVariantNetwork() {
110  return this.timeVariantNetwork;
111  }
112 
114  public void setLaneDefinitionsFile(final String laneDefinitions) {
115  this.laneDefinitionsFile = laneDefinitions;
116  }
117 
119  public String getLaneDefinitionsFile(){
120  return this.laneDefinitionsFile;
121  }
122 
123 
127  @Deprecated // set directly in file.
129  public String getInputCRS() {
130  return inputCRS;
131  }
132  // I think that this should be deprecated since the same functionality can be achieved by writing it directly into the corresponding file. kai, feb'24
133 
137  @Deprecated // set directly in file
139  public void setInputCRS(String inputCRS) {
140  this.inputCRS = inputCRS;
141  }
142 }
void setTimeVariantNetwork(final boolean timeVariantNetwork)
void setLaneDefinitionsFile(final String laneDefinitions)
static URL getInputFileURL(URL context, String filename)
void setChangeEventsInputFile(final String changeEventsInputFile)