Search code examples
javaanylogicdynamic-variablessystemdynamics

Anylogic - access variables from other agents


I am trying to model a production infrastructure in anylogic which consists of several agents. One of it is a "steam network" (system dynamics) which starts with a flow from nowhere. The dynamic value of this flow is supposed to be the steam output of another agent. Unfortunately, I can't figure out how to link the flow to the steam production (dynamic variable) of my agent "machine".

I appreciate all your help.


Solution

  • To clarify the model navigation, take this example model I made: enter image description here

    It has 2 different agents embedded on main. "OtherAgent" has 1 variable v_DefiningFlowRate of type double, set to 12.

    The second agent on Main "SysDynAgent" has a flow object that pulls the flow rate from "OtherAgent" by navigating to it correctly: enter image description here

    this is what you need to adapt to in your model