Debug output

This commit is contained in:
funkyfranky 2018-07-18 17:41:21 +02:00
parent c60bb29303
commit 6aa30f91e6
2 changed files with 9 additions and 12 deletions

View File

@ -368,8 +368,6 @@ do -- CARGO_GROUP
NearRadius = NearRadius or 25 NearRadius = NearRadius or 25
env.info("FF onenterunboarding")
local Timer = 1 local Timer = 1
if From == "Loaded" then if From == "Loaded" then
@ -383,7 +381,6 @@ do -- CARGO_GROUP
--- @param Cargo.Cargo#CARGO Cargo --- @param Cargo.Cargo#CARGO Cargo
function( Cargo, NearRadius ) function( Cargo, NearRadius )
if not Cargo:IsDestroyed() then if not Cargo:IsDestroyed() then
env.info("FF blubblub")
local ToVec=nil local ToVec=nil
if ToPointVec2==nil then if ToPointVec2==nil then
ToVec=self.CargoCarrier:GetPointVec2():GetRandomPointVec2InRadius(2*NearRadius, NearRadius) ToVec=self.CargoCarrier:GetPointVec2():GetRandomPointVec2InRadius(2*NearRadius, NearRadius)

View File

@ -2014,12 +2014,13 @@ do -- Route methods
-- Calculate the direct distance between the initial and final points. -- Calculate the direct distance between the initial and final points.
local LengthDirect=FromCoordinate:Get2DDistance(ToCoordinate) local LengthDirect=FromCoordinate:Get2DDistance(ToCoordinate)
env.info(string.format("FF length on road = %.1f km", LengthOnRoad/1000)) -- Debug info.
env.info(string.format("FF length directly = %.1f km", LengthDirect/1000)) self:T(string.format("Length on road = %.3f km", LengthOnRoad/1000))
env.info(string.format("FF length fraction = %.1f km", LengthOnRoad/LengthDirect)) self:T(string.format("Length directly = %.3f km", LengthDirect/1000))
env.info(string.format("FF length only road = %.1f km", LengthRoad/1000)) self:T(string.format("Length fraction = %.3f km", LengthOnRoad/LengthDirect))
env.info(string.format("FF length off road = %.1f km", LengthOffRoad/1000)) self:T(string.format("Length only road = %.3f km", LengthRoad/1000))
env.info(string.format("FF percent on road = %.1f", LengthRoad/LengthOnRoad*100)) self:T(string.format("Length off road = %.3f km", LengthOffRoad/1000))
self:T(string.format("Percent on road = %.1f", LengthRoad/LengthOnRoad*100))
-- Route, ground waypoints along road. -- Route, ground waypoints along road.
local route={} local route={}
@ -2032,13 +2033,13 @@ do -- Route methods
-- Check whether the road is very long compared to direct path. -- Check whether the road is very long compared to direct path.
if LongRoad and Shortcut then if LongRoad and Shortcut then
env.info(string.format("FF longroad and shortcut"))
-- Road is long ==> we take the short cut. -- Road is long ==> we take the short cut.
table.insert(route, FromCoordinate:WaypointGround(Speed, OffRoadFormation)) table.insert(route, FromCoordinate:WaypointGround(Speed, OffRoadFormation))
table.insert(route, ToCoordinate:WaypointGround(Speed, OffRoadFormation)) table.insert(route, ToCoordinate:WaypointGround(Speed, OffRoadFormation))
else else
env.info(string.format("FF longroad and shortcut else"))
-- Create waypoints. -- Create waypoints.
table.insert(route, FromCoordinate:WaypointGround(Speed, OffRoadFormation)) table.insert(route, FromCoordinate:WaypointGround(Speed, OffRoadFormation))
table.insert(route, PathOnRoad[2]:WaypointGround(Speed, "On Road")) table.insert(route, PathOnRoad[2]:WaypointGround(Speed, "On Road"))
@ -2047,7 +2048,6 @@ do -- Route methods
-- Add the final coordinate because the final might not be on the road. -- Add the final coordinate because the final might not be on the road.
local dist=ToCoordinate:Get2DDistance(PathOnRoad[#PathOnRoad-1]) local dist=ToCoordinate:Get2DDistance(PathOnRoad[#PathOnRoad-1])
if dist>10 then if dist>10 then
env.info(string.format("FF longroad and shortcut else dist>10"))
table.insert(route, ToCoordinate:WaypointGround(Speed, OffRoadFormation)) table.insert(route, ToCoordinate:WaypointGround(Speed, OffRoadFormation))
end end