Skip to content

faq 124813313

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

NetworkChangeEvent types

by Johan W. Joubert on 2017-11-22 10:40:45


Hi, I see in org.matsim.core.network.NetworkChangeEvent that there are two types of change events: ABSOLUTE_IN_SI_UNITS and FACTOR. The latter I'm comfortable with, but I could not quite, going through the code (org.matsim.core.network.TimeVariantLinkImpl for example), understand exactly how the ABSOLUTE_IN_SI_UNITS works. It seems that if I want a lane to be closed, for example, I would create a ChangeValue as follows:

ChangeValue changeToZeroLanes = new ChangeValue(ChangeType.ABSOLUTE_IN_SI_UNITS, 0);

And this makes sense in the example given in the MATSim book. My use case, however, is to change the number of lanes relative to some base value. For example, there is one of the three N2 freeway lanes in the City of Cape Town that is reserved for public transport during the morning peak period. So, I already added the reserved lane as additional links, having initially zero lanes.

Now, it seems that if I want to reduce a normally-three-lane link by one lane, I will have to create a ChangeValue

ChangeValue changeToTwoLanes = new ChangeValue(ChangeType.ABSOLUTE_IN_SI_UNITS, 2);

and later, when the peak is over, change it back to three lanes with the following ChangeValue

ChangeValue changeToThreeLanes = new ChangeValue(ChangeType.ABSOLUTE_IN_SI_UNITS, 3);

Do I understand this correctly? If so, is there scope that we can add another ChangeType called something like RELATIVE_IN_SI_UNITS? For example, reducing by one lane would then simply be

ChangeValue reduceByOneLane = new ChangeValue(ChangeType.RELATIVE_IN_SI_UNITS, -1);


Comments: 1


Re: NetworkChangeEvent types

by Marcel Rieser on 2017-11-22 19:58:30

Seemingly, there was not yet this option, but it got added today by Kai: https://github.com/matsim-org/matsim/commit/9051ff80d3a673c899635d0ca8a2103e931ab4a5

Be aware that changing the number of lanes will influence the storage capacity of the link, but not the flow capacity. If the flow should increase as well due to the additional lane, an additional ChangeEvent should be issued.

Clone this wiki locally