Constructor and Description |
---|
HatGuessing() |
Modifier and Type | Method and Description |
---|---|
void |
applyEffect(GameState state,
GameEvent event) |
Action |
doMove(int agentID,
GameState state)
Standardised interface for game playing agents.
|
Recommendation |
doRecommend(int agentID,
GameState state)
Playable: a card that can be successfully played with the current game state.
|
int |
getEncodedValue(int whoTold,
int toldWho)
Helper method to understand the hint system
|
int |
getMissingPiece(GameState state,
int whoTold,
int treasureChest) |
int |
getRecommendationForAHand(int agentToTell,
GameState state)
Gets the integer recommendation for the Hat Guessing algorithm for a single hand
|
boolean |
isDead(GameState state,
Card card)
Is the card dead by the Hat Guessing definition
|
boolean |
isIndispensable(GameState state,
Card card)
places a card can be:
1) in the deck (still in deck or our hand)
2) in the discard pile (played incorrectly or discarded cards)
3) on the table (card is no longer needed, a copy was played successfully)
4) another player's hand (our copy is not the only one)
|
boolean |
isPlayable(GameState state,
Card card)
Is the card playable by the Hat Guessing definition
|
void |
receiveID(int agentID)
optional hook for when the agent gets their ID.
|
String |
toString() |
public Action doMove(int agentID, GameState state)
Agent
The agent gets a copy of the game state and it's agent ID and should return a move.
public boolean isDead(GameState state, Card card)
state
- The current statecard
- The card we are interested inpublic boolean isPlayable(GameState state, Card card)
state
- The current statecard
- The card we are interested inpublic boolean isIndispensable(GameState state, Card card)
state
- The current statecard
- The card we are interested inpublic int getRecommendationForAHand(int agentToTell, GameState state)
Used to both calculate the encoding and decoding of a hint.
agentToTell
- The agent to calculate the hint forstate
- The current game statepublic Recommendation doRecommend(int agentID, GameState state)
Dead: a card that has the same rank and suit of a successfully played card.
Indispensable: a card for which all other identical copies have been removed from the game, i.e. a card that if removed from the game will imply a perfect score cannot be obtained.
agentID
- state
- public void receiveID(int agentID)
Agent
This indicates that the game has started.
public int getMissingPiece(GameState state, int whoTold, int treasureChest)
public int getEncodedValue(int whoTold, int toldWho)
whoTold
- Who told the hinttoldWho
- Who the hint was told toCopyright © 2017 FOSS Galaxy. All rights reserved.