I can create an Anylogic database with one column (Column1) being a date/time, and a second (Column2) being a value, representing minutes. How can I create agents that arrive into the model based on the time Column1 - Column2?
I can create an Anylogic database with one column (Column1) being a date/time, and a second (Column2) being a value, representing minutes. How can I create agents that arrive into the model based on the time Column1 - Column2?
Here are the steps to do:
Date and how to subtract values via StackOverflow, millions of people had similar issues)MyDynamicEvent or similarcreate_MyDynamicEvent(timeToStart, timeunit) and provide it the ime to be called. If unsure what this is, check the help and example models on Dynamic EventsmyAgents by calling add_MyAgents()This will create 1 agent for each data row at the point col1-col2
(There will be several hurdles along the way: If you get stuck, please add new questions, see https://www.benjamin-schumann.com/blog/2021/4/1/how-to-win-at-anylogic-on-stackoverflow )
Good luck
Unless there is a specific reason you can't add a third column that has the arrival time calculated for you (i.e. Column 3 = Column 1 - Column 2) I would strongly suggest that you make use of the standard AnyLogic functionality in the source block to create your agents.
See example below and more details in this questions - https://stackoverflow.com/a/68708035/4019094
Then you can effortlessly not only setup the arrival of agents but also populate their parameters from the DB table.
If you cant make changes to the DB table then dynamic events as per Benjamin's answer is the only way to go.