|
CA4 Intelligent Game Theory
CA4 Intelligent Game Theory Assignment - 2000/2001
The Matrix.
The server will generate a random game matrix which it will send to all
the clients. Each client will have 2 to 5 strategies (the exact number
is randomly generated each game). This is followed by 3 rounds of "negotiating"
where each client can offer other clients a side payment if they play
a specific strategy. These offers, unless specifically revoked are binding.
The order of offers is cyclical with each client taking it in turn to
offer the first side payment offer. In the final phase of the game each
client selects a strategy and the server determines the payout to each
client (including the binding side payments).
You should email your source code and a description of your solution
to: David.Sinclair@computing.dcu.ie
The marks for the assignment will be based on the design of the program,
on the quality of the source code. The deadline for the assignment is
5:00pm, Friday 9th March 2001. Late submission will be penalised
marks.
Source Code:
Server
Example
Client
The server program take 2 arguments. The first is the number of players
and the second is the number of games to be played.
The client program take 1 argument which is it's player number. Player
numbers start at 1.
The example client is a very simplistic implementation and is only here
to give you a skeleton for the communication between the client and the
server. You should be able to develop a much better client than this.
Messages from Server to Client
Who are you?
Message: W
This message requests the client to return an identification string (your
student ID number).
Starting Balance
Message: B[number]
This message informs the player of their initial points balance. The number
field is a string, E.g. S1000
Phase of play
Message: R[phase]
This message informs the player which phase the game is in. R1 indicates
the start of the side payment offer phase and R2 indicates the strategy
selection phase.
Announcing Player
Message: G[player number]
This message announces the next player. For example, G1 announces that
player 1 is next while G2 announces that player 2 is next. The player
number field is a single character representing a digit. Player numbers
start at 1.
Matrix
Message: M [number of players] [number of strategies for player 1] [number
of strategies for player 2] ...
This message downlaod the game matrix to the current player. The values
immediately following the M specify the number of players and the numer
of strategies for each player. The subsequent lines specify the payoffs
for each strategy. For example,
M 2 2 3
1 -3
2 4
-10 -3
1 18
-13 8
0 6
The first line specifies a game with 2 players, where player 1 has 2
strategies and player 2 has 3 strategies. The following lines specify
the payoffs for strategies 1 1, 2 1, 1 2, 2 2, 1 3 and 2 3 repsectively.
Suppose player 1 and 2 select strategies 1 and 3 respectively. Then the
payoff to player 1 is -13 and the payoff to player 2 is 8.
Payoffs
Message: P [player 1 payoff] [player 2 payoff] [player 3 payoff] [player
4 payoff] ...
This message informs the player of their payoff for the game just completed.
The payoff field is a string. For example, P -2 14 -2 -2 specifies a loss
of 2 points to players 1, 3 and 4 whereas player 2 wins 14 points. Player
1 is the first player.
End of Tournament
Message: E
This message informs the player that the tournament is completed and that
the client can terminate.
Messages from Client to Server
Identification
Message: N[ID]
This message informs the server of the ID of the player. The ID field
is a string that represents your student ID. For example, N12345678.
Side Payment Offer
Message: C [player 1 strategy] [side payment to player 1] [player 2 strategy]
[side payment to player 2] ...
This message is a player's offer to another to make the specified side
payment if the player selects the specified strategy. For example, C 2
3 0 0 1 4 offers a side payment of 3 to player 1 if they select strategy
2 and offers a side payment of 4 to player 3 if they select strategy 1.
An offer of zero on any strategy cancels the last offer.
Play Strategy
Message: S [selected strategy]
This message is used to play a strategy. For example, S 4 plays strategy
4. |