0

I have a system dynamics calculation which is currently working extremely well using a single parameter value however I would like it to source from a database. Using this AnyLogic help I have set up the parameter to source from the database.

However in order to set up the "Choice condition" to cycle through the values in the table, I would like to set up a event or something to define which row should be used.

I assume I will need to set up a state chart with an event maybe to go from 1 to a defined number, by adding 1 at a given rate.

Any help would be appreciated, Thank you

  • Sorry, quite unclear what you actually need to achieve, can you share your dbase structure, what you need and what you tried (and failed)? State chart is likely the wrong setup for this. Please also read https://stackoverflow.com/help/how-to-ask and https://www.benjamin-schumann.com/blog/2021/4/1/how-to-win-at-anylogic-on-stackoverflow – Benjamin May 02 '21 at 12:22
  • impossible to understand this question – Felipe May 02 '21 at 15:05

1 Answers1

0

To clarify, Choice condition in this case refers to the database query. In the example, Choice condition refers to the name property of an incoming agent object, however it can be any variable in the model. Let's say there are three record in the database with record ids set to 1,2,3. Cycling through them can be done using the following approach:

  1. create an integer property called 'currentChoice'
  2. have a state chart that changes that property periodically (assuming it is time-based)
  3. check the current value of the 'currentChoice' property in the database Choice condition

This suggestion is based on the info provided, of course, if a bit more information about the purpose of this model is shared then maybe a better approach can be devised.

Artem P.
  • 816
  • 1
  • 6
  • 8