revtut/AIAD

Communication messages

Closed this issue · 2 comments

Create the communication messages protocol between the agents.

Life Cycle

Setup the game

JoinGame
An agent sends a message to the board requesting to join the game.

SetPlayerRole
The board broadcasts a message to all the players about their roles in the game.

SetInitialBalance
The board broadcasts a message to all the players about their initial balance.

Set the round environment

PreRound
The board broadcasts to all the players informing that the pre-round has started.

UpdateInvestorCompanies
The board broadcasts a message to all investors about the companies for the round and their managers.

UpdateManagerCompanies
The board broadcasts a message to all managers about their companies for the round.

Start round

StartRound
The board broadcasts a message to all players telling the negotiation has started.

SendOffer
An investor sends an offer to a manager. It contains a field with the closeness of the offer.

ReplyOffer
A manager sends an accept or decline answer to the investor. If it is a “closed” deal, the manager sends a CloseCompany message.

CloseCompany
A manager broadcasts a message to all the investors informing that a company is. no longer available for negotiation in that round.

OutbidOffer
A manager sends a message to the previous investor informing that his offer was outbid.

WithdrawOffer
An investor sends a message to a manager withdrawing its offer. The manager sends an AvailableCompany message.

AvailableCompany
The manager broadcasts to the previous offers' investors informing that the company’s highest bid was withdrawn.

End round

EndRound
The board broadcasts to all the players informing that the negotiation round has finished.

SendOffers
A manager sends a message to the board about his accepted offers when the round ends.

UpdateBalance
The board broadcasts to all the players about their new balances.

KickPlayer
The board sends a message to all bankruptcy players so they leave the game.

UpdateManagerCompanies
The board broadcasts a message to all managers about the companies they own before the auction.

Start auction

StartAuction
The board broadcasts a message to all players that the auction has started with N companies.

StartCompanyAuction
The board broadcasts to all managers the value of the company for auction.

SendBid
A manager sends a message to the board with the bid for the current company for auction.

ReplyBid
The board broadcasts a message to informsall managers informing about the highest current bid and its manager.

EndCompanyAuction
The board broadcasts to all managers that the auction for the company has finished (after 3 seconds of no bids).

EndAuction
The board broadcasts to all the players that the auction has finished.

End game

EndGame
The board broadcasts a message to all the players informing who the winners are.

Company
String : name
Double: value
Double : fluctuation
Boolean : isDoubleRevenue
Boolean : isClosed

SetupPlayer
Enum: Manager, Investor

UpdatePlayer
Double: Balance
List: List of companies
Int: Nr Investors
Int: Nr Managers

UpdateState
Enum: Standby, StartNegotiation, EndNegotiaion, StartAuction, EndAuction

AuctionSale
Company: currentCompany
Int: remainingCompanies

Offer
Company: targetCompany
Double: offeredValue
Boolean: isClosed
== Replied With ==
ACCEPTED_PROPOSAL
REJECTED_PROPOSAL

OfferUpdate
Enum: Outbid, Withdraw, Available, Closed
Company: targetCompany

Purchase
Company : purchasedCompany
Double : value
String : investorName

KickPlayer //Kicked will go into standby and only listen for winner message.
String : message