1

I am trying to do modeling using Anylogic pedestrian library where an agent (A) will communicate with another agent (B) only if the other agent is within certain vision angles and arc radius of A. The conventional way of communication is to define certain distance based communication where the distance defined forms a sphere around the agent. But I want to model that the agent will not be able to communicate with other agents who are not within his vision angle (like a conical projection & certain distance). For example, the agent should not be able to communicate with others who are behind him. How I can do this?

Also, I am trying to model individual agents behavior (those abovementioned pedestrian agents) through agents statechart. Unfortunately, agent states aren't changing based on communication in my model. Is it due to using pedestrian library? Can we model pedestrian agents behaviour by statechart? It would be a great help if someone can answer those questions.

Tariq
  • 57
  • 6

1 Answers1

1

you can use just a polygonal node or area and use it like this: field of vision

if you want to evaluate if a pedestrian or agent is in the field of vision, you need to get x and y for that agent and do:

if(fieldOfVision.contains(x,y))
//communicate with that dude
Felipe
  • 8,311
  • 2
  • 15
  • 31
  • Thanks a lot Felipe for your response! In my model, as agents are continuously moving, how I can find the value of X & Y as it's not fixed value? It Will be helpful if you guide me on how I can know who is within this polygonal node. Additionally, is fieldOfVision a built in function? – Tariq May 18 '20 at 05:34
  • also, after drawing the polygonal node in agent statechart, how I can incorporate that area/vision information in the code? Sorry for my consecutive question. I can't resist to get the insight from an expert like you. thanks again. – Tariq May 18 '20 at 05:39
  • you said in your question, you find the agents that are at a certain distance, and based on that filter you find their x,y coordinates and check if they are inside the field of vision... – Felipe May 18 '20 at 06:50