Search code examples
anylogic

Setting condition in selectOutput block


I have an selectOutput block in which I would like agents of type Patient to continue through OutT if they have passed through a particular timeMeasureStart block. After passing agent.timeMeasureStart in the condition, I receive 'timeMeasureStart' cannot be resolved or is not a field.


Solution

  • Create a variable for your agent type Patient. Let's say you name it tmsTrue. Make the variable of type boolean. In the On Enter field of the timeMeasureStart block write:

    agent.tmsTrue = true;
    

    enter image description here

    Then set your select output condition as:

    agent.tmsTrue == true
    

    enter image description here

    Of course make sure that the variable's initial value is set to false.

    enter image description here