Jadex 0.96

jadex.examples.blackjack.player.strategies
Class ConstantStrategy

java.lang.Object
  extended by jadex.examples.blackjack.player.strategies.AbstractStrategy
      extended by jadex.examples.blackjack.player.strategies.ConstantStrategy
All Implemented Interfaces:
IStrategy

public class ConstantStrategy
extends AbstractStrategy

The simple constant strategy.


Field Summary
 
Fields inherited from class jadex.examples.blackjack.player.strategies.AbstractStrategy
CONSTANT_CAREFUL, CONSTANT_RISKY, CONSTANT_VERY_CAREFUL, CONSTANT_VERY_RISKY, HUMAN_PLAYER, STOCHASTIC_TABLE
 
Constructor Summary
ConstantStrategy(String name, int bet, int drawlimit)
          Create a new 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.
 
Methods inherited from class jadex.examples.blackjack.player.strategies.AbstractStrategy
equals, getName, getStrategies, getStrategy, getStrategyNames, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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.

Jadex 0.96

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.