examples.ipd_model.agents package

Submodules

examples.ipd_model.agents.agents module

Agents for the iterated prisioners dilemma model

class examples.ipd_model.agents.agents.BadPlayer(simulation, model, agent_number, agent_def)[source]

Bases: examples.ipd_model.agents.agents.Player

A player that always defect

class examples.ipd_model.agents.agents.GoodPlayer(simulation, model, agent_number, agent_def)[source]

Bases: examples.ipd_model.agents.agents.Player

A player that always cooperate

class examples.ipd_model.agents.agents.Player(simulation, model, agent_number, agent_def)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

A basic player in the Iterated Prisioners Dilemma

game_payoff(other_name, other_play, other_payoff, my_payoff)[source]

Get the game payoff

play()[source]

The agent plays a strategy

select_game()[source]

The agent select a play from a strategy

step()[source]

agent step

class examples.ipd_model.agents.agents.RandomPlayer(simulation, model, agent_number, agent_def)[source]

Bases: examples.ipd_model.agents.agents.Player

A player that always defect

class examples.ipd_model.agents.agents.TitForTatPlayer(simulation, model, agent_number, agent_def)[source]

Bases: examples.ipd_model.agents.agents.Player

A player that always defect

examples.ipd_model.agents.ipd_action_set module

Basic Strategy Class implementation

class examples.ipd_model.agents.ipd_action_set.AlwaysCooperate[source]

Bases: examples.ipd_model.agents.ipd_action_set.Strategy

Always Cooperate Strategy

class examples.ipd_model.agents.ipd_action_set.AlwaysDefect[source]

Bases: examples.ipd_model.agents.ipd_action_set.Strategy

class examples.ipd_model.agents.ipd_action_set.Game(my_name=None, my_play=None, my_payoff=None, other_name=None, other_play=None, other_payoff=None)[source]

Bases: object

Class Representing a Game

class examples.ipd_model.agents.ipd_action_set.RandomPlay[source]

Bases: examples.ipd_model.agents.ipd_action_set.Strategy

select_strategy()[source]

Random Strategy

class examples.ipd_model.agents.ipd_action_set.SimpleTitForTat[source]

Bases: examples.ipd_model.agents.ipd_action_set.Strategy

select_strategy()[source]

Simple Tit for tat strategy

class examples.ipd_model.agents.ipd_action_set.Strategy[source]

Bases: object

Implementation of the strategy class

get_game(aGame)[source]

Get a game

select_game()[source]
select_strategy()[source]

Module contents

class examples.ipd_model.agents.Player(simulation, model, agent_number, agent_def)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

A basic player in the Iterated Prisioners Dilemma

game_payoff(other_name, other_play, other_payoff, my_payoff)[source]

Get the game payoff

play()[source]

The agent plays a strategy

select_game()[source]

The agent select a play from a strategy

step()[source]

agent step

class examples.ipd_model.agents.GoodPlayer(simulation, model, agent_number, agent_def)[source]

Bases: examples.ipd_model.agents.agents.Player

A player that always cooperate

class examples.ipd_model.agents.BadPlayer(simulation, model, agent_number, agent_def)[source]

Bases: examples.ipd_model.agents.agents.Player

A player that always defect

class examples.ipd_model.agents.RandomPlayer(simulation, model, agent_number, agent_def)[source]

Bases: examples.ipd_model.agents.agents.Player

A player that always defect

class examples.ipd_model.agents.TitForTatPlayer(simulation, model, agent_number, agent_def)[source]

Bases: examples.ipd_model.agents.agents.Player

A player that always defect