title: AnyLogic - transition triggered by a condition
body: <p>i'm new to AnyLogic...but it is driving me crazy!!!</p>
  
  <p>It is super basic...in an AB model I want a percentage of agents to go from one state to another...but it happens something that I cannot understand :S</p>
  
  <p><a href="https://i.stack.imgur.com/8toGx.png" rel="nofollow"><img src="https://i.stack.imgur.com/8toGx.png" alt="enter image description here"></a></p>
  
  <p>I have 1000 agents...I expect 950 to go in state V3...yet
  <a href="https://i.stack.imgur.com/ZfMzL.png" rel="nofollow"><img src="https://i.stack.imgur.com/ZfMzL.png" alt="enter image description here"></a></p>
  
  <p>Only 889 agents change status :(<br>
  It seems that the condition is evaluated twice...indeed 0.95*0.95=0.90..that is exactly the percentage of agents changing status :(</p>
  
  <p>Not satisfied I tried to put the contidion in the "guard"
  <a href="https://i.stack.imgur.com/VUlZX.png" rel="nofollow"><img src="https://i.stack.imgur.com/VUlZX.png" alt="enter image description here"></a></p>
  
  <p>and the result is perfect!!!<br>
  <a href="https://i.stack.imgur.com/EFks8.png" rel="nofollow"><img src="https://i.stack.imgur.com/EFks8.png" alt="enter image description here"></a></p>
  
  <p>Can anyone help me understand this? :( 
  I have to revise the entire model...when do I have to put "conditions" and when "guards"?</p>
  
  <p>Thanks everyone!!</p>
  
  <p>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
  
  <p>from @sdaza model</p>
  
  <p><a href="https://i.stack.imgur.com/ctjsG.png" rel="nofollow"><img src="https://i.stack.imgur.com/ctjsG.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/lNlrS.png" rel="nofollow"><img src="https://i.stack.imgur.com/lNlrS.png" alt="enter image description here"></a></p>
  
  <p>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</p>
  
  <p>AnyLogic Support Team answer </p>
  
  <p>_The condition is evaluated twice in case if it returns true initially. Initial chec is performed when agent enters in state that has outcoming conditional transition(s). If certain condition of a transition returns true, engine tries to trigger it. Here the condition is checked again. If the condition returns false, it will be cancelled, agent remains in the state. In other words, condition should return true twice to be executed.</p>
  
  <p>In your case only the agents that returned "true" twice executed the transition, and probability matches with result: 0.95 * 0.95 = 0.9. This is actual probability.</p>
  
  <p>I hope it will help_</p>
  
  <p>I didn't get the reason why it is so though...</p>