0

I am trying to make a model to simulate the contagion of covid in public spaces using a mix between SEIR and pedestrian models. and I was stuck when using my population of agents with the pedestrian library. Looking in the documentation about pedSource I was able to make it add the agents it created to the population. but I want that when the agent leaves the space of the simulation it is not deleted and then that agent can reappear through the entrance. For this reason I am using a pedEntry and pedExit and send the agents to another space where they wait in queues until they return to the main space of the simulation. Is there any documentation that talks about using a static population with the pedestrian library?

NicolasA13
  • 15
  • 3

1 Answers1

1

You can convert your peds into normal agents if you like. You should do that as soon as you do not need the pedestrian capabilities, as they eat a lot of processing power.

Simply create a normal agent type and duplicate the parameters that you need.

Then, create an agent in PedSink using the ped's characteristics before it is destroyed.

Pro tip: You can even use a parent agent type that your PedAgent type and your normal AgentType inherit from. It can hold all the characteristics, so no need to duplicate elements ;)

Benjamin
  • 10,603
  • 3
  • 16
  • 28
  • Thank you so much! your answer was very useful to guide me to do what I want. I think I did it but I have another question, the state of my person (Susceptible, Exposed, Infected, Recovered) I save in a statechart. But I don't know how to copy the state of the statechart in the pedSource, I am currently sending a message to change the state but this is wrong because it restarts the timeout so it never changes state – NicolasA13 Aug 25 '21 at 17:37
  • HI @NicolasA13 happy to help. If this answer was useful, please flag it as such (up arrow next to the reply), helps others with similar problems to find it in the future. For new questions, always open a new issue, see https://stackoverflow.com/help/how-to-ask and https://www.benjamin-schumann.com/blog/2021/4/1/how-to-win-at-anylogic-on-stackoverflow – Benjamin Aug 26 '21 at 06:02