MATSIM
VspExperimentalConfigGroup.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * *
4  * *********************************************************************** *
5  * *
6  * copyright : (C) 2009 by the members listed in the COPYING, *
7  * LICENSE and WARRANTY file. *
8  * email : info at matsim dot org *
9  * *
10  * *********************************************************************** *
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * See also COPYING, LICENSE and WARRANTY file *
17  * *
18  * *********************************************************************** */
19 package org.matsim.core.config.groups;
20 
21 import java.util.Map;
22 
23 import org.apache.logging.log4j.LogManager;
24 import org.apache.logging.log4j.Logger;
25 import org.matsim.core.config.Config;
27 
34 
35  private final static Logger log = LogManager.getLogger(VspExperimentalConfigGroup.class);
36 
37  public static final String GROUP_NAME = "vspExperimental";
38 
39 
40 
41  // ---
42 
43 // private static final String INPUT_MZ05_FILE = "inputMZ05File";
44 // private String inputMZ05File = "";
45 
46  // ---
47 
48  private static final String WRITING_OUTPUT_EVENTS = "writingOutputEvents" ;
49  private boolean writingOutputEvents = true ;
50 
51  // ---
52 
54  super(GROUP_NAME);
55  }
56 
57  // ---
58  private static final String VSP_DEFAULTS_CHECKING_LEVEL = "vspDefaultsCheckingLevel" ;
59  public static enum VspDefaultsCheckingLevel { ignore, info, warn, abort }
60 
62  @StringGetter(VSP_DEFAULTS_CHECKING_LEVEL)
65  }
66  @StringSetter(VSP_DEFAULTS_CHECKING_LEVEL)
67  public void setVspDefaultsCheckingLevel(VspDefaultsCheckingLevel vspDefaultsCheckingLevel) {
68  testForLocked() ;
69  this.vspDefaultsCheckingLevel = vspDefaultsCheckingLevel;
70  }
71  // ---
72  private static final String LOGIT_SCALE_PARAM_FOR_PLANS_REMOVAL = "logitScaleParamForPlansRemoval" ;
73  private double logitScaleParamForPlansRemoval = 1. ;
74  @StringGetter(LOGIT_SCALE_PARAM_FOR_PLANS_REMOVAL)
77  }
78  @StringSetter(LOGIT_SCALE_PARAM_FOR_PLANS_REMOVAL)
79  public void setLogitScaleParamForPlansRemoval(double logitScaleParamForPlansRemoval) {
80  testForLocked() ;
81  this.logitScaleParamForPlansRemoval = logitScaleParamForPlansRemoval;
82  }
83  // ---
84  private static final String GENERATING_BOARDING_DENIED_EVENT = "isGeneratingBoardingDeniedEvent" ; // seems to be singular.
85  private boolean isGeneratingBoardingDeniedEvent = false ; // default is that this event is NOT generated. kai, oct'12
86  @StringGetter(GENERATING_BOARDING_DENIED_EVENT)
89  }
90  @StringSetter(GENERATING_BOARDING_DENIED_EVENT)
91  public void setGeneratingBoardingDeniedEvent(boolean isGeneratingBoardingDeniedEvent) {
92  testForLocked() ;
93  this.isGeneratingBoardingDeniedEvent = isGeneratingBoardingDeniedEvent;
94  }
95  // ---
96  private static final String ABLE_TO_OVERWRITE_PT_INTERACTION_PARAMS = "isAbleToOverwritePtInteractionParams" ;
97  private boolean isAbleToOverwritePtInteractionParams = false ; // default is that this NOT allowed. kai, nov'12
101  }
104  testForLocked() ;
106  }
107  // ---
108  private static final String USING_OPPORTUNITY_COST_OF_TIME_FOR_LOCATION_CHOICE = "isUsingOpportunityCostOfTimeForLocationChoice" ;
113  }
116  testForLocked() ;
118  }
119  // ---
120  public enum CheckingOfMarginalUtilityOfTravellng { allZero, none }
121 
125  }
126  public void setCheckingOfMarginalUtilityOfTravellng( CheckingOfMarginalUtilityOfTravellng checkingOfMarginalUtilityOfTravellng ){
127  this.checkingOfMarginalUtilityOfTravellng = checkingOfMarginalUtilityOfTravellng;
128  }
129  // ---
130 
131 
132 
133  @Override
134  public Map<String, String> getComments() {
135  Map<String,String> map = super.getComments();
136 
137  map.put( ABLE_TO_OVERWRITE_PT_INTERACTION_PARAMS, "(do not use except of you have to) There was a problem with pt interaction scoring. Some people solved it by overwriting the " +
138  "parameters of the pt interaction activity type. Doing this now throws an Exception. If you still insist on doing this, " +
139  "set the following to true.") ;
140  map.put(USING_OPPORTUNITY_COST_OF_TIME_FOR_LOCATION_CHOICE, "if an approximation of the opportunity cost of time is included into the radius calculation for location choice." +
141  "`true' will be faster, but it is an approximation. Default is `true'; `false' is available for backwards compatibility.") ;
142 
143  map.put(WRITING_OUTPUT_EVENTS, "if true then writes output_events in output directory. default is `false'." +
144  " Will only work when lastIteration is multiple of events writing interval" ) ;
145 
146  StringBuilder options = new StringBuilder() ;
147  for ( VspDefaultsCheckingLevel option : VspDefaultsCheckingLevel.values() ) {
148  options.append(option + " | ") ;
149  }
151  "Options: | " + options + ". When violating VSP defaults, this results in " +
152  "nothing, logfile infos, logfile warnings, or aborts. Members of VSP should use `abort' or talk to kai.") ;
153 
154 // map.put(INPUT_MZ05_FILE, "(do not use) Set this filename of MZ05 daily analysis");
155 
156  return map;
157  }
158 // @StringGetter(INPUT_MZ05_FILE)
159 // public String getInputMZ05File() {
160 // return this.inputMZ05File;
161 // }
162 // @StringSetter(INPUT_MZ05_FILE)
163 // public void setInputMZ05File(final String inputMZ05File) {
164 // testForLocked() ;
165 // this.inputMZ05File = inputMZ05File;
166 // }
168  public boolean isWritingOutputEvents() {
169  return this.writingOutputEvents ;
170  }
173  testForLocked() ;
175  }
176 
177  @Override
178  protected void checkConsistency(Config config) {
179  }
180 
181 }
void setAbleToOverwritePtInteractionParams(boolean isAbleToOverwritePtInteractionParams)
void setCheckingOfMarginalUtilityOfTravellng(CheckingOfMarginalUtilityOfTravellng checkingOfMarginalUtilityOfTravellng)
void setLogitScaleParamForPlansRemoval(double logitScaleParamForPlansRemoval)
void setVspDefaultsCheckingLevel(VspDefaultsCheckingLevel vspDefaultsCheckingLevel)
CheckingOfMarginalUtilityOfTravellng getCheckingOfMarginalUtilityOfTravellng()
void setUsingOpportunityCostOfTimeForLocationChoice(boolean isUsingOpportunityCostOfTimeForLocationChoice)
void setGeneratingBoardingDeniedEvent(boolean isGeneratingBoardingDeniedEvent)