MATSIM
TimeAllocationMutatorConfigGroup.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * PlansConfigGroup.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 
23 import java.util.Map;
24 
26 import org.matsim.core.utils.misc.Time;
27 
29 
30  public static final String GROUP_NAME = "timeAllocationMutator";
31 
32 
34  super(GROUP_NAME);
35  }
36 
37  @Override
38  public Map<String, String> getComments() {
39  Map<String, String> comments = super.getComments();
40  comments.put(MUTATION_RANGE, "Default:1800.0; Defines how many seconds a time mutation can maximally shift a time.");
41  comments.put(MUTATION_AFFECTS_DURATION, "Default:true; Defines whether time mutation changes an activity's duration.");
42  comments.put(LATEST_ACTIVITY_END_TIME,"Latest Activity End Time. Default = 24:00:00");
43  comments.put(MUTATION_RANGE_STEP,"Mutation Range Step, default = 1 second");
44  comments.put(MUTATE_AROUND_INITIAL_END_TIME_ONLY,"Mutates times only around the initially defined end times.");
45  return comments;
46  }
47 
48  // ---
49 
50  private static final String LATEST_ACTIVITY_END_TIME = "latestActivityEndTime";
51  private static final String MUTATE_AROUND_INITIAL_END_TIME_ONLY = "mutateAroundInitialEndTimeOnly";
52  private static final String MUTATION_RANGE_STEP = "mutationRangeStep";
53  private static final String MUTATION_RANGE = "mutationRange";
54  private double mutationRange = 1800.0;
55  private double latestActivityEndTime = 24*3600.0;
56  private boolean mutateAroundInitialEndTimeOnly = false;
57  private double mutationRangeStep = 1.0;
58 
59  @StringGetter(MUTATION_RANGE_STEP)
60  public double getMutationRangeStep() {
61  return mutationRangeStep;
62  }
63  @StringSetter(MUTATION_RANGE_STEP)
64  public void setMutationRangeStep(double mutationRangeStep) {
65  this.mutationRangeStep = mutationRangeStep;
66  }
68  public double getLatestActivityEndTime() {
69  return latestActivityEndTime;
70  }
74  }
75 
79  }
83  }
84 
86  public double getMutationRange() {
87  return this.mutationRange;
88  }
90  public void setMutationRange(final double val) {
91  this.mutationRange = val;
92  }
93 
94  // ---
95 
96  private static final String MUTATION_AFFECTS_DURATION = "mutationAffectsDuration";
97  private boolean affectingDuration = true;
99  public boolean isAffectingDuration() {
100  return this.affectingDuration;
101  }
105  }
106 
107  // ---
108 }
static final double parseTime(final String time)
Definition: Time.java:163