0
votes

I'm trying to create a multidimensional array in my anylogic model (the array has to grow by itself, I don't want a max capacity of input - therefore I chose collections instead of variables). The array should contain: date, type of product and number of line that the product was produced. These values are easy to get (they are characteristics of the product I'm producing). But I'm having some troubles initialising my array and also adding information into it. Can someone help me? I want anylogic to add an entrance to the array every time my product gets into my stock, so that I can know how many products of each type were produced on the same day.

1

1 Answers

0
votes

You should create a class... but to make it easier, create a population of agents called myAgents (of type MyAgent).

Each MyAgent will have the parameters date, typeOfProduct and lineNumber

and when your product gets into your stock you add a new agent into the population doing:

add_MyAgents( date, typeOfProduct, lineNumber);

and then if you want to count how many agents are of a certain product type:

count(myAgents,a->a.typeOfProuduct==X);

where X is the type of product you want to count