Closed WJSchakel closed 6 months ago
TURN_ON_RED
priority has been removed.TrafficLight
. Nodes can be added to which GTUs may may turn through red. These nodes should be the first node beyond a split, for the given GTU type.HeadwayTrafficLight
includes the information as a boolean
.DirectDefaultSimplePerception
ignored turn-right-on-red information.DirectIntersectionPerception
includes this information.TrafficLightUtil
now ignores a red (or yellow) traffic light if the info is perceived true.Turn-on-red information can be defined in XML and through the editor (see org.opentrafficsim.editor.RunEditor
in ots-editor). The information is located at: Ots.Network.Link.TrafficLight.TurnOnRed
, and contains a node value regarding the node id that can be turned to through red at the traffic light. For example:
<ots:Ots ...>
<ots:Definitions>
...
</ots:Definitions>
<ots:Network>
...
<ots:Link Id="AS-ASI" NodeEnd="ASI" NodeStart="AS" Type="URBAN">
<ots:Straight/>
<ots:DefinedLayout>2lane</ots:DefinedLayout>
<ots:TrafficLight Id="A1" Lane="lane1" Position="275m"/>
<ots:TrafficLight Id="A2" Lane="lane2" Position="275m">
<ots:TurnOnRed>DWI</ots:TurnOnRed>
</ots:TrafficLight>
</ots:Link>
...
Here, GTU's towards node DWI
will not stop for the traffic light A2
on lane lane2
on link AS-ASI
, even when its red.
A demo has been created to showcase the turn-on-red feature. This simulation is defined in TurnOnRed.xml
which can be found in the resources of ots-demo. This file can be loaded in the editor, after which is can be run by hitting play in the top right corner of the screen. Alternatively one can run org.opentrafficsim.demo.loadfromxml.LoadXml
and point to the xml file.
At the moment, conflicts have been turned off in the demo. GTUs will merge abruptly. Intersection behavior when conflicts and traffic lights are combined, causes GTUs to stop on the intersection beyond the traffic lights, with all other traffic waiting behind red traffic lights. This needs to be further investigated.
A few more tweaks:
LoadXml
made conflicts on its own accord. This code has been removed. Rather, an XML tag governs conflict generation.ConflictUtil
prevent GTU's from stopping on the intersection in the demo.The demo now shows fully functional turn-on-red behavior.
There currently is a
ConflictPriority
named 'TURN_ON_RED', and aCrossSectionLink.Priority
namedTURN_ON_RED
. The link property is used to set priority on a conflict. However, the turn-right-on-red rule is about crossing the traffic light. The conflict itself could have any priority (usually yield for traffic passing the red traffic light).These priority values will be removed, and instead information will be added to a traffic light.