21 package org.matsim.core.config.groups;
23 import org.apache.logging.log4j.LogManager;
24 import org.apache.logging.log4j.Logger;
52 this.fileEnding = fileEnding;
67 private static final String
RUNID =
"runId";
69 static final String EVENTS_FILE_FORMAT =
"eventsFileFormat";
81 static final String MOBSIM =
"mobsim";
118 Map<String,String> map = super.getComments();
119 map.put(ROUTINGALGORITHM_TYPE,
"The type of routing (least cost path) algorithm used, may have the values: " + Arrays.toString(
RoutingAlgorithmType.values()));
120 map.put(RUNID,
"An identifier for the current run which is used as prefix for output files and mentioned in output xml files etc.");
122 "Multiple values can be specified separated by commas (',').");
123 map.put(WRITE_EVENTS_INTERVAL,
"iterationNumber % writeEventsInterval == 0 defines in which iterations events are written " +
124 "to a file. `0' disables events writing completely.");
125 map.put(WRITE_TRIPS_INTERVAL,
"iterationNumber % writeEventsInterval == 0 defines in which iterations trips CSV are written " +
126 "to a file. `0' disables trips writing completely.");
127 map.put(WRITE_PLANS_INTERVAL,
"iterationNumber % writePlansInterval == 0 defines (hopefully) in which iterations plans are " +
128 "written to a file. `0' disables plans writing completely. Some plans in early iterations are always written");
129 map.put(LINKTOLINK_ROUTING_ENABLED,
"Default=false. If enabled, the router takes travel times needed for turning moves into account." 130 +
" Can only be used with Dijkstra routing. Cannot be used when TravelTimeCalculator.separateModes is enabled.");
131 map.put(FIRST_ITERATION,
"Default=0. First Iteration of a simulation.");
132 map.put(LAST_ITERATION,
"Default=1000. Last Iteration of a simulation.");
134 map.put(CREATE_GRAPHS,
"Sets whether graphs showing some analyses should automatically be generated during the simulation." +
135 " The generation of graphs usually takes a small amount of time that does not have any weight in big simulations," +
136 " but add a significant overhead in smaller runs or in test cases where the graphical output is not even requested." );
137 map.put(COMPRESSION_TYPE,
"Compression algorithm to use when writing out data to files. Possible values: " + Arrays.toString(
CompressionType.values()));
138 map.put(EVENT_TYPE_TO_CREATE_SCORING_FUNCTIONS,
"Defines when the scoring functions for the population are created. Default=IterationStarts. Possible values: " + Arrays.toString(
EventTypeToCreateScoringFunctions.values()));
140 map.put(MOBSIM,
"Defines which mobility simulation will be used. Currently supported: " + Arrays.toString(
MobsimType.values()) +
IOUtils.
NATIVE_NEWLINE +
"\t\t" +
141 "Depending on the chosen mobsim, you'll have to add additional config modules to configure the corresponding mobsim." +
IOUtils.
NATIVE_NEWLINE +
"\t\t" +
142 "For 'qsim', add a module 'qsim' to the config.");
144 map.put(SNAPSHOT_FORMAT,
"Comma-separated list of visualizer output file formats. `transims' and `otfvis'.");
145 map.put(WRITE_SNAPSHOTS_INTERVAL,
"iterationNumber % " + WRITE_SNAPSHOTS_INTERVAL +
" == 0 defines in which iterations snapshots are written " +
146 "to a file. `0' disables snapshots writing completely");
147 map.put(DUMP_DATA_AT_END,
"true if at the end of a run, plans, network, config etc should be dumped to a file");
148 map.put(CLEAN_ITERS_AT_END,
"Defines what should be done with the ITERS directory when a simulation finished successfully");
223 if (runid.equals(
"")) {
224 log.info(
"No run Id provided. Setting run Id to null.");
245 boolean isFirst =
true;
246 StringBuilder str =
new StringBuilder();
251 str.append(format.toString());
254 return str.toString();
261 for (String part : parts) {
262 String trimmed = part.trim();
263 if (trimmed.length() > 0) {
275 this.eventsFileFormats = Collections.unmodifiableSet(EnumSet.copyOf(eventsFileFormats));
284 Set<SnapshotFormat> formats = EnumSet.noneOf(
SnapshotFormat.class );
285 for (String part : parts) {
286 String trimmed = part.trim();
287 if (trimmed.length() > 0) {
296 boolean isFirst =
true;
297 StringBuilder str =
new StringBuilder();
302 str.append(format.name());
305 return str.toString();
309 this.snapshotFormat = Collections.unmodifiableSet(EnumSet.copyOf( snapshotFormat) );
416 int writePlansUntilIteration = 1 ;
418 return this.writePlansUntilIteration ;
421 this.writePlansUntilIteration = val ;
424 int writeEventsUntilIteration = 0 ;
426 return this.writeEventsUntilIteration ;
429 this.writeEventsUntilIteration = val ;
435 log.warn(
"this is not recommended, as it might result in a directory containing output from several model runs" );
Collection< SnapshotFormat > getSnapshotFormat()
CompressionType compressionType
void setOverwriteFileSetting(final OverwriteFileSetting overwriteFileSetting)
static final String OUTPUT_DIRECTORY
RoutingAlgorithmType routingAlgorithmType
void setCleanItersAtEnd(CleanIterations cleanItersAtEnd)
Set< SnapshotFormat > snapshotFormat
void setSnapshotFormat(final Collection< SnapshotFormat > snapshotFormat)
static final String WRITE_PLANS_INTERVAL
EventTypeToCreateScoringFunctions getEventTypeToCreateScoringFunctions()
static final String NATIVE_NEWLINE
void checkConsistency(Config config)
static final String GROUP_NAME
int getWriteEventsInterval()
String getEventsFileFormatAsString()
static final String OVERWRITE_FILE
void setDumpDataAtEnd(boolean dumpDataAtEnd)
static final String LAST_ITERATION
final Map< String, String > getComments()
CompressionType(String fileEnding)
void setWritePlansInterval(final int writePlansInterval)
void setRoutingAlgorithmType(final RoutingAlgorithmType type)
static final String ROUTINGALGORITHM_TYPE
static final String RUNID
void setCreateGraphs(boolean createGraphs)
boolean isLinkToLinkRoutingEnabled()
EventTypeToCreateScoringFunctions eventTypeToCreateScoringFunctions
static final String LINKTOLINK_ROUTING_ENABLED
OverwriteFileSetting getOverwriteFileSetting()
static String [] explode(final String str, final char delimiter, final int limit)
void setWriteEventsInterval(final int writeEventsInterval)
int getWriteSnapshotsInterval()
Set< EventsFileFormat > getEventsFileFormats()
OverwriteFileSetting overwriteFileSetting
void setSnapshotFormats(final String value)
void setEventFileFormats(final String value)
String getSnapshotFormatAsString()
void setLastIteration(final int lastIteration)
CleanIterations getCleanItersAtEnd()
boolean linkToLinkRoutingEnabled
static final String SNAPSHOT_FORMAT
int writeSnapshotsInterval
CompressionType getCompressionType()
void setCompressionType(CompressionType type)
void setEventsFileFormats(final Set< EventsFileFormat > eventsFileFormats)
int getWritePlansInterval()
final ControlerConfigGroup controler()
int getWriteTripsInterval()
void setLinkToLinkRoutingEnabled(final boolean enabled)
void setEventTypeToCreateScoringFunctions(EventTypeToCreateScoringFunctions eventTypeToCreateScoringFunctions)
Set< EventsFileFormat > eventsFileFormats
static final String DUMP_DATA_AT_END
static final String CLEAN_ITERS_AT_END
void setWriteEventsUntilIteration(int val)
void setFirstIteration(final int firstIteration)
void setMobsim(final String mobsim)
static final String COMPRESSION_TYPE
static final String CREATE_GRAPHS
static final String WRITE_TRIPS_INTERVAL
int getWritePlansUntilIteration()
static final String FIRST_ITERATION
void setWriteSnapshotsInterval(int writeSnapshotsInterval)
void setWritePlansUntilIteration(int val)
String getOutputDirectory()
static final String EVENT_TYPE_TO_CREATE_SCORING_FUNCTIONS
void setRunId(final String runid)
static final String WRITE_EVENTS_INTERVAL
void setOutputDirectory(final String outputDirectory)
boolean getDumpDataAtEnd()
int getWriteEventsUntilIteration()
CleanIterations cleanItersAtEnd
void setWriteTripsInterval(int writeTripsInterval)
RoutingAlgorithmType getRoutingAlgorithmType()
static final String WRITE_SNAPSHOTS_INTERVAL