Anylogic: how to calculate the cumulative sum?

232 views Asked by At

I would like to know how to calculate the cumulative sum in Anylogic. Specifically, I have a cyclic event that changes the value of a parameter every week. From this parameter I would like to calculate the cumulative sum of the values it received, how can I do that ?

The event is a Timeout with mode Cyclic. The action is:

"name_parameter"=round(max(normal(10,200),0));

1

There are 1 answers

3
Emile Zankoul On BEST ANSWER

Create a parameter with an initial value of 0. Call it sum. In the event action field use:

name_parameter = round(max(normal(10,200),0));
sum += name_parameter;