Class ConstantStrategy
- java.lang.Object
-
- jadex.bdi.examples.blackjack.player.strategies.AbstractStrategy
-
- jadex.bdi.examples.blackjack.player.strategies.ConstantStrategy
-
- All Implemented Interfaces:
IStrategy
public class ConstantStrategy extends AbstractStrategy
The simple constant strategy.
-
-
Field Summary
Fields Modifier and Type Field Description protected intbetThe bet.protected intdrawlimitThe draw limit.-
Fields inherited from class jadex.bdi.examples.blackjack.player.strategies.AbstractStrategy
CONSTANT_CAREFUL, CONSTANT_RISKY, CONSTANT_VERY_CAREFUL, CONSTANT_VERY_RISKY, HUMAN_PLAYER, name, STOCHASTIC_TABLE, strategies
-
-
Constructor Summary
Constructors Constructor Description ConstantStrategy(java.lang.String name, int bet, int drawlimit)Create a new strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandrawCard(Card[] agentcards, Card dealercard)Depending on the strategy, this methods decides whether to draw one more card or not.intmakeBet(int account)Depending on the strategy, this methods calculates the bet-amount.-
Methods inherited from class jadex.bdi.examples.blackjack.player.strategies.AbstractStrategy
equals, getName, getStrategies, getStrategy, getStrategyNames, hashCode, toString
-
-
-
-
Method Detail
-
makeBet
public int makeBet(int account)
Depending on the strategy, this methods calculates the bet-amount.- Specified by:
makeBetin interfaceIStrategy- Specified by:
makeBetin classAbstractStrategy- Parameters:
account- The account-status of the player.- Returns:
- how much money the player should bet.
-
drawCard
public boolean drawCard(Card[] agentcards, Card dealercard)
Depending on the strategy, this methods decides whether to draw one more card or not.- Specified by:
drawCardin interfaceIStrategy- Specified by:
drawCardin classAbstractStrategy- Parameters:
agentcards- A String-array containing all the players cards.dealercard- This String represents the dealer's open card.- Returns:
- whether the player should draw one more card or not.
-
-