Anesu
Anesu

Reputation: 37

Compute the max within a report

I am trying to compute the max{} within a report statement in netlogo.

I currently have the following expression:

report bestBid + (max{cost, bestAsk}- bestBid)/n

I intend to report a bid to a procedure requiring a bid to be submitted.

Upvotes: 1

Views: 49

Answers (1)

Seth Tisue
Seth Tisue

Reputation: 30453

max only works on lists, so you need to put the values in a list:

max list cost bestAsk

you might decide it reads a bit better with parentheses:

max (list cost bestAsk)

Upvotes: 1

Related Questions