I need help programming a process in AnyLogic.
I want to assign a specific number to an Agent (50%=1,20%=2,30%=3). And later I want to use the number to add to a stock. For example: if the Agent has the number 3 I want the stock (variable) to go down exaclly this amount.
I tried using a Parameter on the Agent, but I am only able to create a string and with that I can't calculate later…
I would be very happy if anyone knows a solution to the Problem! :)
Here is a simple solution for your case:
Each agent instance will draw a number between 1 and 3 now (50% 1, 20% 2 and 30% 3). Then, you can do your stock adjustments with that param