0

I have an agent A. The agent has some parameters. The agent is performing a task. When he completes it, the agent is deleted.

In the meantime, further processes take place in other agents (B-D). In the last step of the process agent (E) is created. A code is to be executed in a state (its state chart). To do this, a parameter of the deleted agent must be accessed.

How can I send/copy parameters of agent A to an intermediate agent, which then sends the parameter to agent E. Thanks for any help. :)

Sihem
  • 1
  • 1
  • I could move the parameters into Main so that they are always available. But I would like to avoid that if possible. – Sihem May 22 '20 at 20:07
  • why would this be difficult? it's just A.parameter1=INTERMEDIATE.parameter1 and do the same for all the parameters or variables you have or INTERMEDIATE.set_parameter1(A.parameter1); – Felipe May 23 '20 at 02:55
  • Or alternatively, simply do not delete agent A but put him into a final state. This way, it cannot do anything but is still available to pass its parameter values. Then only delete it in process E. :) – Benjamin May 23 '20 at 07:03
  • Thank you both. Still, I have questions. Where do I put the code? In agent reactions or in a state just before the agent is deleted? AgentB.set_particlesize(AgentA.particlesize) Agent B is my intermediate agent. So do I need to set a parameter in Agent B with the same name as the parameter in Agent A? – Sihem May 23 '20 at 18:12
  • You put the code where agent A needs to pass it to Agent B. Depends on your model setup, which we don't know. Think where that happens and you found your spot :) – Benjamin May 24 '20 at 10:51

0 Answers0