user2520051
user2520051

Reputation:

getting the name of the variable with the maximum value in anylogic

In anylogic, I have some variables(more than 2) and I want to know which of them has the maximum value? How can I do that? where can I save the name of the maximum variable?

Upvotes: 0

Views: 242

Answers (1)

Benjamin
Benjamin

Reputation: 12705

getting the maximum value of a number of values is not an AnyLogic problem but a general coding problem which stackoverflow probably has hundreds of answers for.

In AnyLogic, you could add all your variables to a statistics object. Then call myStatisticsObject.max() to get the maximum.

To save that in a new variables, call newVariable = mtStatistics.max()

cheers

Upvotes: 1

Related Questions