MATSIM
CountsConfigGroup.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * CountsConfigGroup.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2007, 2008 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 
23 import java.net.URL;
24 import java.util.Locale;
25 import java.util.Map;
26 
30 
35 public final class CountsConfigGroup extends ReflectiveConfigGroup {
36 
37  public static final String GROUP_NAME = "counts";
38 
39  private static final String OUTPUTFORMAT = "outputformat";
40  private static final String DISTANCEFILTER = "distanceFilter";
41  private static final String DISTANCEFILTERCENTERNODE = "distanceFilterCenterNode";
42  private static final String COUNTSINPUTFILENAME = "inputCountsFile";
43  private static final String COUNTSSCALEFACTOR = "countsScaleFactor";
44  private static final String WRITECOUNTSINTERVAL = "writeCountsInterval";
45  private static final String AVERAGECOUNTSOVERITERATIONS = "averageCountsOverIterations";
46  private static final String ANALYZEDMODES = "analyzedModes";
47  private static final String FILTERMODES = "filterModes";
48  private static final String INPUT_CRS = "inputCRS";
49 
50  private String outputFormat = "txt";
51 
55  private Double distanceFilter;
56 
60  private String distanceFilterCenterNode;
61 
65  private String inputFile = null;
69  private double countsScaleFactor = 1.0;
70 
71  private int writeCountsInterval = 10;
72  private int averageCountsOverIterations = 5;
73 
74  private String analyzedModes = TransportMode.car;
75  private boolean filterModes = false;
76  private String inputCRS = null;
77 
78  public CountsConfigGroup() {
79  super(GROUP_NAME);
80  }
81 
82  // the following are public so they can be re-used in PtCountsComparisonConfigGroup. Once that group is moved into the same
83  // package, they can be made package-private. kai, oct'10
84  public static final String COUNTS_OUTPUTFORMAT_COMMENT = "possible values: `html', `txt', `all'" ;
85  public static final String COUNTS_DISTANCEFILTER_COMMENT = "distance to distanceFilterCenterNode to include counting stations. The unit of distance is "
86  + "the Euclidean distance implied by the coordinate system" ;
87  public static final String COUNTS_DISTANCEFILTERCENTERNODE_COMMENT = "node id for center node of distance filter" ;
88  public static final String COUNTSINPUTFILENAME_COMMENT = "input file name to counts package" ;
89  public static final String COUNTSSCALEFACTOR_COMMENT = "factor by which to re-scale the simulated values. necessary when "
90  + "simulation runs with something different from 100%. needs to be adapted manually" ;
91 
92  @Override
93  public Map<String, String> getComments() {
94  Map<String, String> comments = super.getComments();
95  comments.put(OUTPUTFORMAT, COUNTS_OUTPUTFORMAT_COMMENT ) ;
96  comments.put(DISTANCEFILTER, COUNTS_DISTANCEFILTER_COMMENT ) ;
97  comments.put(DISTANCEFILTERCENTERNODE, COUNTS_DISTANCEFILTERCENTERNODE_COMMENT ) ;
98  comments.put(COUNTSINPUTFILENAME, COUNTSINPUTFILENAME_COMMENT ) ;
99  comments.put(COUNTSSCALEFACTOR, COUNTSSCALEFACTOR_COMMENT ) ;
100  comments.put(WRITECOUNTSINTERVAL, "Specifies how often the counts comparison should be calculated and written.");
101  comments.put(AVERAGECOUNTSOVERITERATIONS, "Specifies over how many iterations the link volumes should be averaged that are used for the " +
102  "counts comparison. Use 1 or 0 to only use the link volumes of a single iteration. This values cannot be larger than the value specified for " + WRITECOUNTSINTERVAL);
103  comments.put(ANALYZEDMODES, "Transport modes that will be respected for the counts comparison. 'car' is default, which " +
104  "includes also bussed from the pt simulation module. Use this parameter in combination with 'filterModes' = true!");
105  comments.put(FILTERMODES, "If true, link counts from legs performed on modes not included in the 'analyzedModes' parameter are ignored.");
106 
107  comments.put( INPUT_CRS , "The Coordinates Reference System in which the coordinates are expressed in the input file." +
108  " At import, the coordinates will be converted to the coordinate system defined in \"global\", and will" +
109  "be converted back at export. If not specified, no conversion happens." );
110  return comments;
111  }
112 
113  @StringGetter( OUTPUTFORMAT )
114  public String getOutputFormat() {
115  return this.outputFormat;
116  }
117 
119  public void setOutputFormat(final String outputFormat) {
120  this.outputFormat = outputFormat;
121  }
122 
124  public Double getDistanceFilter() {
125  return this.distanceFilter;
126  }
127 
129  public void setDistanceFilter(final Double distanceFilter) {
131  }
132 
134  public String getDistanceFilterCenterNode() {
135  return this.distanceFilterCenterNode;
136  }
137 
141  }
142 
147  public String getCountsFileName() {
148  return this.inputFile;
149  }
150 
155  public void setInputFile(final String countsFileName) {
156  this.inputFile = countsFileName;
157  }
158 
159  public URL getCountsFileURL(URL context) {
160  return ConfigGroup.getInputFileURL(context, this.inputFile);
161  }
162 
164  public double getCountsScaleFactor() {
165  return this.countsScaleFactor;
166  }
167 
169  public void setCountsScaleFactor(final double countsScaleFactor) {
171  }
172 
174  public int getWriteCountsInterval() {
175  return writeCountsInterval;
176  }
177 
181  }
182 
186  }
187 
191  }
192 
194  public boolean isFilterModes() {
195  return this.filterModes;
196  }
197 
199  public void setFilterModes(final boolean filterModes) {
200  this.filterModes = filterModes;
201  }
202 
204  public String getAnalyzedModes() {
205  return this.analyzedModes;
206  }
207 
209  public void setAnalyzedModes(final String analyzedModes) {
210  this.analyzedModes = analyzedModes.toLowerCase(Locale.ROOT);
211  }
212 
216  @Deprecated // set directly in file.
218  public String getInputCRS() {
219  return inputCRS;
220  }
221 
225  @Deprecated // set directly in file.
227  public void setInputCRS(String inputCRS) {
228  this.inputCRS = inputCRS;
229  }
230 
231 }
void setDistanceFilterCenterNode(final String distanceFilterCenterNode)
void setAverageCountsOverIterations(int averageCountsOverIterations)
void setDistanceFilter(final Double distanceFilter)
void setCountsScaleFactor(final double countsScaleFactor)
void setInputFile(final String countsFileName)
static URL getInputFileURL(URL context, String filename)
void setWriteCountsInterval(int writeCountsInterval)
void setAnalyzedModes(final String analyzedModes)