class ResponseStrategy extends Strategy
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
strategy |
| Constructor and Description |
|---|
ResponseStrategy()
The default constructor.
|
ResponseStrategy(java.lang.String strat)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private Card |
defaultStrategy(CardSet query,
CardSet hand)
The default strategy: if the agent has multiple cards, show a random one
|
static java.lang.String[] |
getOptions()
Get the different types of ResponseStrategy
|
java.lang.String |
getStrategy()
Get the strategy played
|
private Card |
optimalStrategy(Player agent,
CardSet query,
CardSet hand,
int other)
The optimal strategy: if the agent knows the other agent knows one of the cards, show that one.
|
private Card |
simpleStrategy(Player agent,
CardSet query,
CardSet hand,
int other)
The simple strategy: if the agent knows the other agent knows one of the cards, show that one, else, choose a random card
|
Card |
strategy(Player agent,
CardSet query,
CardSet hand,
int other)
The strategy function for responses
|
public ResponseStrategy()
public ResponseStrategy(java.lang.String strat)
strat - the strategy to be playedpublic Card strategy(Player agent, CardSet query, CardSet hand, int other)
agent - the agent asked for responsequery - the query madehand - the hand of the current agentother - the agent queryingprivate Card defaultStrategy(CardSet query, CardSet hand)
query - the query madehand - the hand of the current agentprivate Card simpleStrategy(Player agent, CardSet query, CardSet hand, int other)
agent - the agent asked for responsequery - the query madehand - the hand of the current agentother - the agent queryingprivate Card optimalStrategy(Player agent, CardSet query, CardSet hand, int other)
agent - the agent asked for responsequery - the query madehand - the hand of the current agentother - the agent queryingpublic java.lang.String getStrategy()
public static java.lang.String[] getOptions()