I was using this code yesterday and was changing it elsewhere and it was working fine until I shut everything down. This morning, when resuming my work, Netlogo started giving me an END expected error for this procedure:
to calculate-emissions [car-turtle]
let status [movement-status] of car-turtle
let slope_1 [p-slope] of patch-here
let speed_1 [speed] of car-turtle
let car-type_1 [car-type] of car-turtle
let distance-traveled_1 [distance-traveled] of car-turtle
let emission 0
foreach emission-data
[ row ->
if (item 0 row = status and
check-slope (item 1 row) slope_1 and
item 2 row = speed_1)
[ set emission get-emission-for-type row car-type_1 ]
]
ask car-turtle [ set emissions emission ]
end
I can't see anything wrong with it. Why would it suddenly start giving me this error when the same software, same version and same code worked fine yesterday?
Thanks