reset password
Author Message
rabbott
Posts: 1649
Posted 16:51 Mar 02, 2018 |

The PD code is available here. It also uses utils.nls, which has one or two additional procedures from the one used by the GA. 

When you run it, every once in a while you will see some text appearing in the view. The describes a single PD contest. The two players face each other. (They look like they are kissing.) There are two lines of text -- one for each player. Each line show: the relevant history, the player type, the move the player makes and the payoff for that player. The attached file illustrates. A Pavlov player is playing against an Always Defect player. The Pavlov relevant history (the previous game between these two) showed that they both played Defect (-1). The Always Defect player has no relevant history since it defects no matter what. Plavlov switched from -1 to 1. Always Defect played -1. The payoff for Pavlov was 0; it was 5 for Always Defect.  If this is the first time the two players are playing against each other, there will be no relevant history.

The world does not wrap either horizontally or vertically. When a player reaches an edge it turns randomly until it can move legally. There are three reasons that players don't pair up even if they are close enough. (a) If their x-coordinates are too close the two written lines will overlap. (b) Iif a player is too close to the bottom of the view, the written line will be off the screen. (c) If a player is too close to the left edge, its line will be off the screen -- at least in part.

See what sorts of strategies you can generate. This page has more strategies than you will want to look at. Some of them can't be implemented in our system as it stands since they essentially change their strategies under various circumstances. (Let me know If you can find a straightforward way to modify the code to support such strategies! If you are a clever coder, it might not be too difficult.)

Post any questions on this forum. (Not necessarily as a reply on this topic. Feel free to start a new topic.)

 

P.S. Here's a concise PD description.

 

 

Last edited by rabbott at 16:59 Mar 02, 2018.
rabbott
Posts: 1649
Posted 09:34 Mar 05, 2018 |

The current version of this code includes a means for users to express their strategies using states. It also includes strategies.nls, a file that expresses a number of strategies in the strategy language, including generous tit-tot-tat.

Last edited by rabbott at 09:41 Mar 05, 2018.