Search code examples
distributionagentanylogic

Anylogic - Custom distribution with summed up values?


I need help with defining a custom distribution with Anylogic. I have a grid with 400 fields, each representing a geographical area. I measured the number of Clients per day in each field empirically (so I have a sum for each field).

Now I want to do a stochastic simulation. The number of generated agents (clients) is generated as a rate per day (as measured empirically as total over all fields). The number of the field should be assigned randomly as distribution, where "the probability that the client is generated in field x" equals "the number of clients in measured field x divided by the total number". I have these numbers as a table (database). The problem is that the Custom distribution block wants to read a table with all values (so that if field x has 5 clients per day, I would need to enter 5 times the number x).

Does anyone have a better idea how to solve this problem? Thank you!

Or do you know how to generate agents by database, with attributes by some probabilty?

PS: I want to generate the field ID, because there is more information attached to each field.

Edit: if I make a table with all the values listed x times, I cannot choose a value column: CustomDistribution for Start Fields


Solution

  • Set your custom distribution to "Continuous" with interpolation of "None". For each value, you can have whatever you want in the weight column - this can be a precalculated sum. The no interpolation will give you exactly one of the entered values, which could be a real number, but in this example are just discrete (1,2,3).

    enter image description here