title: access variables in "Main" from another agent (anylogic)
body: <p>I have a model as shown below with two situations, I am running it for two situations.</p>
  <p>In the first run (for situation1), I write traceln function as &quot;traceln(productDemand)&quot; in the &quot;event-generateDemand&quot; placed in &quot;Main&quot;. At the end of simulation, I get the values in the first column below.
  2)In the second run (for situation2), for once I write traceln function as &quot;traceln(main.productDemand)&quot; in the &quot;event&quot; placed in &quot;Producer&quot; agent.At the end of the second simulation, I get the values in the second column below.</p>
  <p>Normally, these two values are always same , it expected that at the every simulation time they have to be same, but they are not same as shown in the Fig.1. what's the problem? Why the &quot;productDemand&quot; variable is different when we try to access from another agent at the same time?</p>
  <p>I hope I was able to explain my problem.</p>
  <p>Fig.1-  The obtained results as table format
  Fig.2-  The screenshot of Event placed in Main
  Fig.3-  The screenshot of Event placed in Producer agent
  Fig.4-  The obtained results for both traceln functions on the running
  Fig.5-  Simulation experiment screenshot.</p>
  <p><a href="https://i.stack.imgur.com/0lkRF.png" rel="nofollow noreferrer">fig.1</a></p>
  <p><a href="https://i.stack.imgur.com/9L4Nh.png" rel="nofollow noreferrer">fig.2</a></p>
  <p><a href="https://i.stack.imgur.com/2WPZI.png" rel="nofollow noreferrer">fig.3</a></p>
  <p><a href="https://i.stack.imgur.com/raNtO.png" rel="nofollow noreferrer">fig.4</a></p>
  <p><a href="https://i.stack.imgur.com/jF2qa.png" rel="nofollow noreferrer">fig.5</a></p>