解析Prisoner’s Dilemma Coding、Java编程语言解析、Java程序讲解留学生

- 首页 >> Java编程

"#$$ Research Park Drive ?Fitchburg WI $89:: ?(43.045°N, 89.298°W)

(W) mandli.com ? (P) #DE.E8$.8$DD ? (F) EEE.$F$."":F

The Prisoner’s Dilemma Coding Challenge

Overview

Your task is to implement a competitor, or agent, to compete in a

round-robin tournament of the Iterated Prisoner’s Dilemma.

Details

Your entry will be evaluated on the following criteria:

- Code quality

- Clarity

- Ingenuity

- Your agent’s total score in the tournament

The tournament will consist of multiple matches that pit each agent

against an instance of itself, and against all other available

competitors. The four other agents you will be competing against have

already been created: AlwaysCooperate, AlwaysDefect, Random, and

TitForTat. A match is a repeated sequence of rounds between two Agent

instances, A and B. Each round requires the participating agents to

submit one of two possible actions: COOPERATE or DEFECT. Both agents

submit their action prior to knowing what the opposing agent has

submitted. A round is then scored as follows:

----------------------------------------------------

| | A Cooperates | A Defects |

|----------------|----------------|----------------|

| B Cooperates | A: 3 | A: 5 |

| | B: 3 | B: 0 |

|----------------|----------------|----------------|

| B Defects | A: 0 | A: 1 |

| | B: 5 | B: 1 |

----------------------------------------------------

"#$$ Research Park Drive ?Fitchburg WI $89:: ?(43.045°N, 89.298°W)

(W) mandli.com ? (P) #DE.E8$.8$DD ? (F) EEE.$F$."":F

Getting Started

Before you begin, you'll need Java SE Development Kit 8 (available

here http://www.oracle.com/technetwork/java/javase/downloads/jdk8-

downloads-2133151.html).

You'll first need to create an implementation of com.mandli.ipd.Agent.

This will involve implementing the

Agent.performAction(ActionProcessor) method. The method accepts an

ActionProcessor, which will take the agent's action and return a

result in the form of com.mandli.ipd.Result. This result provides two

pieces of information: The agent's reward or score for that round, and

the opposing agent's action.

Once you have an Agent implementation that you'd like to try out, add

a reference to its constructor in the AGENT_FACTORIES list at the top

of com.mandli.ipd.IPD. The four agents you'll be competing against

have already been added.

The tournament can be run via the main method in com.mandli.ipd.IPD.

Results are written to standard out.

Tips

While writing your Agent implementation, take some time to explore the

rest of com.mandli.ipd to see how your competitors will behave, and

get a sense for how the rest of the program is working as a whole.

Good Luck!

The Technology Team

Mandli Communications, Inc.

2655 Research Park Drive

Fitchburg, WI 53711

(608) 835-3500


站长地图