Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #3113

Re: Basic prisoner's dilemma?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Basic prisoner's dilemma?
Date Mon, 18 Apr 2011 21:26:29 +0200
Organization A noiseless patient Spider
Lines 30
Message-ID <ioi390$90n$1@dont-email.me> (permalink)
References <d97822e4-ee7c-458d-8818-07007fb714e8@k3g2000prl.googlegroups.com> <iohs19$f1g$1@dont-email.me> <iohsn8$hri$1@news.albasani.net>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Mon, 18 Apr 2011 19:26:24 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="TdHps3CX+e9UB6Yx/BzU0w"; logging-data="9239"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wyZR2onCVChJB06/janMp"
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
In-Reply-To <iohsn8$hri$1@news.albasani.net>
Cancel-Lock sha1:tL1Fgte8mTiPzi3N0L6plbxIxCY=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3113

Show key headers only | View raw


On 18/04/2011 19:34, Lew allegedly wrote:
> Daniele Futtorovic wrote:
>> Basic tit-for-tat is as follows:
>> - if it's the first time you encounter that opponent (this implies you
>> keep a 'memory' of previous encounters), cooperate.
>> - otherwise, replicate that opponent's last move.
>>
>> In code (assuming oppHistory contains only the history with "this"):
>>
>> public String chooseAction(
>> ArrayList<String> myHistory, ArrayList<String> oppHistory)
>> {
>> return oppHistory.isEmpty() ? "COOPERATE"
>> : oppHistory.get( oppHistory.size()
> - 1
>> );
>> }
>> (or oppHistory.get(0), depending on whether it's used as a FIFO or a
>> LIFO).
>>
>>
>> You can add various tricks, but don't expect to get far with them,
>> because tit-for-tat is the evolutionary stable strategy.
>>
>> If you're interested in the topic apart from the programming aspect, I
>> *very* strongly suggest you read Dawkins' "Selfish Gene" and "Blind
>> Watchmaker". Even if you're not, by the way -- those are IMHO must-reads.
>

Well spotted. Thanks, Lew.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Basic prisoner's dilemma? theglazeb <theglazeb@gmail.com> - 2011-04-17 19:51 -0700
  Re: Basic prisoner's dilemma? Lew <noone@lewscanon.com> - 2011-04-17 23:15 -0400
    Re: Basic prisoner's dilemma? Esmond Pitt <esmond.pitt@bigpond.com> - 2011-04-18 13:54 +1000
      Re: Basic prisoner's dilemma? theglazeb <theglazeb@gmail.com> - 2011-04-17 22:08 -0700
        Re: Basic prisoner's dilemma? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-04-17 23:47 -0700
        Re: Basic prisoner's dilemma? markspace <-@.> - 2011-04-18 00:14 -0700
  Re: Basic prisoner's dilemma? rossum <rossum48@coldmail.com> - 2011-04-18 13:01 +0100
  Re: Basic prisoner's dilemma? Bent C Dalager <bcd@pvv.ntnu.no> - 2011-04-18 13:38 +0000
  Re: Basic prisoner's dilemma? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-04-18 19:22 +0200
    Re: Basic prisoner's dilemma? Lew <noone@lewscanon.com> - 2011-04-18 13:34 -0400
      Re: Basic prisoner's dilemma? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-04-18 21:26 +0200
        Re: Basic prisoner's dilemma? Lew <noone@lewscanon.com> - 2011-04-18 16:33 -0400
          Re: Basic prisoner's dilemma? Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-04-18 23:50 +0200
            Re: Basic prisoner's dilemma? Lew <noone@lewscanon.com> - 2011-04-18 18:37 -0400
              Re: Basic prisoner's dilemma? markspace <-@.> - 2011-04-18 15:51 -0700
    Re: Basic prisoner's dilemma? Michael Wojcik <mwojcik@newsguy.com> - 2011-04-19 16:14 -0400

csiph-web