getSeepModes() {
@@ -641,16 +644,16 @@ public boolean setUsingTravelTimeCheckInTeleportation( boolean val ) {
// yyyyyy this should better become a threshold number! kai, aug'16
return this.usingTravelTimeCheckInTeleportation = val ;
}
-
+
static final String PCU_THRESHOLD_FOR_FLOW_CAPACITY_EASING = //
"Flow capacity easing is activated for vehicles of size equal or smaller than the specified threshold. "
+ "Introduced to minimise the chances of buses being severely delayed in downsampled scenarios";
-
-
+
+
public double getPcuThresholdForFlowCapacityEasing() {
return pcuThresholdForFlowCapacityEasing;
}
-
+
/**
* @param pcuThresholdForFlowCapacityEasing -- {@value #PCU_THRESHOLD_FOR_FLOW_CAPACITY_EASING}
*/
@@ -685,5 +688,5 @@ public void setInflowCapacitySetting(InflowCapacitySetting inflowCapacitySetting
// // yyyy do we really need this switch? Quite in general, please try to avoid boolean switches. kai, may'18
// this.creatingVehiclesForAllNetworkModes = creatingVehiclesForAllNetworkModes;
// }
-
+
}
diff --git a/matsim/src/main/java/org/matsim/core/controler/AbstractController.java b/matsim/src/main/java/org/matsim/core/controler/AbstractController.java
index 5edf2d01b20..93c1680a231 100644
--- a/matsim/src/main/java/org/matsim/core/controler/AbstractController.java
+++ b/matsim/src/main/java/org/matsim/core/controler/AbstractController.java
@@ -178,7 +178,7 @@ public void run() {
} catch (UncheckedIOException e) {
log.error("Could not write stopwatch file.", e);
}
- if (config.controller().isCreateGraphs()) {
+ if (config.controller().getCreateGraphsInterval() > 0 && iteration % config.controller().getCreateGraphsInterval() == 0) {
this.getStopwatch().writeGraphFile(this.getControlerIO().getOutputFilename("stopwatch.png", ControllerConfigGroup.CompressionType.none));
}
log.info(MARKER + "ITERATION " + iteration + " ENDS");
diff --git a/matsim/src/main/java/org/matsim/core/mobsim/qsim/agents/WithinDayAgentUtils.java b/matsim/src/main/java/org/matsim/core/mobsim/qsim/agents/WithinDayAgentUtils.java
index 1e3d5e06615..78499e408b6 100644
--- a/matsim/src/main/java/org/matsim/core/mobsim/qsim/agents/WithinDayAgentUtils.java
+++ b/matsim/src/main/java/org/matsim/core/mobsim/qsim/agents/WithinDayAgentUtils.java
@@ -20,6 +20,9 @@
package org.matsim.core.mobsim.qsim.agents;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.TransportMode;
@@ -31,8 +34,7 @@
import org.matsim.core.mobsim.framework.MobsimAgent;
import org.matsim.core.mobsim.framework.PlanAgent;
import org.matsim.core.mobsim.qsim.ActivityEndRescheduler;
-
-import java.util.List;
+import org.matsim.core.population.PopulationUtils;
/**
*
@@ -287,4 +289,20 @@ public static Activity findNextActivityWithType( MobsimAgent agent, String type
public static List subList( MobsimAgent agent, int fromIndex, int toIndex) {
return getModifiablePlan(agent).getPlanElements().subList( fromIndex, toIndex ) ;
}
+
+ public static List convertInteractionActivities(List extends PlanElement> elements) {
+ List updatedElements = new ArrayList<>(elements.size());
+
+ for (int i = 0; i < elements.size(); i++) {
+ PlanElement element = elements.get(i);
+
+ if (element instanceof Activity) {
+ element = PopulationUtils.convertInteractionToStandardActivity((Activity) element);
+ }
+
+ updatedElements.add(element);
+ }
+
+ return updatedElements;
+ }
}
diff --git a/matsim/src/main/java/org/matsim/core/population/PopulationUtils.java b/matsim/src/main/java/org/matsim/core/population/PopulationUtils.java
index 9a572ead6ca..b6f997cab25 100644
--- a/matsim/src/main/java/org/matsim/core/population/PopulationUtils.java
+++ b/matsim/src/main/java/org/matsim/core/population/PopulationUtils.java
@@ -817,6 +817,14 @@ public static Activity createInteractionActivityFromCoordAndLinkId(String type,
act.setLinkId(linkId);
return act ;
}
+
+ public static Activity convertInteractionToStandardActivity(Activity activity) {
+ if (activity instanceof InteractionActivity) {
+ return createActivity(activity);
+ } else {
+ return activity;
+ }
+ }
public static Leg createLeg(String transportMode) {
return getFactory().createLeg(transportMode) ;
diff --git a/matsim/src/main/java/org/matsim/core/utils/io/IOUtils.java b/matsim/src/main/java/org/matsim/core/utils/io/IOUtils.java
index e8667ea8c22..9cc3cde191a 100644
--- a/matsim/src/main/java/org/matsim/core/utils/io/IOUtils.java
+++ b/matsim/src/main/java/org/matsim/core/utils/io/IOUtils.java
@@ -207,7 +207,7 @@ public static void setZstdCompressionLevel(int level) {
public static URL resolveFileOrResource(String filename) throws UncheckedIOException {
try {
// I) do not handle URLs
- if (filename.startsWith("jar:file:") || filename.startsWith("file:") || filename.startsWith( "https:" )) {
+ if (filename.startsWith("jar:file:") || filename.startsWith("file:") || filename.startsWith( "https:" ) || filename.startsWith( "http:" )) {
// looks like an URI
return new URL(filename);
}
diff --git a/matsim/src/main/java/org/matsim/guice/DependencyGraphControlerListener.java b/matsim/src/main/java/org/matsim/guice/DependencyGraphControlerListener.java
index 37492d3f785..9c108996bca 100644
--- a/matsim/src/main/java/org/matsim/guice/DependencyGraphControlerListener.java
+++ b/matsim/src/main/java/org/matsim/guice/DependencyGraphControlerListener.java
@@ -68,33 +68,35 @@ class DependencyGraphControlerListener implements StartupListener {
}
public void notifyStartup(StartupEvent event) {
- if (event.getServices().getConfig().controller().isCreateGraphs()) {
- try (PrintWriter out = new PrintWriter(new File(controlerIO.getOutputFilename("modules.dot")))) {
- MatsimGrapher grapher = new MatsimGrapher(new AbstractInjectorGrapher.GrapherParameters()
- .setAliasCreator(bindings -> {
- List allAliases = Lists.newArrayList();
- for (Binding> binding : bindings) {
- if (binding instanceof ProviderBinding) {
- allAliases.add(new Alias(NodeId.newTypeId(binding.getKey()),
- NodeId.newTypeId(((ProviderBinding>) binding).getProvidedKey())));
- }
+ if (event.getServices().getConfig().controller().getCreateGraphsInterval() <= 0) {
+ return;
+ }
+
+ try (PrintWriter out = new PrintWriter(new File(controlerIO.getOutputFilename("modules.dot")))) {
+ MatsimGrapher grapher = new MatsimGrapher(new AbstractInjectorGrapher.GrapherParameters()
+ .setAliasCreator(bindings -> {
+ List allAliases = Lists.newArrayList();
+ for (Binding> binding : bindings) {
+ if (binding instanceof ProviderBinding) {
+ allAliases.add(new Alias(NodeId.newTypeId(binding.getKey()),
+ NodeId.newTypeId(((ProviderBinding>) binding).getProvidedKey())));
}
- allAliases.addAll(getMapBinderAliases(String.class, TravelTime.class, bindings));
- allAliases.addAll(getMapBinderAliases(String.class, TravelDisutilityFactory.class, bindings));
- allAliases.addAll(getMapBinderAliases(String.class, RoutingModule.class, bindings));
- allAliases.addAll(getMapBinderAliases(ReplanningConfigGroup.StrategySettings.class, PlanStrategy.class, bindings));
- allAliases.addAll(getMultibinderAliases(ControlerListener.class, bindings));
- allAliases.addAll(getMultibinderAliases(SnapshotWriter.class, bindings));
- allAliases.addAll(getMultibinderAliases(MobsimListener.class, bindings));
- allAliases.addAll(getMultibinderAliases(EventHandler.class, bindings));
- allAliases.addAll(getMultibinderAliases(AbstractQSimModule.class, bindings));
- return allAliases;
}
- ), out);
- grapher.graph(injector);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
+ allAliases.addAll(getMapBinderAliases(String.class, TravelTime.class, bindings));
+ allAliases.addAll(getMapBinderAliases(String.class, TravelDisutilityFactory.class, bindings));
+ allAliases.addAll(getMapBinderAliases(String.class, RoutingModule.class, bindings));
+ allAliases.addAll(getMapBinderAliases(ReplanningConfigGroup.StrategySettings.class, PlanStrategy.class, bindings));
+ allAliases.addAll(getMultibinderAliases(ControlerListener.class, bindings));
+ allAliases.addAll(getMultibinderAliases(SnapshotWriter.class, bindings));
+ allAliases.addAll(getMultibinderAliases(MobsimListener.class, bindings));
+ allAliases.addAll(getMultibinderAliases(EventHandler.class, bindings));
+ allAliases.addAll(getMultibinderAliases(AbstractQSimModule.class, bindings));
+ return allAliases;
+ }
+ ), out);
+ grapher.graph(injector);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
}
}
diff --git a/matsim/src/test/java/org/matsim/analysis/ModeStatsControlerListenerTest.java b/matsim/src/test/java/org/matsim/analysis/ModeStatsControlerListenerTest.java
index daf5a8cd90d..6ccaba6938c 100644
--- a/matsim/src/test/java/org/matsim/analysis/ModeStatsControlerListenerTest.java
+++ b/matsim/src/test/java/org/matsim/analysis/ModeStatsControlerListenerTest.java
@@ -460,6 +460,7 @@ private void readAndcompareValues(HashMap modes, int itr) {
}
iteration++;
}
+ Assert.assertEquals(itr, iteration);
} catch (IOException e) {
e.printStackTrace();
}
diff --git a/matsim/src/test/java/org/matsim/analysis/PHbyModeCalculatorTest.java b/matsim/src/test/java/org/matsim/analysis/PHbyModeCalculatorTest.java
index e123bfceea9..ae647a6fd59 100644
--- a/matsim/src/test/java/org/matsim/analysis/PHbyModeCalculatorTest.java
+++ b/matsim/src/test/java/org/matsim/analysis/PHbyModeCalculatorTest.java
@@ -93,28 +93,28 @@ private void performTest(IdMap map, String outputDirectory) {
controllerConfigGroup.setCreateGraphs(true);
controllerConfigGroup.setFirstIteration(0);
controllerConfigGroup.setLastIteration(10);
- PHbyModeCalculator phbyModeCalculator = new PHbyModeCalculator(controllerConfigGroup, controlerIO, new GlobalConfigGroup());
+ PHbyModeCalculator phbyModeCalculator = new PHbyModeCalculator(controlerIO, new GlobalConfigGroup());
phbyModeCalculator.addIteration(1, map);
- phbyModeCalculator.writeOutput();
+ phbyModeCalculator.writeOutput(false);
readAndValidateValues(1, map);
// removing person 2
map.remove(person2);
phbyModeCalculator.addIteration(2, map);
- phbyModeCalculator.writeOutput();
+ phbyModeCalculator.writeOutput(false);
readAndValidateValues(2, map);
// removing person 3
map.remove(person3);
phbyModeCalculator.addIteration(3, map);
- phbyModeCalculator.writeOutput();
+ phbyModeCalculator.writeOutput(false);
readAndValidateValues(3, map);
// removing person 4
map.remove(person4);
phbyModeCalculator.addIteration(4, map);
- phbyModeCalculator.writeOutput();
+ phbyModeCalculator.writeOutput(false);
readAndValidateValues(4, map);
}
diff --git a/matsim/src/test/java/org/matsim/analysis/PKMbyModeCalculatorTest.java b/matsim/src/test/java/org/matsim/analysis/PKMbyModeCalculatorTest.java
index ba62f04f994..810b9954e1d 100644
--- a/matsim/src/test/java/org/matsim/analysis/PKMbyModeCalculatorTest.java
+++ b/matsim/src/test/java/org/matsim/analysis/PKMbyModeCalculatorTest.java
@@ -160,10 +160,10 @@ private void performTest(IdMap map, HashMap modeCa
controllerConfigGroup.setCreateGraphs(true);
controllerConfigGroup.setFirstIteration(0);
controllerConfigGroup.setLastIteration(10);
- PKMbyModeCalculator pkmbyModeCalculator = new PKMbyModeCalculator(controllerConfigGroup, controlerIO, new GlobalConfigGroup());
+ PKMbyModeCalculator pkmbyModeCalculator = new PKMbyModeCalculator(controlerIO, new GlobalConfigGroup());
// iteration 0
pkmbyModeCalculator.addIteration(0, map);
- pkmbyModeCalculator.writeOutput();
+ pkmbyModeCalculator.writeOutput(false);
Double totalCarDist = modeCalcDist.get("person1CarDist") + modeCalcDist.get("person2CarDist")
+ modeCalcDist.get("person3CarDist");
Double totalPtDist = modeCalcDist.get("person1PtDist") + modeCalcDist.get("person4PtDist");
@@ -176,7 +176,7 @@ private void performTest(IdMap map, HashMap modeCa
map.remove(person2.getId());
// iteration 1
pkmbyModeCalculator.addIteration(1, map);
- pkmbyModeCalculator.writeOutput();
+ pkmbyModeCalculator.writeOutput(false);
totalCarDist = modeCalcDist.get("person1CarDist") + modeCalcDist.get("person3CarDist");
totalPtDist = modeCalcDist.get("person1PtDist") + modeCalcDist.get("person4PtDist");
totalWalkDist = modeCalcDist.get("person1WalkDist") + modeCalcDist.get("person3WalkDist") + modeCalcDist.get("person4WalkDist");
@@ -187,7 +187,7 @@ private void performTest(IdMap map, HashMap modeCa
map.remove(person3.getId());
// iteration 2
pkmbyModeCalculator.addIteration(2, map);
- pkmbyModeCalculator.writeOutput();
+ pkmbyModeCalculator.writeOutput(false);
totalCarDist = modeCalcDist.get("person1CarDist");
totalPtDist = modeCalcDist.get("person1PtDist") + modeCalcDist.get("person4PtDist");
totalWalkDist = modeCalcDist.get("person1WalkDist") + modeCalcDist.get("person4WalkDist");
diff --git a/matsim/src/test/java/org/matsim/analysis/ScoreStatsControlerListenerTest.java b/matsim/src/test/java/org/matsim/analysis/ScoreStatsControlerListenerTest.java
index 33345fdfb2b..dc94a183ea7 100644
--- a/matsim/src/test/java/org/matsim/analysis/ScoreStatsControlerListenerTest.java
+++ b/matsim/src/test/java/org/matsim/analysis/ScoreStatsControlerListenerTest.java
@@ -551,10 +551,13 @@ private void readAndValidateValues(String outDir, int itr, Population populatio
0);
Assert.assertEquals("avg average score does not match", (getScore(population, "avgaverage")/getNoOfPlans(population)), avgAverage,
0);
+ break;
}
iteration++;
}
+ Assert.assertEquals(itr, iteration);
+
Assertions.assertThat(new File(outDir, "scorestats_group1.csv"))
.isFile();
diff --git a/matsim/src/test/java/org/matsim/analysis/TravelDistanceStatsTest.java b/matsim/src/test/java/org/matsim/analysis/TravelDistanceStatsTest.java
index e1e0a8fb0d2..4d471767085 100644
--- a/matsim/src/test/java/org/matsim/analysis/TravelDistanceStatsTest.java
+++ b/matsim/src/test/java/org/matsim/analysis/TravelDistanceStatsTest.java
@@ -337,25 +337,35 @@ public void testTravelDistanceStats() {
private void performTest(IdMap map, String outputDirectory) {
- ControllerConfigGroup controllerConfigGroup = new ControllerConfigGroup();
- OutputDirectoryHierarchy controlerIO = new OutputDirectoryHierarchy(outputDirectory,
- OverwriteFileSetting.overwriteExistingFiles, CompressionType.gzip);
- controllerConfigGroup.setCreateGraphs(true);
- controllerConfigGroup.setFirstIteration(0);
- controllerConfigGroup.setLastIteration(10);
- TravelDistanceStats travelDistanceStats = new TravelDistanceStats(controllerConfigGroup, controlerIO, new GlobalConfigGroup());
+ TravelDistanceStats travelDistanceStats = getTravelDistanceStats(outputDirectory);
+
travelDistanceStats.addIteration(0, map);
+ travelDistanceStats.writeOutput(0, false);
readAndValidateValues(0, person1legsum + person2legsum + person3legsum, 12,
person1TotalNumberOfLegs + person2TotalNumberOfLegs + person3TotalNumberOfLegs);
+
map.remove(person2.getId());
travelDistanceStats.addIteration(1, map);
+ travelDistanceStats.writeOutput(1, false);
readAndValidateValues(1, person1legsum + person3legsum, 8, person1TotalNumberOfLegs + person3TotalNumberOfLegs);
+
map.remove(person3.getId());
travelDistanceStats.addIteration(2, map);
+ travelDistanceStats.writeOutput(2, false);
readAndValidateValues(2, person1legsum, 6, person1TotalNumberOfLegs);
travelDistanceStats.close();
}
+ private static TravelDistanceStats getTravelDistanceStats(String outputDirectory) {
+ ControllerConfigGroup controllerConfigGroup = new ControllerConfigGroup();
+ OutputDirectoryHierarchy controlerIO = new OutputDirectoryHierarchy(outputDirectory,
+ OverwriteFileSetting.overwriteExistingFiles, CompressionType.gzip);
+ controllerConfigGroup.setCreateGraphs(true);
+ controllerConfigGroup.setFirstIteration(0);
+ controllerConfigGroup.setLastIteration(10);
+ return new TravelDistanceStats(controllerConfigGroup, controlerIO, new GlobalConfigGroup());
+ }
+
private void readAndValidateValues(int itr, Double legSum, int totalTrip, long totalLeg) {
String file = utils.getOutputDirectory() + "/TravelDistanceStat" + "/traveldistancestats.csv";
@@ -385,6 +395,7 @@ private void readAndValidateValues(int itr, Double legSum, int totalTrip, long t
}
iteration++;
}
+ Assert.assertEquals("There are too less entries.", itr, iteration);
} catch (IOException e) {
e.printStackTrace();
}
diff --git a/matsim/src/test/java/org/matsim/analysis/TripsAndLegsCSVWriterTest.java b/matsim/src/test/java/org/matsim/analysis/TripsAndLegsWriterTest.java
similarity index 96%
rename from matsim/src/test/java/org/matsim/analysis/TripsAndLegsCSVWriterTest.java
rename to matsim/src/test/java/org/matsim/analysis/TripsAndLegsWriterTest.java
index 788452ea7bb..a2517b9f76d 100644
--- a/matsim/src/test/java/org/matsim/analysis/TripsAndLegsCSVWriterTest.java
+++ b/matsim/src/test/java/org/matsim/analysis/TripsAndLegsWriterTest.java
@@ -23,8 +23,8 @@
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
-import org.matsim.analysis.TripsAndLegsCSVWriter.NoLegsWriterExtension;
-import org.matsim.analysis.TripsAndLegsCSVWriter.NoTripWriterExtension;
+import org.matsim.analysis.TripsAndLegsWriter.NoLegsWriterExtension;
+import org.matsim.analysis.TripsAndLegsWriter.NoTripWriterExtension;
import org.matsim.api.core.v01.*;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
@@ -60,7 +60,7 @@
* @author Aravind
*
*/
-public class TripsAndLegsCSVWriterTest {
+public class TripsAndLegsWriterTest {
Config config = ConfigUtils.createConfig();
Scenario scenario = ScenarioUtils.createScenario(config);
@@ -164,19 +164,19 @@ public void testTripsAndLegsCSVWriter() {
}
private void performTest(String tripsFilename, String legsFilename, IdMap map, AnalysisMainModeIdentifier mainModeIdentifier) {
- TripsAndLegsCSVWriter.NoTripWriterExtension tripsWriterExtension = new NoTripWriterExtension();
- TripsAndLegsCSVWriter.NoLegsWriterExtension legWriterExtension = new NoLegsWriterExtension();
- TripsAndLegsCSVWriter.CustomTimeWriter timeWriter = new TripsAndLegsCSVWriter.DefaultTimeWriter();
- TripsAndLegsCSVWriter.CustomTripsWriterExtension customTripsWriterExtension = new CustomTripsWriterExtesion();
- TripsAndLegsCSVWriter.CustomLegsWriterExtension customLegsWriterExtension = new CustomLegsWriterExtesion();
- TripsAndLegsCSVWriter tripsAndLegsWriter = new TripsAndLegsCSVWriter(scenario, tripsWriterExtension,
+ TripsAndLegsWriter.NoTripWriterExtension tripsWriterExtension = new NoTripWriterExtension();
+ TripsAndLegsWriter.NoLegsWriterExtension legWriterExtension = new NoLegsWriterExtension();
+ TripsAndLegsWriter.CustomTimeWriter timeWriter = new TripsAndLegsWriter.DefaultTimeWriter();
+ TripsAndLegsWriter.CustomTripsWriterExtension customTripsWriterExtension = new CustomTripsWriterExtesion();
+ TripsAndLegsWriter.CustomLegsWriterExtension customLegsWriterExtension = new CustomLegsWriterExtesion();
+ TripsAndLegsWriter tripsAndLegsWriter = new TripsAndLegsWriter(scenario, tripsWriterExtension,
legWriterExtension, mainModeIdentifier, timeWriter);
tripsAndLegsWriter.write(map, tripsFilename, legsFilename);
readTripsFromPlansFile(map, mainModeIdentifier);
readAndValidateTrips(persontrips, tripsFilename);
readLegsFromPlansFile(map);
readAndValidateLegs(legsfromplan, legsFilename);
- TripsAndLegsCSVWriter tripsAndLegsWriterTest = new TripsAndLegsCSVWriter(scenario, customTripsWriterExtension,
+ TripsAndLegsWriter tripsAndLegsWriterTest = new TripsAndLegsWriter(scenario, customTripsWriterExtension,
customLegsWriterExtension, mainModeIdentifier, timeWriter);
tripsAndLegsWriterTest.write(map, tripsFilename, legsFilename);
}
@@ -671,7 +671,7 @@ private void createNetwork() {
NetworkUtils.writeNetwork(network, utils.getOutputDirectory() + "/network.xml");
new MatsimNetworkReader(scenario.getNetwork()).readFile(utils.getOutputDirectory() + "/network.xml");
}
- private static class CustomTripsWriterExtesion implements TripsAndLegsCSVWriter.CustomTripsWriterExtension{
+ private static class CustomTripsWriterExtesion implements TripsAndLegsWriter.CustomTripsWriterExtension{
@Override
public String[] getAdditionalTripHeader() {
@@ -701,7 +701,7 @@ public List getAdditionalTripColumns(Trip trip) {
}
- static class CustomLegsWriterExtesion implements TripsAndLegsCSVWriter.CustomLegsWriterExtension {
+ static class CustomLegsWriterExtesion implements TripsAndLegsWriter.CustomLegsWriterExtension {
@Override
public String[] getAdditionalLegHeader() {
String[] legHeader = new String[]{"isIntermodalWalkPt"};
diff --git a/matsim/src/test/java/org/matsim/core/config/ReflectiveConfigGroupTest.java b/matsim/src/test/java/org/matsim/core/config/ReflectiveConfigGroupTest.java
index a662f53d5ad..884777ff20b 100644
--- a/matsim/src/test/java/org/matsim/core/config/ReflectiveConfigGroupTest.java
+++ b/matsim/src/test/java/org/matsim/core/config/ReflectiveConfigGroupTest.java
@@ -172,18 +172,19 @@ public void testComments() {
}
@Test
- public void testFailOnConstructingOrphanSetter() {
- assertThatThrownBy(() -> new ReflectiveConfigGroup("name") {
+ public void testAllowOnConstructingOrphanSetter() {
+ // no exception
+ new ReflectiveConfigGroup("name") {
@StringSetter("setterWithoutGetter")
public void setStuff(String s) {
}
- }).isInstanceOf(InconsistentModuleException.class);
+ };
}
@Test
public void testFailOnConstructingOrphanGetter() {
assertThatThrownBy(() -> new ReflectiveConfigGroup("name") {
- @StringGetter("setterWithoutGetter")
+ @StringGetter("getterWithoutSetter")
public Coord getStuff() {
return null;
}
diff --git a/matsim/src/test/java/org/matsim/core/config/groups/ControllerConfigGroupTest.java b/matsim/src/test/java/org/matsim/core/config/groups/ControllerConfigGroupTest.java
index a1c50b1d46f..e6f47897853 100644
--- a/matsim/src/test/java/org/matsim/core/config/groups/ControllerConfigGroupTest.java
+++ b/matsim/src/test/java/org/matsim/core/config/groups/ControllerConfigGroupTest.java
@@ -161,5 +161,22 @@ public void testWriteSnapshotInterval(){
Assert.assertEquals(42, cg.getWriteSnapshotsInterval());
}
+ @Test
+ public void testCreateGraphsInterval() {
+ ControllerConfigGroup cg = new ControllerConfigGroup();
+ //initial value
+ Assert.assertEquals(1, cg.getCreateGraphsInterval());
+ //modify by string
+ cg.addParam("createGraphsInterval", "10");
+ Assert.assertEquals(10, cg.getCreateGraphsInterval());
+ //modify by setter
+ cg.setCreateGraphsInterval(42);
+ Assert.assertEquals("42", cg.getValue("createGraphsInterval"));
+ Assert.assertEquals(42, cg.getCreateGraphsInterval());
+ //modify by deprecated setter
+ cg.setCreateGraphs(true);
+ Assert.assertEquals(1, cg.getCreateGraphsInterval());
+ }
+
}
diff --git a/pom.xml b/pom.xml
index f2438bd5085..a6649d3bc2e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
2.22.0
29.2
- 0.49.1
+ 0.49.2
1.19.0
7.0.0
2.16.0
@@ -279,7 +279,7 @@
org.checkerframework
checker-qual
- 3.40.0
+ 3.41.0
@@ -304,7 +304,7 @@
org.mockito
mockito-core
- 5.7.0
+ 5.8.0
test
@@ -427,7 +427,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.6.2
+ 3.6.3
org.codehaus.mojo