MATSIM
ConvertOldPlanCalcScoreConfigGroup.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * *
4  * *********************************************************************** *
5  * *
6  * copyright : (C) 2007 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 
20 package org.matsim.run;
21 
22 import java.util.Collection;
23 import java.util.HashMap;
24 import java.util.LinkedHashMap;
25 import java.util.Map;
26 
27 import org.apache.logging.log4j.LogManager;
28 import org.apache.logging.log4j.Logger;
31 import org.matsim.core.config.Config;
36 import org.matsim.core.gbl.Gbl;
38 import org.matsim.core.utils.misc.Time;
39 import org.matsim.pt.PtConstants;
40 
41 
43  public static void main( final String[] args ) {
44  final String inputConfig = args[ 0 ];
45  final String outputConfig = args[ 1 ];
46 
47  final Config config = new Config();
48 
49  config.addModule( new OldToNewPlanCalcScoreConfigGroup() );
50  new ConfigReader( config ).readFile( inputConfig );
51  new ConfigWriter( config ).write( outputConfig );
52  }
53 }
54 
55 final class OldToNewPlanCalcScoreConfigGroup extends ConfigGroup {
56 
57  private static final Logger log = LogManager.getLogger(OldToNewPlanCalcScoreConfigGroup.class);
58 
59  public static final String GROUP_NAME = "planCalcScore";
60 
61  private static final String LEARNING_RATE = "learningRate";
62  private static final String BRAIN_EXP_BETA = "BrainExpBeta";
63  private static final String PATH_SIZE_LOGIT_BETA = "PathSizeLogitBeta";
64  private static final String LATE_ARRIVAL = "lateArrival";
65  private static final String EARLY_DEPARTURE = "earlyDeparture";
66  private static final String PERFORMING = "performing";
67 
68  private static final String TRAVELING = "traveling_";
69  private static final String TRAVELING_CAR = "traveling";
70  private static final String TRAVELING_PT = "travelingPt";
71  private static final String TRAVELING_BIKE = "travelingBike";
72  private static final String TRAVELING_WALK = "travelingWalk";
73  private static final String TRAVELING_OTHER = "travelingOther";
74  private static final String WAITING = "waiting";
75  private static final String WAITING_PT = "waitingPt";
76 
77  private static final String CONSTANT = "constant_";
78  private static final String CONSTANT_CAR = "constantCar" ;
79  private static final String CONSTANT_BIKE = "constantBike" ;
80  private static final String CONSTANT_WALK = "constantWalk" ;
81  private static final String CONSTANT_OTHER = "constantOther" ;
82  private static final String CONSTANT_PT = "constantPt" ;
83 
84  private static final String WRITE_EXPERIENCED_PLANS = "writeExperiencedPlans";
85 
86  private static final String MARGINAL_UTL_OF_DISTANCE_CAR = "marginalUtlOfDistanceCar";
87 
88  private static final String MARGINAL_UTL_OF_DISTANCE_PT = "marginalUtlOfDistancePt";
89  private static final String MARGINAL_UTL_OF_DISTANCE = "marginalUtlOfDistance_";
90  private static final String MARGINAL_UTL_OF_DISTANCE_WALK = "marginalUtlOfDistanceWalk";
91  private static final String MARGINAL_UTL_OF_DISTANCE_OTHER = "marginalUtlOfDistanceOther";
92 
93  private static final String MARGINAL_UTL_OF_MONEY = "marginalUtilityOfMoney" ;
94 
95  @Deprecated
96  private static final String MONETARY_DISTANCE_COST_RATE = "monetaryDistanceCostRate";
97 
98  private static final String MONETARY_DISTANCE_RATE_ = "monetaryDistanceRate_" ;
99  private static final Object MONETARY_DISTANCE_RATE_CAR = "monetaryDistanceRateCar";
100  private static final Object MONETARY_DISTANCE_RATE_PT = "monetaryDistanceRatePt";
101 
102  private static final String UTL_OF_LINE_SWITCH = "utilityOfLineSwitch" ;
103 
104  private static final String ACTIVITY_TYPE = "activityType_";
105  private static final String ACTIVITY_PRIORITY = "activityPriority_";
106  private static final String ACTIVITY_TYPICAL_DURATION = "activityTypicalDuration_";
107  private static final String ACTIVITY_MINIMAL_DURATION = "activityMinimalDuration_";
108  private static final String ACTIVITY_OPENING_TIME = "activityOpeningTime_";
109  private static final String ACTIVITY_LATEST_START_TIME = "activityLatestStartTime_";
110  private static final String ACTIVITY_EARLIEST_END_TIME = "activityEarliestEndTime_";
111  private static final String ACTIVITY_CLOSING_TIME = "activityClosingTime_";
112 
113  private static final String SCORING_THIS_ACTIVITY_AT_ALL = "scoringThisActivityAtAll_" ;
114 
115  private final ReflectiveDelegate delegate = new ReflectiveDelegate();
116  private final Map<String, ActivityParams> activityTypesByNumber = new HashMap< >();
117 
118  public OldToNewPlanCalcScoreConfigGroup() {
119  super(GROUP_NAME);
120 
121  this.addParameterSet( new ModeParams( TransportMode.car ) );
122  this.addParameterSet( new ModeParams( TransportMode.pt ) );
123  this.addParameterSet( new ModeParams( TransportMode.walk ) );
124  this.addParameterSet( new ModeParams( TransportMode.bike ) );
125  this.addParameterSet( new ModeParams( TransportMode.other ) );
126  }
127 
128 
129  private Double waitingPt = null ; // if not actively set by user, it will later be set to "travelingPt".
130 
131  // ---
132 
133  private static final String USING_OLD_SCORING_BELOW_ZERO_UTILITY_DURATION = "usingOldScoringBelowZeroUtilityDuration" ;
134 
138  private boolean memorizingExperiencedPlans = false ;
139 
143  public static final String EXPERIENCED_PLAN_KEY = "experiencedPlan";
144 
145  // ---
146  private static final String FRACTION_OF_ITERATIONS_TO_START_SCORE_MSA = "fractionOfIterationsToStartScoreMSA" ;
147  // ---
148 
149  @Override
150  public String getValue(final String key) {
151  throw new IllegalArgumentException(key + ": getValue access disabled; use direct getter");
152  }
153 
154  @Override
155  public void addParam(final String key, final String value) {
156  // backward compatibility: underscored
157  if (key.startsWith(ACTIVITY_TYPE)) {
158  ActivityParams actParams = getActivityTypeByNumber(key.substring(ACTIVITY_TYPE.length()), true);
159 
160  actParams.setActivityType(value);
161  this.removeParameterSet( actParams );
162  addActivityParams( actParams );
163  }
164  else if (key.startsWith(ACTIVITY_PRIORITY)) {
165  ActivityParams actParams = getActivityTypeByNumber(key.substring(ACTIVITY_PRIORITY.length()), true);
166  actParams.setPriority(Double.parseDouble(value));
167  }
168  else if (key.startsWith(ACTIVITY_TYPICAL_DURATION)) {
169  ActivityParams actParams = getActivityTypeByNumber(key.substring(ACTIVITY_TYPICAL_DURATION.length()), true);
170  actParams.setTypicalDuration(Time.parseTime(value));
171  }
172  else if (key.startsWith(ACTIVITY_MINIMAL_DURATION)) {
173  ActivityParams actParams = getActivityTypeByNumber(key.substring(ACTIVITY_MINIMAL_DURATION.length()), true);
174  actParams.setMinimalDuration(Time.parseTime(value));
175  }
176  else if (key.startsWith(ACTIVITY_OPENING_TIME)) {
177  ActivityParams actParams = getActivityTypeByNumber(key.substring(ACTIVITY_OPENING_TIME.length()), true);
178  actParams.setOpeningTime(Time.parseTime(value));
179  }
180  else if (key.startsWith(ACTIVITY_LATEST_START_TIME)) {
181  ActivityParams actParams = getActivityTypeByNumber(key.substring(ACTIVITY_LATEST_START_TIME.length()), true);
182  actParams.setLatestStartTime(Time.parseTime(value));
183  }
184  else if (key.startsWith(ACTIVITY_EARLIEST_END_TIME)) {
185  ActivityParams actParams = getActivityTypeByNumber(key.substring(ACTIVITY_EARLIEST_END_TIME.length()), true);
186  actParams.setEarliestEndTime(Time.parseTime(value));
187  }
188  else if (key.startsWith(ACTIVITY_CLOSING_TIME)) {
189  ActivityParams actParams = getActivityTypeByNumber(key.substring(ACTIVITY_CLOSING_TIME.length()), true);
190  actParams.setClosingTime(Time.parseTime(value));
191  }
192  else if (key.startsWith(SCORING_THIS_ACTIVITY_AT_ALL)) {
193  ActivityParams actParams = getActivityTypeByNumber(key.substring(SCORING_THIS_ACTIVITY_AT_ALL.length()), true);
194  actParams.setScoringThisActivityAtAll( Boolean.parseBoolean(value) );
195  }
196  else if (key.startsWith(TRAVELING)) {
197  ModeParams modeParams = getOrCreateModeParams(key.substring(TRAVELING.length()));
198  modeParams.setMarginalUtilityOfTraveling(Double.parseDouble(value));
199  }
200  else if (key.startsWith(MARGINAL_UTL_OF_DISTANCE)) {
201  ModeParams modeParams = getOrCreateModeParams(key.substring(MARGINAL_UTL_OF_DISTANCE.length()));
202  modeParams.setMarginalUtilityOfDistance(Double.parseDouble(value));
203  }
204  else if (key.startsWith(MONETARY_DISTANCE_COST_RATE)) {
205  throw new RuntimeException("Please use monetaryDistanceRate (without `cost'). Even better, use config v2, "
206  + "mode-parameters (see output of any recent run), and mode-specific monetary "
207  + "distance rate.") ;
208  }
209  else if (key.startsWith(MONETARY_DISTANCE_RATE_)) {
210  ModeParams modeParams = getOrCreateModeParams(key.substring(MONETARY_DISTANCE_RATE_.length()));
211  modeParams.setMonetaryDistanceRate(Double.parseDouble(value));
212  }
213  else if ( MONETARY_DISTANCE_RATE_CAR.equals(key) ){
214  ModeParams modeParams = getOrCreateModeParams( TransportMode.car ) ;
215  modeParams.setMonetaryDistanceRate(Double.parseDouble(value));
216  }
217  else if ( MONETARY_DISTANCE_RATE_PT.equals(key) ){
218  ModeParams modeParams = getOrCreateModeParams( TransportMode.pt ) ;
219  modeParams.setMonetaryDistanceRate(Double.parseDouble(value));
220  }
221  else if (key.startsWith(CONSTANT)) {
222  ModeParams modeParams = getOrCreateModeParams(key.substring(CONSTANT.length()));
223  modeParams.setConstant(Double.parseDouble(value));
224  }
225 
226  // backward compatibility: "typed" traveling
227  else if (TRAVELING_CAR.equals(key)) {
228  setTraveling_utils_hr(Double.parseDouble(value));
229  }
230  else if (TRAVELING_PT.equals(key)) {
231  setTravelingPt_utils_hr(Double.parseDouble(value));
232  }
233  else if (TRAVELING_WALK.equals(key)) {
234  setTravelingWalk_utils_hr(Double.parseDouble(value));
235  }
236  else if (TRAVELING_OTHER.equals(key)) {
237  setTravelingOther_utils_hr(Double.parseDouble(value));
238  }
239  else if (TRAVELING_BIKE.equals(key)) {
240  setTravelingBike_utils_hr(Double.parseDouble(value));
241  }
242 
243  // backward compatibility: "typed" util of distance
244  else if (MARGINAL_UTL_OF_DISTANCE_CAR.equals(key)){
245  setMarginalUtlOfDistanceCar(Double.parseDouble(value));
246  }
247  else if (MARGINAL_UTL_OF_DISTANCE_PT.equals(key)){
248  setMarginalUtlOfDistancePt(Double.parseDouble(value));
249  }
250  else if (MARGINAL_UTL_OF_DISTANCE_WALK.equals(key)){
251  setMarginalUtlOfDistanceWalk(Double.parseDouble(value));
252  }
253  else if (MARGINAL_UTL_OF_DISTANCE_OTHER.equals(key)){
254  setMarginalUtlOfDistanceOther(Double.parseDouble(value));
255  }
256 
257  // backward compatibility: "typed" constants
258  else if ( CONSTANT_CAR.equals(key)) {
259  this.setConstantCar(Double.parseDouble(value)) ;
260  }
261  else if ( CONSTANT_WALK.equals(key)) {
262  this.setConstantWalk(Double.parseDouble(value)) ;
263  }
264  else if ( CONSTANT_OTHER.equals(key)) {
265  this.setConstantOther(Double.parseDouble(value)) ;
266  }
267  else if ( CONSTANT_PT.equals(key)) {
268  this.setConstantPt(Double.parseDouble(value)) ;
269  }
270  else if ( CONSTANT_BIKE.equals(key)) {
271  this.setConstantBike(Double.parseDouble(value)) ;
272  }
273 
274  else if ( WAITING_PT.equals( key ) ) {
275  setMarginalUtlOfWaitingPt_utils_hr( Double.parseDouble( value ) );
276  }
277 
278  else {
279  delegate.addParam( key , value );
280  }
281  }
282 
283  public ModeParams getOrCreateModeParams(String modeName) {
284  ModeParams modeParams = getModes().get(modeName);
285  if (modeParams == null) {
286  modeParams = new ModeParams( modeName );
287  addParameterSet( modeParams );
288  }
289  return modeParams;
290  }
291 
292  @Override
293  public Map<String, String> getParams() {
294  final Map<String, String> params = delegate.getParams();
295  if ( waitingPt != null ) {
296  params.put( WAITING_PT , waitingPt.toString() );
297  }
298  return params;
299  }
300 
301  @Override
302  public final Map<String, String> getComments() {
303  Map<String,String> map = super.getComments();
304  map.put(FRACTION_OF_ITERATIONS_TO_START_SCORE_MSA, "fraction of iterations at which MSA score averaging is started. The matsim theory department " +
305  "suggests to use this together with switching off choice set innovation (where a similar switch exists), but it has not been tested yet.") ;
306  map.put(USING_OLD_SCORING_BELOW_ZERO_UTILITY_DURATION, "There used to be a plateau between duration=0 and duration=zeroUtilityDuration. "
307  + "This caused durations to evolve to zero once they were below zeroUtilityDuration, causing problems. Only use this switch if you need to be "
308  + "backwards compatible with some old results. (changed nov'13)") ;
309  map.put(PERFORMING,"[utils/hr] marginal utility of doing an activity. normally positive. also the opportunity cost of " +
310  "time if agent is doing nothing. MATSim separates the resource value of time from the direct (dis)utility of travel time, see, e.g., "
311  + "Boerjesson and Eliasson, TR-A 59 (2014) 144-158.");
312  map.put(LATE_ARRIVAL, "[utils/hr] utility for arriving late (i.e. after the latest start time). normally negative") ;
313  map.put(EARLY_DEPARTURE, "[utils/hr] utility for departing early (i.e. before the earliest end time). Normally negative. Probably " +
314  "implemented correctly, but not tested." );
315  map.put(WAITING, "[utils/hr] additional marginal utility for waiting. normally negative. this comes on top of the opportunity cost of time. Probably " +
316  "implemented correctly, but not tested.") ;
317  map.put(WAITING_PT, "[utils/hr] additional marginal utility for waiting for a pt vehicle. normally negative. this comes on top of the opportunity cost " +
318  "of time. Default: if not set explicitly, it is equal to traveling_pt!!!" ) ;
319  map.put(BRAIN_EXP_BETA, "logit model scale parameter. default: 1. Has name and default value for historical reasons " +
320  "(see Bryan Raney's phd thesis).") ;
321  map.put(LEARNING_RATE, "new_score = (1-learningRate)*old_score + learningRate * score_from_mobsim. learning rates " +
322  "close to zero emulate score averaging, but slow down initial convergence") ;
323  map.put(UTL_OF_LINE_SWITCH, "[utils] utility of switching a line (= transfer penalty). Normally negative") ;
324  map.put(MARGINAL_UTL_OF_MONEY, "[utils/unit_of_money] conversion of money (e.g. toll, distance cost) into utils. Normall positive (i.e. toll/cost/fare are processed as negative amounts of money)." ) ;
325  map.put(WRITE_EXPERIENCED_PLANS, "write a plans file in each iteration directory which contains what each agent actually did, and the score it received.");
326 
327  return map;
328  }
329 
330  private ActivityParams getActivityTypeByNumber(final String number, final boolean createIfMissing) {
331  ActivityParams actType = this.activityTypesByNumber.get(number);
332  if ((actType == null) && createIfMissing) {
333  // not sure what this means, but I found it so...
334  // TD, sep'14
335  actType = new ActivityParams(number);
336  this.activityTypesByNumber.put(number, actType);
337  addParameterSet( actType );
338  }
339  return actType;
340  }
341 
342  public Collection<String> getActivityTypes() {
343  return this.getActivityParamsPerType().keySet();
344  }
345 
346  public Collection<ActivityParams> getActivityParams() {
347  Collection<ActivityParams> collection = (Collection<ActivityParams>) getParameterSets( ActivityParams.SET_TYPE );
348  for ( ActivityParams params : collection ) {
349  if ( this.isLocked() ) {
350  params.setLocked();
351  }
352  }
353  return collection ;
354  }
355 
356  public Map<String, ActivityParams> getActivityParamsPerType() {
357  final Map<String, ActivityParams> map = new LinkedHashMap< >();
358 
359  for ( ActivityParams pars : getActivityParams() ) {
360  map.put( pars.getActivityType() , pars );
361  }
362 
363  return map;
364  }
365 
366  public Map<String, ModeParams> getModes() {
367  final Collection<ModeParams> modes = (Collection<ModeParams>) getParameterSets( ModeParams.SET_TYPE );
368  final Map<String, ModeParams> map = new LinkedHashMap< >();
369 
370  for ( ModeParams pars : modes ) {
371  if ( this.isLocked() ) {
372  pars.setLocked();
373  }
374  map.put( pars.getMode() , pars );
375  }
376 
377  return map;
378  }
379 
380 
384  @Override
385  public void checkConsistency(Config config) {
386  super.checkConsistency(config);
387  boolean hasOpeningAndClosingTime = false;
388  boolean hasOpeningTimeAndLatePenalty = false ;
389 
390  // This cannot be done in ActivityParams (where it would make more sense),
391  // because some global properties are also checked
392  for ( ActivityParams actType : this.getActivityParams() ) {
393  if ( actType.isScoringThisActivityAtAll() ) {
394  // (checking consistency only if activity is scored at all)
395 
396  if (actType.getOpeningTime().isDefined() && actType.getClosingTime().isDefined()) {
397  hasOpeningAndClosingTime = true;
398 
399  if (actType.getOpeningTime().seconds() == 0. && actType.getClosingTime().seconds() > 24. * 3600 - 1) {
400  log.error("it looks like you have an activity type with opening time set to 0:00 and closing "
401  + "time set to 24:00. This is most probably not the same as not setting them at all. "
402  + "In particular, activities which extend past midnight may not accumulate scores.");
403  }
404 
405  }
406  if (actType.getOpeningTime().isDefined() && (getLateArrival_utils_hr() < -0.001)) {
407  hasOpeningTimeAndLatePenalty = true;
408  }
409  }
410  }
411  if (!hasOpeningAndClosingTime && !hasOpeningTimeAndLatePenalty) {
412  log.info("NO OPENING OR CLOSING TIMES DEFINED!\n\n\n"
413  +"There is no activity type that has an opening *and* closing time (or opening time and late penalty) defined.\n"
414  +"This usually means that the activity chains can be shifted by an arbitrary\n"
415  +"number of hours without having an effect on the score of the plans, and thus\n"
416  +"resulting in wrong results / traffic patterns.\n"
417  +"If you are using MATSim without time adaptation, you can ignore this warning.\n\n\n");
418  }
419  if ( this.getMarginalUtlOfWaiting_utils_hr() != 0.0 ) {
420  log.warn( "marginal utl of wait set to: " + this.getMarginalUtlOfWaiting_utils_hr() + ". Setting this different from zero is " +
421  "discouraged. The parameter was also abused for pt routing; if you did that, consider setting the new " +
422  "parameter waitingPt instead.");
423  }
424  }
425 
426  /* direct access */
427 
428  public double getMarginalUtlOfWaitingPt_utils_hr() {
429  return this.waitingPt == null ?
430  this.getModes().get(TransportMode.pt).getMarginalUtilityOfTraveling() :
431  this.waitingPt ;
432  }
433 
434  public double getTraveling_utils_hr() {
435  return this.getModes().get(TransportMode.car).getMarginalUtilityOfTraveling();
436  }
437  public void setTraveling_utils_hr(final double traveling) {
438  this.getModes().get(TransportMode.car).setMarginalUtilityOfTraveling(traveling);
439  }
440 
441  public double getTravelingPt_utils_hr() {
442  return this.getModes().get(TransportMode.pt).getMarginalUtilityOfTraveling();
443  }
444  public void setTravelingPt_utils_hr(final double travelingPt) {
445  this.getModes().get(TransportMode.pt).setMarginalUtilityOfTraveling(travelingPt);
446  }
447 
448  public double getTravelingBike_utils_hr() {
449  return this.getModes().get(TransportMode.bike).getMarginalUtilityOfTraveling();
450  }
451  public void setTravelingBike_utils_hr(final double travelingBike) {
452  this.getModes().get(TransportMode.bike).setMarginalUtilityOfTraveling(travelingBike);
453  }
454 
455  public double getTravelingWalk_utils_hr() {
456  return this.getModes().get(TransportMode.walk).getMarginalUtilityOfTraveling();
457  }
458  public void setTravelingWalk_utils_hr(final double travelingWalk) {
459  this.getModes().get(TransportMode.walk).setMarginalUtilityOfTraveling(travelingWalk);
460  }
466  public double getMarginalUtlOfDistanceWalk() {
467  return this.getModes().get(TransportMode.walk).getMarginalUtilityOfDistance();
468  }
474  public void setMarginalUtlOfDistanceWalk(final double marginalUtlOfDistanceWalk) {
475  this.getModes().get(TransportMode.walk).setMarginalUtilityOfDistance(marginalUtlOfDistanceWalk);
476  }
477 
481  private void setMarginalUtlOfDistancePt(final double marginalUtlOfDistancePt) {
482  this.getModes().get(TransportMode.pt).setMarginalUtilityOfDistance(marginalUtlOfDistancePt);
483  }
484 
488  private void setMarginalUtlOfDistanceCar(final double marginalUtlOfDistanceCar) {
489  this.getModes().get(TransportMode.car).setMarginalUtilityOfDistance(marginalUtlOfDistanceCar);
490  }
491 
492 
493  public void setMarginalUtlOfWaitingPt_utils_hr(double val) {
494  this.waitingPt = val ;
495  }
496 
497  public ActivityParams getActivityParams(final String actType) {
498  return this.getActivityParamsPerType().get(actType);
499  }
500 
501  @Override
502  public void addParameterSet( final ConfigGroup set ) {
503  switch ( set.getName() ) {
504  case ActivityParams.SET_TYPE:
505  addActivityParams( (ActivityParams) set );
506  break;
507  case ModeParams.SET_TYPE:
508  addModeParams( (ModeParams) set );
509  break;
510  default:
511  throw new IllegalArgumentException( set.getName() );
512  }
513  }
514 
515  public void addModeParams(final ModeParams params) {
516  final ModeParams previous = this.getModes().get( params.getMode() );
517 
518  if ( previous != null ) {
519  log.info("mode parameters for mode " + previous.getMode() + " were just overwritten.") ;
520 
521  final boolean removed = removeParameterSet( previous );
522  if ( !removed ) throw new RuntimeException( "problem replacing mode params " );
523  }
524 
525  super.addParameterSet( params );
526  }
527 
528  public void addActivityParams(final ActivityParams params) {
529  final ActivityParams previous = this.getActivityParams( params.getActivityType() );
530 
531  if ( previous != null ) {
532  if ( previous.getActivityType().equals(PtConstants.TRANSIT_ACTIVITY_TYPE)) {
533  log.error("ERROR: Activity parameters for activity type " + previous.getActivityType() + " were just overwritten. This happens most " +
534  "likely because you defined them in the config file and the Controler overwrites them. Or the other way " +
535  "round. pt interaction has problems, but doing what you are doing here will just cause " +
536  "other (less visible) problem. Please take the effort to discuss with the core team " +
537  "what needs to be done. kai, nov'12") ;
538  } else {
539  log.info("activity parameters for activity type " + previous.getActivityType() + " were just overwritten.") ;
540  }
541 
542  final boolean removed = removeParameterSet( previous );
543  if ( !removed ) throw new RuntimeException( "problem replacing activity params " );
544  }
545 
546  super.addParameterSet( params );
547  }
548 
549  public static enum TypicalDurationScoreComputation { uniform, relative }
550 
551  /* complex classes */
552  public static class ActivityParams extends ReflectiveConfigGroup implements MatsimParameters {
553  // in normal pgm execution, code will presumably lock instance of PlanCalcScoreConfigGroup, but not instance of
554  // ActivityParams. I will try to pass the locked setting through the getters. kai, jun'15
555 
556  private static final String TYPICAL_DURATION_SCORE_COMPUTATION = "typicalDurationScoreComputation";
557  final static String SET_TYPE = "activityParams";
558  private String type;
559  private double priority = 1.0;
560  private OptionalTime typicalDuration = OptionalTime.undefined();
561  private OptionalTime minimalDuration = OptionalTime.undefined();
562  private OptionalTime openingTime = OptionalTime.undefined();
563  private OptionalTime latestStartTime = OptionalTime.undefined();
564  private OptionalTime earliestEndTime = OptionalTime.undefined();
565  private OptionalTime closingTime = OptionalTime.undefined();
566  private boolean scoringThisActivityAtAll = true ;
567 
568  private TypicalDurationScoreComputation typicalDurationScoreComputation = TypicalDurationScoreComputation.uniform ;
569 
570 
571  public ActivityParams() {
572  super( SET_TYPE );
573  }
574 
575  public ActivityParams(final String type) {
576  super( SET_TYPE );
577  this.type = type;
578  }
579 
580  @Override
581  public Map<String, String> getComments() {
582  final Map<String, String> map = super.getComments();
583  map.put( TYPICAL_DURATION_SCORE_COMPUTATION, "method to compute score at typical duration. Use "
584  + TypicalDurationScoreComputation.uniform + " for backwards compatibility (all activities same score; higher proba to drop long acts).") ;
585  return map ;
586  }
587 
588  @StringGetter(TYPICAL_DURATION_SCORE_COMPUTATION)
589  public TypicalDurationScoreComputation getTypicalDurationScoreComputation() {
590  return this.typicalDurationScoreComputation ;
591  }
592  @StringSetter(TYPICAL_DURATION_SCORE_COMPUTATION)
593  public void setTypicalDurationScoreComputation( TypicalDurationScoreComputation str ) {
594  testForLocked() ;
595  this.typicalDurationScoreComputation = str ;
596  }
597 
598  @StringGetter( "activityType" )
599  public String getActivityType() {
600  return this.type;
601  }
602 
603  @StringSetter( "activityType" )
604  public void setActivityType(final String type) {
605  testForLocked() ;
606  this.type = type;
607  }
608 
609  @StringGetter( "priority" )
610  public double getPriority() {
611  return this.priority;
612  }
613 
614  @StringSetter( "priority" )
615  public void setPriority(final double priority) {
616  testForLocked() ;
617  this.priority = priority;
618  }
619 
620  @StringGetter( "typicalDuration" )
621  private String getTypicalDurationString() {
622  return Time.writeTime( getTypicalDuration() );
623  }
624 
626  return this.typicalDuration;
627  }
628 
629  @StringSetter( "typicalDuration" )
630  private void setTypicalDuration(final String typicalDuration) {
631  testForLocked() ;
632  setTypicalDuration( Time.parseTime( typicalDuration ) );
633  }
634 
635  public void setTypicalDuration(final double typicalDuration) {
636  testForLocked() ;
637  this.typicalDuration = OptionalTime.defined(typicalDuration);
638  }
639 
640  @StringGetter( "minimalDuration" )
641  private String getMinimalDurationString() {
642  return Time.writeTime( getMinimalDuration() );
643  }
644 
646  return this.minimalDuration;
647  }
648 
649  @StringSetter( "minimalDuration" )
650  private void setMinimalDuration(final String minimalDuration) {
651  testForLocked() ;
652  setMinimalDuration( Time.parseTime( minimalDuration ) );
653  }
654 
655  private static int minDurCnt=0 ;
656  public void setMinimalDuration(final double minimalDuration) {
657  testForLocked() ;
658  this.minimalDuration = OptionalTime.defined(minimalDuration);
659  if (this.minimalDuration.isDefined() && minDurCnt < 1 ) {
660  minDurCnt++ ;
661  log.warn("Setting minimalDuration different from zero is discouraged. It is probably implemented correctly, " +
662  "but there is as of now no indication that it makes the results more realistic. KN, Sep'08" + Gbl.ONLYONCE );
663  }
664  }
665 
666  @StringGetter( "openingTime" )
667  private String getOpeningTimeString() {
668  return Time.writeTime( getOpeningTime() );
669  }
670 
672  return this.openingTime;
673  }
674  @StringSetter( "openingTime" )
675  private void setOpeningTime(final String openingTime) {
676  testForLocked() ;
677  setOpeningTime( Time.parseTime( openingTime ) );
678  }
679 
680  public void setOpeningTime(final double openingTime) {
681  testForLocked() ;
682  this.openingTime = OptionalTime.defined(openingTime);
683  }
684 
685  @StringGetter( "latestStartTime" )
686  private String getLatestStartTimeString() {
687  return Time.writeTime( getLatestStartTime() );
688  }
689 
691  return this.latestStartTime;
692  }
693  @StringSetter( "latestStartTime" )
694  private void setLatestStartTime(final String latestStartTime) {
695  testForLocked() ;
696  setLatestStartTime( Time.parseTime( latestStartTime ) );
697  }
698 
699  public void setLatestStartTime(final double latestStartTime) {
700  testForLocked() ;
701  this.latestStartTime = OptionalTime.defined(latestStartTime);
702  }
703 
704  @StringGetter( "earliestEndTime" )
705  private String getEarliestEndTimeString() {
706  return Time.writeTime( getEarliestEndTime() );
707  }
708 
710  return this.earliestEndTime;
711  }
712  @StringSetter( "earliestEndTime" )
713  private void setEarliestEndTime(final String earliestEndTime) {
714  testForLocked() ;
715  setEarliestEndTime( Time.parseTime( earliestEndTime ) );
716  }
717 
718  public void setEarliestEndTime(final double earliestEndTime) {
719  testForLocked() ;
720  this.earliestEndTime = OptionalTime.defined(earliestEndTime);
721  }
722 
723  @StringGetter( "closingTime" )
724  private String getClosingTimeString() {
725  return Time.writeTime( getClosingTime() );
726  }
727 
729  return this.closingTime;
730  }
731  @StringSetter( "closingTime" )
732  private void setClosingTime(final String closingTime) {
733  testForLocked() ;
734  setClosingTime( Time.parseTime( closingTime ) );
735  }
736 
737  public void setClosingTime(final double closingTime) {
738  testForLocked() ;
739  this.closingTime = OptionalTime.defined(closingTime);
740  }
741 
742  @StringGetter( "scoringThisActivityAtAll" )
743  public boolean isScoringThisActivityAtAll() {
744  return scoringThisActivityAtAll;
745  }
746 
747  @StringSetter( "scoringThisActivityAtAll" )
748  public void setScoringThisActivityAtAll(boolean scoringThisActivityAtAll) {
749  testForLocked() ;
750  this.scoringThisActivityAtAll = scoringThisActivityAtAll;
751  }
752  }
753 
754  public static class ModeParams extends ReflectiveConfigGroup implements MatsimParameters {
755  final static String SET_TYPE = "modeParams";
756 
757  private String mode = null;
758  private double traveling = -6.0;
759  private double distance = 0.0;
760  private double monetaryDistanceRate = 0.0;
761  private double constant = 0.0;
762 
763  public ModeParams(final String mode) {
764  super( SET_TYPE );
765  setMode( mode );
766  }
767 
768  ModeParams() {
769  super( SET_TYPE );
770  }
771 
772  @Override
773  public Map<String, String> getComments() {
774  final Map<String, String> map = super.getComments();
775  map.put( "marginalUtilityOfTraveling_util_hr", "[utils/hr] additional marginal utility of traveling. normally negative. this comes on top " +
776  "of the opportunity cost of time");
777  map.put( "marginalUtilityOfDistance_util_m", "[utils/m] utility of walking per m, normally negative. this is " +
778  "on top of the time (dis)utility.") ;
779  map.put("monetaryDistanceCostRate", "[unit_of_money/m] conversion of distance into money. Probably needs to be negative to work." ) ;
780  map.put("constant", "[utils] alternative-specific constant. no guarantee that this is used anywhere. " +
781  "default=0 to be backwards compatible for the time being" ) ;
782  return map;
783  }
784 
785  @StringSetter( "mode" )
786  public void setMode( final String mode ) {
787  testForLocked() ;
788  this.mode = mode;
789  }
790 
791  @StringGetter( "mode" )
792  public String getMode() {
793  return mode;
794  }
795 
796  @StringSetter( "marginalUtilityOfTraveling_util_hr" )
797  public void setMarginalUtilityOfTraveling(double traveling) {
798  testForLocked() ;
799  this.traveling = traveling;
800  }
801 
802  @StringGetter( "marginalUtilityOfTraveling_util_hr" )
803  public double getMarginalUtilityOfTraveling() {
804  return this.traveling;
805  }
806 
807  @StringGetter( "marginalUtilityOfDistance_util_m" )
808  public double getMarginalUtilityOfDistance() {
809  return distance;
810  }
811 
812  @StringSetter( "marginalUtilityOfDistance_util_m" )
813  public void setMarginalUtilityOfDistance(double distance) {
814  testForLocked() ;
815  this.distance = distance;
816  }
817 
818  @StringGetter( "constant" )
819  public double getConstant() {
820  return this.constant;
821  }
822 
823  @StringSetter( "constant" )
824  public void setConstant(double constant) {
825  testForLocked() ;
826  this.constant = constant;
827  }
828 
829  @StringGetter( "monetaryDistanceRate" )
830  public double getMonetaryDistanceRate() {
831  return this.monetaryDistanceRate;
832  }
833 
834  @StringSetter( "monetaryDistanceRate" )
835  public void setMonetaryDistanceRate(double monetaryDistanceRate) {
836  testForLocked() ;
837  this.monetaryDistanceRate = monetaryDistanceRate;
838  }
839 
840  }
841 
842  /* parameter set handling */
843  @Override
844  public ConfigGroup createParameterSet(final String type) {
845  switch ( type ) {
846  case ActivityParams.SET_TYPE:
847  return new ActivityParams();
848  case ModeParams.SET_TYPE:
849  return new ModeParams();
850  default:
851  throw new IllegalArgumentException( type );
852  }
853  }
854 
855  @Override
856  protected void checkParameterSet( final ConfigGroup module ) {
857  switch ( module.getName() ) {
858  case ActivityParams.SET_TYPE:
859  if ( !(module instanceof ActivityParams) ) {
860  throw new RuntimeException( "wrong class for "+module );
861  }
862  final String t = ((ActivityParams) module).getActivityType();
863  if ( getActivityParams( t ) != null ) {
864  throw new IllegalStateException( "already a parameter set for activity type "+t );
865  }
866  break;
867  case ModeParams.SET_TYPE:
868  if ( !(module instanceof ModeParams) ) {
869  throw new RuntimeException( "wrong class for "+module );
870  }
871  final String m = ((ModeParams) module).getMode();
872  if ( getModes().get( m ) != null ) {
873  throw new IllegalStateException( "already a parameter set for mode "+m );
874  }
875  break;
876  default:
877  throw new IllegalArgumentException( module.getName() );
878  }
879  }
880 
881  @Deprecated // use ModeParams (getModes().get...) directly
882  public double getMonetaryDistanceRateCar() {
883  return this.getModes().get(TransportMode.car).getMonetaryDistanceRate();
884  }
885  @Deprecated // use ModeParams (getModes().get...) directly
886  public void setMonetaryDistanceRateCar(double monetaryDistanceRateCar) {
887  this.getModes().get(TransportMode.car).setMonetaryDistanceRate(monetaryDistanceRateCar);
888  }
889  @Deprecated // use ModeParams (getModes().get...) directly
890  public double getMonetaryDistanceRatePt() {
891  return this.getModes().get(TransportMode.pt).getMonetaryDistanceRate();
892  }
893 
894  @Deprecated // use ModeParams (getModes().get...) directly
895  public void setMonetaryDistanceRatePt(double monetaryDistanceRatePt) {
896  this.getModes().get(TransportMode.pt).setMonetaryDistanceRate(monetaryDistanceRatePt);
897  }
898 
899 
900  @Deprecated // use ModeParams (getModes().get...) directly
901  public double getConstantCar() {
902  return getModes().get(TransportMode.car).getConstant();
903  }
904 
905 
906  @Deprecated // use ModeParams (getModes().get...) directly
907  public void setConstantCar(double constantCar) {
908  getModes().get(TransportMode.car).setConstant(constantCar);
909  }
910 
911 
912  @Deprecated // use ModeParams (getModes().get...) directly
913  public double getConstantWalk() {
914  return getModes().get(TransportMode.walk).getConstant();
915  }
916 
917 
918  @Deprecated // use ModeParams (getModes().get...) directly
919  public void setConstantWalk(double constantWalk) {
920  getModes().get(TransportMode.walk).setConstant(constantWalk);
921  }
922 
923 
924  @Deprecated // use ModeParams (getModes().get...) directly
925  public double getConstantPt() {
926  return getModes().get(TransportMode.pt).getConstant();
927  }
928 
929 
930  @Deprecated // use ModeParams (getModes().get...) directly
931  public void setConstantPt(double constantPt) {
932  getModes().get(TransportMode.pt).setConstant(constantPt);
933  }
934 
935 
936  @Deprecated // use ModeParams (getModes().get...) directly
937  public double getConstantBike() {
938  return getModes().get(TransportMode.bike).getConstant();
939  }
940 
941 
942  @Deprecated // use ModeParams (getModes().get...) directly
943  public void setConstantBike(double constantBike) {
944  getModes().get(TransportMode.bike).setConstant(constantBike);
945  }
946 
947 
948  @Deprecated // use ModeParams (getModes().get...) directly
949  public double getTravelingOther_utils_hr() {
950  return getModes().get(TransportMode.other).getMarginalUtilityOfTraveling();
951  }
952 
953 
954  @Deprecated // use ModeParams (getModes().get...) directly
955  public double getConstantOther() {
956  return getModes().get(TransportMode.other).getConstant();
957  }
958 
959 
960  @Deprecated // use ModeParams (getModes().get...) directly
961  public double getMarginalUtlOfDistanceOther() {
962  return getModes().get(TransportMode.other).getMarginalUtilityOfDistance();
963  }
964 
965 
966  @Deprecated // use ModeParams (getModes().get...) directly
967  public void setMarginalUtlOfDistanceOther(double marginalUtlOfDistanceOther) {
968  this.getModes().get(TransportMode.other).setMarginalUtilityOfDistance(marginalUtlOfDistanceOther);
969  }
970 
971 
972  @Deprecated // use ModeParams (getModes().get...) directly
973  public void setConstantOther(double constantOther) {
974  getModes().get(TransportMode.other).setConstant(constantOther);
975  }
976 
977 
978  @Deprecated // use ModeParams (getModes().get...) directly
979  public void setTravelingOther_utils_hr(double travelingOtherUtilsHr) {
980  this.getModes().get(TransportMode.other).setMarginalUtilityOfTraveling(travelingOtherUtilsHr);
981  }
982 
983  public boolean isMemorizingExperiencedPlans() {
984  return this.memorizingExperiencedPlans ;
985  }
986 
987  public void setMemorizingExperiencedPlans(boolean memorizingExperiencedPlans) {
988  this.memorizingExperiencedPlans = memorizingExperiencedPlans;
989  }
990 
991  private static class ReflectiveDelegate extends ReflectiveConfigGroup {
992  private ReflectiveDelegate() {
993  super( OldToNewPlanCalcScoreConfigGroup.GROUP_NAME );
994  }
995 
996  private double learningRate = 1.0;
997  private double brainExpBeta = 1.0;
998  private double pathSizeLogitBeta = 1.0;
999  private double lateArrival = -18.0;
1000  private double earlyDeparture = -0.0;
1001  private double performing = +6.0;
1002 
1003  private double waiting = -0.0;
1004 
1005 
1006  private double marginalUtilityOfMoney = 1.0 ;
1007 
1008  private double utilityOfLineSwitch = - 1 ;
1009 
1010  private boolean usingOldScoringBelowZeroUtilityDuration = false ;
1011 
1012  private boolean writeExperiencedPlans = false;
1013 
1014  private Double fractionOfIterationsToStartScoreMSA = null ;
1015 
1016  @StringGetter(FRACTION_OF_ITERATIONS_TO_START_SCORE_MSA)
1017  public Double getFractionOfIterationsToStartScoreMSA() {
1018  return fractionOfIterationsToStartScoreMSA;
1019  }
1020  @StringSetter(FRACTION_OF_ITERATIONS_TO_START_SCORE_MSA)
1021  public void setFractionOfIterationsToStartScoreMSA(Double fractionOfIterationsToStartScoreMSA) {
1022  testForLocked() ;
1023  this.fractionOfIterationsToStartScoreMSA = fractionOfIterationsToStartScoreMSA;
1024  }
1025 
1026  @StringGetter( LEARNING_RATE )
1027  public double getLearningRate() {
1028  return learningRate;
1029  }
1030  @StringSetter( LEARNING_RATE )
1031  public void setLearningRate(double learningRate) {
1032  testForLocked() ;
1033  this.learningRate = learningRate;
1034  }
1035 
1036  @StringGetter( BRAIN_EXP_BETA )
1037  public double getBrainExpBeta() {
1038  return brainExpBeta;
1039  }
1040 
1041  @StringSetter( BRAIN_EXP_BETA )
1042  public void setBrainExpBeta(double brainExpBeta) {
1043  testForLocked() ;
1044  this.brainExpBeta = brainExpBeta;
1045  }
1046 
1047  @StringGetter( PATH_SIZE_LOGIT_BETA )
1048  public double getPathSizeLogitBeta() {
1049  return pathSizeLogitBeta;
1050  }
1051 
1052  @StringSetter( PATH_SIZE_LOGIT_BETA )
1053  public void setPathSizeLogitBeta(double beta) {
1054  testForLocked() ;
1055  if ( beta != 0. ) {
1056  log.warn("Setting pathSizeLogitBeta different from zero is experimental. KN, Sep'08") ;
1057  }
1058  this.pathSizeLogitBeta = beta;
1059  }
1060 
1061  @StringGetter( LATE_ARRIVAL )
1062  public double getLateArrival_utils_hr() {
1063  return lateArrival;
1064  }
1065 
1066  @StringSetter( LATE_ARRIVAL )
1067  public void setLateArrival_utils_hr(double lateArrival) {
1068  testForLocked() ;
1069  this.lateArrival = lateArrival;
1070  }
1071 
1072  @StringGetter( EARLY_DEPARTURE )
1073  public double getEarlyDeparture_utils_hr() {
1074  return earlyDeparture;
1075  }
1076 
1077  @StringSetter( EARLY_DEPARTURE )
1078  public void setEarlyDeparture_utils_hr(double earlyDeparture) {
1079  testForLocked() ;
1080  this.earlyDeparture = earlyDeparture;
1081  }
1082 
1083  @StringGetter( PERFORMING )
1084  public double getPerforming_utils_hr() {
1085  return performing;
1086  }
1087 
1088  @StringSetter( PERFORMING )
1089  public void setPerforming_utils_hr(double performing) {
1090  this.performing = performing;
1091  }
1092 
1093  @StringGetter( MARGINAL_UTL_OF_MONEY )
1094  public double getMarginalUtilityOfMoney() {
1095  return marginalUtilityOfMoney;
1096  }
1097 
1098  @StringSetter( MARGINAL_UTL_OF_MONEY )
1099  public void setMarginalUtilityOfMoney(double marginalUtilityOfMoney) {
1100  testForLocked() ;
1101  this.marginalUtilityOfMoney = marginalUtilityOfMoney;
1102  }
1103 
1104  @StringGetter( UTL_OF_LINE_SWITCH )
1105  public double getUtilityOfLineSwitch() {
1106  return utilityOfLineSwitch;
1107  }
1108 
1109  @StringSetter( UTL_OF_LINE_SWITCH )
1110  public void setUtilityOfLineSwitch(double utilityOfLineSwitch) {
1111  testForLocked() ;
1112  this.utilityOfLineSwitch = utilityOfLineSwitch;
1113  }
1114 
1115  @StringGetter( USING_OLD_SCORING_BELOW_ZERO_UTILITY_DURATION )
1116  public boolean isUsingOldScoringBelowZeroUtilityDuration() {
1117  return usingOldScoringBelowZeroUtilityDuration;
1118  }
1119 
1120  @StringSetter( USING_OLD_SCORING_BELOW_ZERO_UTILITY_DURATION )
1121  public void setUsingOldScoringBelowZeroUtilityDuration(
1122  boolean usingOldScoringBelowZeroUtilityDuration) {
1123  testForLocked() ;
1124  this.usingOldScoringBelowZeroUtilityDuration = usingOldScoringBelowZeroUtilityDuration;
1125  }
1126 
1127  @StringGetter( WRITE_EXPERIENCED_PLANS )
1128  public boolean isWriteExperiencedPlans() {
1129  return writeExperiencedPlans;
1130  }
1131 
1132  @StringSetter( WRITE_EXPERIENCED_PLANS )
1133  public void setWriteExperiencedPlans(boolean writeExperiencedPlans) {
1134  testForLocked() ;
1135  this.writeExperiencedPlans = writeExperiencedPlans;
1136  }
1137 
1138  private static int setWaitingCnt=0 ;
1139 
1140  @StringGetter( WAITING )
1141  public double getMarginalUtlOfWaiting_utils_hr() {
1142  return this.waiting;
1143  }
1144 
1145  @StringSetter( WAITING )
1146  public void setMarginalUtlOfWaiting_utils_hr(final double waiting) {
1147  testForLocked() ;
1148  if ( (waiting != 0.) && (setWaitingCnt<1) ) {
1149  setWaitingCnt++ ;
1150  log.warn("Setting betaWaiting different from zero is discouraged. It is probably implemented correctly, " +
1151  "but there is as of now no indication that it makes the results more realistic." + Gbl.ONLYONCE );
1152  }
1153  this.waiting = waiting;
1154  }
1155  }
1156 
1157  public double getLearningRate() {
1158  return delegate.getLearningRate();
1159  }
1160 
1161  public void setLearningRate(double learningRate) {
1162  delegate.setLearningRate(learningRate);
1163  }
1164 
1165  public double getBrainExpBeta() {
1166  return delegate.getBrainExpBeta();
1167  }
1168 
1169  public void setBrainExpBeta(double brainExpBeta) {
1170  delegate.setBrainExpBeta(brainExpBeta);
1171  }
1172 
1173  public double getPathSizeLogitBeta() {
1174  return delegate.getPathSizeLogitBeta();
1175  }
1176 
1177  public void setPathSizeLogitBeta(double beta) {
1178  delegate.setPathSizeLogitBeta(beta);
1179  }
1180 
1181  public double getLateArrival_utils_hr() {
1182  return delegate.getLateArrival_utils_hr();
1183  }
1184 
1185  public void setLateArrival_utils_hr(double lateArrival) {
1186  delegate.setLateArrival_utils_hr(lateArrival);
1187  }
1188 
1189  public double getEarlyDeparture_utils_hr() {
1190  return delegate.getEarlyDeparture_utils_hr();
1191  }
1192 
1193  public void setEarlyDeparture_utils_hr(double earlyDeparture) {
1194  delegate.setEarlyDeparture_utils_hr(earlyDeparture);
1195  }
1196 
1197  public double getPerforming_utils_hr() {
1198  return delegate.getPerforming_utils_hr();
1199  }
1200 
1201  public void setPerforming_utils_hr(double performing) {
1202  delegate.setPerforming_utils_hr(performing);
1203  }
1204 
1205  public double getMarginalUtilityOfMoney() {
1206  return delegate.getMarginalUtilityOfMoney();
1207  }
1208 
1209  public void setMarginalUtilityOfMoney(double marginalUtilityOfMoney) {
1210  delegate.setMarginalUtilityOfMoney(marginalUtilityOfMoney);
1211  }
1212 
1213  public double getUtilityOfLineSwitch() {
1214  return delegate.getUtilityOfLineSwitch();
1215  }
1216 
1217  public void setUtilityOfLineSwitch(double utilityOfLineSwitch) {
1218  delegate.setUtilityOfLineSwitch(utilityOfLineSwitch);
1219  }
1220 
1221  public boolean isUsingOldScoringBelowZeroUtilityDuration() {
1222  return delegate.isUsingOldScoringBelowZeroUtilityDuration();
1223  }
1224 
1225  public void setUsingOldScoringBelowZeroUtilityDuration(
1226  boolean usingOldScoringBelowZeroUtilityDuration) {
1227  delegate.setUsingOldScoringBelowZeroUtilityDuration(usingOldScoringBelowZeroUtilityDuration);
1228  }
1229 
1230  public boolean isWriteExperiencedPlans() {
1231  return delegate.isWriteExperiencedPlans();
1232  }
1233 
1234  public void setWriteExperiencedPlans(boolean writeExperiencedPlans) {
1235  delegate.setWriteExperiencedPlans(writeExperiencedPlans);
1236  }
1237 
1238  public double getMarginalUtlOfWaiting_utils_hr() {
1239  return delegate.getMarginalUtlOfWaiting_utils_hr();
1240  }
1241  public void setMarginalUtlOfWaiting_utils_hr(double waiting) {
1242  delegate.setMarginalUtlOfWaiting_utils_hr(waiting);
1243  }
1244 
1245  public void setFractionOfIterationsToStartScoreMSA( Double val ) {
1246  delegate.setFractionOfIterationsToStartScoreMSA(val);
1247  }
1248  public Double getFractionOfIterationsToStartScoreMSA() {
1249  return delegate.getFractionOfIterationsToStartScoreMSA() ;
1250  }
1251  @Override
1252  public final void setLocked() {
1253  super.setLocked();
1254  this.delegate.setLocked();
1255  }
1256 }
void readFile(final String filename, final String dtdFilename)
static final String ONLYONCE
Definition: Gbl.java:42
final void write(final String filename)
static final String TRANSIT_ACTIVITY_TYPE
static final double parseTime(final String time)
Definition: Time.java:163
final void addModule(final ConfigGroup specializedConfigModule)
Definition: Config.java:229
static final String writeTime(final double seconds, final String timeformat)
Definition: Time.java:80
static OptionalTime defined(double seconds)