title: how can I free pedestrians from a waiting area according to train arrival schedule in Anylogic?
body: <p>I have train station model, and have train arrival schedule. I want pedestrians to wait in the waiting area until the train arrives and the passengers on the train get off the train first. I tried to use 'hold', event, and free() function call and release pedestrians from the waiting area by using a counter of pedestrians getting off the train and get on the escalator</p>
  <p>*if the number of passengers getting off the train is equal to the passengers getting on the escalator then the counter will be equal to zero and this satisfy the condition where pedestrians in the waiting area should be released to get on the train.</p>
  <p>if ( counter == 0 ) {</p>
  <p>hold . unblock();</p>
  <p>}</p>
  <p>else {</p>
  <p>hold. block();</p>
  <p>}</p>
  <p>however, it did not work. It either hold the pedestrians for ever or ignore the script and head to train even if the train has not arrived yet.</p>
  <p>can you please help me ?</p>