diff --git a/matsim/src/main/java/org/matsim/core/config/groups/QSimConfigGroup.java b/matsim/src/main/java/org/matsim/core/config/groups/QSimConfigGroup.java index 14c9504e785..f8d59f01e01 100644 --- a/matsim/src/main/java/org/matsim/core/config/groups/QSimConfigGroup.java +++ b/matsim/src/main/java/org/matsim/core/config/groups/QSimConfigGroup.java @@ -32,6 +32,7 @@ import jakarta.validation.constraints.Positive; import jakarta.validation.constraints.PositiveOrZero; import java.util.*; +import java.util.stream.Collectors; /** * @author nagel @@ -240,25 +241,26 @@ public final Map getComments() { public enum NodeTransition { emptyBufferAfterBufferRandomDistribution_dontBlockNode, emptyBufferAfterBufferRandomDistribution_nodeBlockedWhenSingleOutlinkFull, - moveVehByVehRandomDistribution_dontBlockNode, - moveVehByVehRandomDistribution_nodeBlockedWhenSingleOutlinkFull, + moveVehByVehRandomDistribution_dontBlockNode, + moveVehByVehRandomDistribution_nodeBlockedWhenSingleOutlinkFull, moveVehByVehDeterministicPriorities_nodeBlockedWhenSingleOutlinkFull - /* note: moveVehByVehDeterministicPriorities is not implemented for the case when the node is not blocked + /* note: moveVehByVehDeterministicPriorities is not implemented for the case when the node is not blocked * as soon as a single outlink is full * theresa, jun'20 */ } private NodeTransition nodeTransitionLogic = NodeTransition.emptyBufferAfterBufferRandomDistribution_dontBlockNode; - + // --- - + public QSimConfigGroup() { super(GROUP_NAME); } @StringSetter(MAIN_MODE) private void setMainModes(String value) { - setMainModes(Arrays.asList(value.split(","))); + Set modes = Arrays.stream(value.split(",")).map(String::trim).collect(Collectors.toSet()); + setMainModes(modes); } @StringSetter(SNAPSHOT_PERIOD) @@ -600,7 +602,8 @@ private String getSeepModesAsString() { @StringSetter(SEEP_MODE) private void setSeepModes(String value) { - setSeepModes(Arrays.asList(value.split(","))); + Set modes = Arrays.stream(value.split(",")).map(String::trim).collect(Collectors.toSet()); + setSeepModes(modes); } public Collection 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; // } - + }