what happens is the cars move throughout the simulation and so do the people in the image, the blue car at the moment is on coordinate (16,-2) and the people are on (20, -5) (20,-6) (20,-7) and (20, -8) respectively, what I want to do is make any car that is directly infront of a person to slow down and not hit the person, or go into the same patch.
So for example, if the car drives to patch (19, -2) and a person is on patch (20,-2) the car stops, like when you're pulling the brakes of your car and lets the person pass. I tried this
And this does not work, it just slows down every car, even cars that are behind the current car (there are multiple cars in the simulation), please how do i fix this? The in-cone should check what is ahead of the turtle but it seems not to be doing so.
And on the minor note, I have a global variable value which keeps tracks of the amount of times the car has collided with a person and that works fine, this is the code for it
How do I overcome this?