title: How can I handle different materials in one flowchart in Anylogic?
body: <p>For my flow chart I generate three different agents via different sources. Now I want to handle them differently in diverse blocks in the flow chart. For instance, I want to have a different delay time for the agents. Since I am new to AnyLogic and not that good with Java, I have problems to understand how to handle the agents in my model.</p>
  <p>I gave the agents a string-parameter with a name and tried to use a function with an if-else-statement to differentiate the agents in the delay. My approach is summarized in the following image (I hope I did it right):</p>
  <p><img src="https://i.imgur.com/AGZGmCU.png" alt="" /></p>
  <p>The code in the function is:</p>
  <pre><code>if (agent.TypeComponent == &quot;blade&quot; || agent.TypeComponent == &quot;narcelle&quot;)
  return uniform(3.5, 6);
  else return uniform(1, 3);
  </code></pre>
  <p>I get the error report (translated from german):</p>
  <blockquote>
  <p>agent cannot be solved to a variable.</p>
  <p>the method delayPrepFeeder() in type Main is not applicable for the arguments (Agent)</p>
  </blockquote>
  <p>Thank you and kind regards.</p>