reset password
Author Message
rabbott
Posts: 1649
Posted 08:25 Mar 03, 2018 |

Yesterday I said that you can't encode the Unforgiving strategy in our current strategy language. But that's not true. It's easy to encode the Unforgiving strategy.

    (list "unforgiving" "U" [ [ [0  -1] ] ]   -1 ]  ;; If the other player defects, then defect.
                            [ [ [-1  0] ] ]   -1 ]  ;; If I defected last time, defect again.
                                                    ;; (Once the other player defects I will defect forever.)
                            [ [           ]    1 ]  ;; Start with cooperating. Continue cooperating until the other player defects. 
                                                    ;; In that case, the first rule say to defects.
                                                    ;; The second rule reminds me that I defected the last time. So Defect again.

    )
 

That should work for the Unforgiving strategy -- sometimes called Grim Trigger.

But one can't count or keep track of state using the current rule language. For example, one version of Generous Tit-for-Tat defects for every other opponent defection (more or less).

State 1 (starting state) Cooperate and.remain in State 1 as long as the opponent cooperates. If the opponent defects go to State 2.

State 2 Similar to State 1. Cooperate and remain in State 2 as long as the opponent cooperates. If the opponent defects, go to State 3.

State 3. Defect as long as the opponent defects and stay in State 3. If the opponent cooperates. go to State 1.

I don't see a way to implement this strategy using the current strategy language. The current language can't keep track of states.

It shouldn't be too hard to add extra fields to the current strategy language to handle states. Here's how it might look if we call the states A, B, and C.

                           A                    B                   C

                    [ [ 0  1 ] 1 A ]     [ [ 0  1 ] 1 B ]    [ [ 0 -1 ] -1 C ] 

                          [ [ 0 -1 ] 1 B ]     [ [ 0 -1 ] -1 C ]    [ [ 0  1 ]  1 A ] 

  I think this will do Generous Tit-for-Tat if we had states..

Last edited by rabbott at 08:40 Mar 03, 2018.