I am currently trying to divide an agent's vision into multiple areas from two in-cone
rather than him perceiving with only one area from a radius
.
More concretely, what I am looking to achieve is to get :
- a cone in front of the agent and centered on its orientation
- two peripheral cones distinct from the frontal cone and with the same angle values
- a blind zone behind the agent.
To obtain these two distinct types of vision angles (one in front and two in the periphery) I started by defining two global variables (inspired by the idea of this post):
globals [
vision-peripheral
vision-front
]
In order to get two patch sets
as follows :
to get-vision
;; define angles
set full-angle full-angle ; beta angles
set front-angle front-angle ; alpha angle
set perception-distance perception-distance ; perception distance
set vision-front patches in-cone perception-distance front-angle
set vision-peripheral patches in-cone perception-distance full-angle with [not member? self vision-front]
ask vision-peripheral [set pcolor white] # for debug purpose
ask vision-front [set pcolor green] # for debug purpose
end
What I want to do from now on is to detect whether one or more other agents are located in the area in front of me, but also in the right or left peripheral parts. I managed to detect that an agent is located in the peripheral zone by accessing global variables, but I can not know if the agents are exactly located in the right (or left) part of this zone :
to detect
if (any? other turtles-on vision-peripheral)
# how to know in which parts instead of only other turtles in vision-peripheral ?
end
How can I detect in which exact part one or more turtles are located? Ideally, it be helpful to know the exact number of turtles in each zone at each time t.
Thanks for any help