chore(prototype): allow rebuild on any lane count to observe vehicle relocation sooner
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
69b94552c2
commit
ea23aa1dc5
1 file changed
+3
-3
@@ -41,7 +41,7 @@ local record ProbeState
|
|||||||
watch : {integer} -- vehicles involved in the last rebuild, flagged in later dumps
|
watch : {integer} -- vehicles involved in the last rebuild, flagged in later dumps
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Two-way = exactly two driving lanes (modes other than the sidewalk ones). No edge objects (stops, signals),
|
-- No edge objects (stops, signals),
|
||||||
-- because re-adding them is out of scope for this probe.
|
-- because re-adding them is out of scope for this probe.
|
||||||
local function rebuildable(seg : integer) : boolean, string
|
local function rebuildable(seg : integer) : boolean, string
|
||||||
local be = api.engine.getComponent(seg, api.type.ComponentType.BASE_EDGE) as Engine.Component.BaseEdge
|
local be = api.engine.getComponent(seg, api.type.ComponentType.BASE_EDGE) as Engine.Component.BaseEdge
|
||||||
@@ -55,8 +55,8 @@ local function rebuildable(seg : integer) : boolean, string
|
|||||||
if on and (tonumber(tostring(k)) or 0) >= 2 then driving = driving + 1 break end
|
if on and (tonumber(tostring(k)) or 0) >= 2 then driving = driving + 1 break end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if driving ~= 2 then return false, "driving lanes=" .. driving end
|
-- any lane count: what a rebuild does to vehicles on the segment doesn't depend on it
|
||||||
return true, string.format("template=%s length=%.1f", tostring(be.roadTemplate), be.distance)
|
return true, string.format("drivingLanes=%d template=%s length=%.1f", driving, tostring(be.roadTemplate), be.distance)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function rebuild(seg : integer)
|
local function rebuild(seg : integer)
|
||||||
|
|||||||
Reference in new issue
Block a user