Search code examples
anylogic

DelayBlock Delay Time from database in anylogic


Screenshot of error in Anylogic

I have a simple one machine model in anylogic, I would like the delay time in the delay block to be different for every agent. The values of the delay times are stored in the excel database tabelle1 in the column processing1. does anyone know how to implement this? I only have one type of agent.

I have tried using a database reference in the delay time inside the delay block but I receive the error: not unique database value.


Solution

  • Well, your SELECT statement selects all values of the column. However, the Delay block would like to have ONE value to use for its delay.

    So it is up to you to bring these together:

    • either change the SELECT to add a choice condition which will ensure only 1 value is ever found in the dbase column (i.e. WHERE id=xyz)
    • or switch to a different approach where you load the delay time into individual agents upon their creation (i.e. 1st agent loads 1st entry, 2nd loads 2nd...)

    Either is fine, depends on your model requirements, really. For the latter, study some example models and the step-by-step tutorials to learn more about instantiating agents from data and accessing their characteristics in flow charts (do ALL tutorial models -> https://anylogic.help/tutorials/index.html)