You are viewing a single comment's thread from:

RE: The AI Contest #1: public goods problem

in #aicontest7 years ago

Here's a Conservative bot to fuel the contest. Not a great one, I'm not here to grab the reward, but it will populate the arena. Feel free to provide more than one bot each.

Conservative will play ten until it sees that others are selfish, then becomes and stays selfish.

def getSteemUser(self):
  return "@gbd"

def think(self, context):
  self.lastMove = self.thinkDetails(context)
  return self.lastMove


def thinkDetails(self, context):
  # First round: TEN
  if (context.roundIndex == 0):
      return Bet.TEN

  # Other rounds: were they generous last turn?
  nbUrchins = sum(c.previousMoves[context.roundIndex-1] == Bet.NOTHING for c in context.playerContexts.values())

  if (self.lastMove == Bet.NOTHING or nbUrchins > 6):
    return Bet.NOTHING

  return Bet.TEN

Coin Marketplace

STEEM 0.24
TRX 0.21
JST 0.036
BTC 97936.99
ETH 3366.06
USDT 1.00
SBD 3.35