Reputation:
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
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