Minor correction for QueueSwitcher example

This commit is contained in:
2018-11-06 15:30:54 +01:00
parent 5cd8c15f94
commit dd756569a6

View File

@ -1,25 +1,23 @@
// Blocked Take Over Request Scenario
// Next Queue Switcher Scenario
Scenario QueueSwitcher:
Act QueueSwitcher(rightcount=30,rightspeed=10km/h,latpos=0.3,latpostime=1s,blinktime=-2s):
Act QueueSwitcher($rightcount=30,$rightspeed=10km/h,$latpos=0.3,$latpostime=1s,$blinktime=2s):
@init:
CreateVehicle(Ego,EgoProto,xyz=0m|0m|0m,speed=30km/h)
CreateVehicle(Front,FrontProto,xyz=0m|Ego.y+100m|0m,speed=30km/h)
repeat n in [1:$rightcount] by 1:
repeat $n in [1:$rightcount] by 1:
CreateVehicle(RightQueue$n,RightQueueProto,xyz=5m|Ego.y+$n*15m|0m,speed=$rightspeed)
@Headway(Ego,Front) >= 2s % OnceOnly:
select next_queue in RightQueue* with DistanceBeforePassing(next_queue,Ego)>15m minimize Distance(next_queue,Ego):
select $next_queue in RightQueue* with DistanceBeforePassing($next_queue,Ego)>15m minimize Distance($next_queue,Ego):
@Distance($next_queue,Ego) < 10m:
LateralChange($next_queue,x=-$latpos,t=$latpostime)
Delay(2s)
SetLight($next_queue,LeftTurnIndicator)
Delay($blinktime)
LangeChange($next_queue,lane=+1,model=...)
LaneChange(Blocker,lane=+1,model=Sinusoidal(time=5s))
SpeedChange(Blocker,SpeedToReach(Blocker,Ego,Accident.y-180m))
LangeChange($next_queue,lane=+1,model=Sinusoidal(time=5s))
Prototypes:
EgoProto: Vehicle(geometry="mycar.obj",color="blue")