0
votes

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

2
Can you clarify? It seems like you describe the following:Amy Brown Greer
a source block creating all clients (total over all fields), and then the custom distribution using the relative values to give you a probability.Amy Brown Greer
Yes, thats exactly what I want to do. Sorry, if my text is confusing. I also tried this approach: creating a table, where the values are not summed up (as shown in the tutorial video). Here I have the problem, that I can choose my table, but there is no value column to choose from.ACJ

2 Answers

0
votes

Okay, I found a solution to both problems:

1) Seemingly Anylogic cannot build a custom distribution from summed up values, as it does the sum by itself internally.

2) After creating the big table with over 20.000 values instead of the 400 sums, I could'nt choose a value column (see picture). I recreated the big table and changed the values from "f1" to "1" (String to int). And now it works. So Seemingly, Anylogic can only process intergers, but not Strings in its custom distribution database function.

Feel free to correct me, if this is wrong.

0
votes

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