jadex.examples.blackjack.player.strategies
Class ConstantStrategy
java.lang.Object
jadex.examples.blackjack.player.strategies.AbstractStrategy
jadex.examples.blackjack.player.strategies.ConstantStrategy
- All Implemented Interfaces:
- IStrategy
public class ConstantStrategy
- extends AbstractStrategy
The simple constant strategy.
Method Summary |
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. |
ConstantStrategy
public ConstantStrategy(String name,
int bet,
int drawlimit)
- Create a new strategy.
- Parameters:
name
- The strategy name.bet
- The bet value.drawlimit
- The draw limit.
makeBet
public int makeBet(int account)
- Depending on the strategy, this methods calculates the bet-amount.
- Specified by:
makeBet
in interface IStrategy
- Specified by:
makeBet
in class AbstractStrategy
- 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 interface IStrategy
- Specified by:
drawCard
in class AbstractStrategy
- 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.
Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples. Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.