0
votes

I am building a DES-ABM hybrid model in AnyLogic. The agents go through the DES blocks, among which multiple Delay blocks.

How do I

  1. access an agent which is in a Delay block or peferrably
  2. acces the specific agent which triggered the 'on enter' action of the delay block?

My ultimate goal is to open or close a valve object on the agent frame So can I/ how do I A. open or close the valve on the agent frame directly form the main/root frame (on which the Delay block is located) or if that is not possible B. send a message or trigger a statechart within the specific agent which will then open or close the valve from the agent's own frame?

I have tried to use the 'DelayBlockName'.agents() function, but this does not work and returns [] when I check it using traceln.

1

1 Answers

0
votes

access an agent which is in a Delay block or peferrably

use the keyword agent. These keywords differ for different library blocks so best start learning about the lightbulb and how it can help, see here.

acces the specific agent which triggered the 'on enter' action of the delay block?

When you write agent. in the "On enter" block, every agent coming through will execute that code, so by definition, it is always the specific agent :)

My ultimate goal is to open or close a valve object on the agent frame So can I/ how do I A. open or close the valve on the agent frame directly form the main/root frame (on which the Delay block is located) or if that is not possible B. send a message or trigger a statechart within the specific agent which will then open or close the valve from the agent's own frame?

this is something completely different to your original question and just... messy. Please limit questions to 1 topic so it is easy for us to answer :) (see this guide for more)