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 int
bet
The bet.protected int
drawlimit
The 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 boolean
drawCard(Card[] agentcards, Card dealercard)
Depending on the strategy, this methods decides whether to draw one more card or not.int
makeBet(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:
makeBet
in interfaceIStrategy
- Specified by:
makeBet
in 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:
drawCard
in interfaceIStrategy
- Specified by:
drawCard
in 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.
-
-