Closed FrankHuang777 closed 2 years ago
Hi @FrankHuang777, an undergraduate student of mine, @rgraebe did something similar for the high-occupancy vehicle (HOV) lane on the N2 freeway in the City of Cape Town (I hope the street view link works - bus/HOV lane is right-most lane).
Anyway, the approach we followed is the following:
AB
(3 lanes in our case) that is an HOV lane, duplicate it, AB_hov
;AB
is allowed all modes and AB_hov
is only allowed pt
as mode;NetworkChangeEvent
s) of AB
2 and that of AB_hov
1;AB
and to 0 for AB_hov
.Did I get that right, @rgraebe? The only unintended consequence is that I cannot remember what happens to agents when they find themselves still on AB_hov
when its number of lanes become zero again. Maybe @rgraebe can chip in.
Thanks @JWJoubert , I think it is a very clever way to achieve the effect I want. I will check what will happen to vehicles when the number of lanes goes to zero, perhaps they will be stuck.
I'm also trying to extend NetworkChangeEvent to support more dynamic changes to link attributes, but that's a bit difficult for me. 😂
Thanks again for your help!
Hi @FrankHuang777. Actually, we had quite some difficulties when using NetworkchangeEvents
for the functionality you seek. If I am not mistaken, exactly that: the issue of the stuck vehicles. Instead, we (@JWJoubert and I) got away without using a NetworkChangeEvent
.
AB
link that was relevant to the case.AB
's permlanes
attribute was reduced by one and the duplicated link AB_hov
had permlanes=1
. This is how we kept the same "capacity".VehicleBanChecker
.vehicleBan
determines if it is a banned vehicle, on a banned link, on a banned time and penalises the agent.We used this to "incentivise" non-HGVs to stay out of the HOV lane (link) during peak travel times. This did the trick with no NetworkChangeEvent
- hope it helps!
Thank you @rgraebe , I think I have achieved the effect I wanted without using NetworkChangeEvent.
In fact, I study the scenario of traffic restrictions based on the last digit of license plate numbers. This means I need to ban certain vehicles at certain times and on certain roads depending on their license plate number. I achieve this indirectly by increasing the time required for the restricted vehicle to pass on the restricted road. The only thing I do is modifying TravelTimeCalculator.
Thanks for your advice!
Hello, all!
I know NetworkChangeEvent can help change the flowCapacity, freespeed and lanes of specified links during simulation by using networkChangeEvents.xml or writing some code, like the following shows:
In my project, I need to change the link allowed modes dynamically. For example, link 1 allowed car and pt
<link id="1112" from="11" to="12" length="1200.00" capacity="2000" freespeed="12" modes="car, pt" permlanes="1" />
I want to make link 1 pt only, i.e. modes="pt" from 7am to 9am, what should I do?Thanks!