create/use payoff matrix

92 views
Skip to first unread message

rbsoc...@gmail.com

unread,
Sep 22, 2023, 2:10:08 PM9/22/23
to netlogo-users

I need to set up a game theory-based payoff matrix.  There are two players (A/row and B/col) each with two identical alternatives (x and y).  My matrix is:

[[-1,2][-2,-1]]

[[2,-2][1,1]]

So two questions: What’s the best way to create this matrix? Then how can I retrieve values from the matrix to create score variables for each player?

Thanks, RB

James Steiner

unread,
Sep 22, 2023, 6:05:52 PM9/22/23
to rbsoc...@gmail.com, netlogo-users
NetLogo Lists are a fine way to do this.

--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/a2579670-3e48-4d2f-88d7-18bbcfcc20d5n%40googlegroups.com.

Chris Ruebeck

unread,
Sep 23, 2023, 10:35:31 AM9/23/23
to netlogo-users, rbsoc...@gmail.com, ja...@turtlezero.com
Agreed, and you’re almost there. Start with the Lists entry in the User Manual’s Programming Guide section, and go from there. Pay particular attention to lists of lists and using the ‘item’ command.

You can use ‘myself’ to have one turtle’s action index the payoff to the sublist indexed by the action of turtle that it’s playing with (where ‘action’ is a turtle variable). Of course, there are other ways to do it that are less “in the language”.

On Sep 22, 2023, at 6:05 PM, James Steiner <ja...@turtlezero.com> wrote:



rbsoc...@gmail.com

unread,
Sep 25, 2023, 11:50:11 AM9/25/23
to netlogo-users
Thanks.  Will look at list of lists.  May go with the more clunky but less complex series of ifelse statements.
RB
Reply all
Reply to author
Forward
0 new messages