diff --git a/profiles/rasterbot-interp.lua b/profiles/rasterbot-interp.lua index 42c98b6f4..1b2969ea6 100644 --- a/profiles/rasterbot-interp.lua +++ b/profiles/rasterbot-interp.lua @@ -32,15 +32,15 @@ end function segment_function (source, target, distance, weight) local sourceData = sources:interpolate(raster_source, source.lon, source.lat) local targetData = sources:interpolate(raster_source, target.lon, target.lat) - print ("evaluating segment: " .. sourceData.datum .. " " .. targetData.datum) + io.write("evaluating segment: " .. sourceData.datum .. " " .. targetData.datum .. "\n") local invalid = sourceData.invalid_data() if sourceData.datum ~= invalid and targetData.datum ~= invalid then local slope = math.abs(sourceData.datum - targetData.datum) / distance - print (" slope: " .. slope) - print (" was speed: " .. weight.speed) + io.write(" slope: " .. slope .. "\n") + io.write(" was speed: " .. weight.speed .. "\n") weight.speed = weight.speed * (1 - (slope * 5)) - print (" new speed: " .. weight.speed) + io.write(" new speed: " .. weight.speed .. "\n") end end diff --git a/profiles/rasterbot.lua b/profiles/rasterbot.lua index 847384ddf..f9fd527b9 100644 --- a/profiles/rasterbot.lua +++ b/profiles/rasterbot.lua @@ -32,15 +32,15 @@ end function segment_function (source, target, distance, weight) local sourceData = sources:query(raster_source, source.lon, source.lat) local targetData = sources:query(raster_source, target.lon, target.lat) - print ("evaluating segment: " .. sourceData.datum .. " " .. targetData.datum) + io.write("evaluating segment: " .. sourceData.datum .. " " .. targetData.datum .. "\n") local invalid = sourceData.invalid_data() if sourceData.datum ~= invalid and targetData.datum ~= invalid then local slope = math.abs(sourceData.datum - targetData.datum) / distance - print (" slope: " .. slope) - print (" was speed: " .. weight.speed) + io.write(" slope: " .. slope .. "\n") + io.write(" was speed: " .. weight.speed .. "\n") weight.speed = weight.speed * (1 - (slope * 5)) - print (" new speed: " .. weight.speed) + io.write(" new speed: " .. weight.speed .. "\n") end end