Class AbstractStrategy
- java.lang.Object
- 
- jadex.bdi.examples.blackjack.player.strategies.AbstractStrategy
 
- 
- All Implemented Interfaces:
- IStrategy
 - Direct Known Subclasses:
- ConstantStrategy,- StochasticTable
 
 public abstract class AbstractStrategy extends java.lang.Object implements IStrategy Abstract base class for strategies.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringCONSTANT_CAREFULstatic java.lang.StringCONSTANT_RISKYstatic java.lang.StringCONSTANT_VERY_CAREFULConstants for strategy names.static java.lang.StringCONSTANT_VERY_RISKYstatic java.lang.StringHUMAN_PLAYERprotected java.lang.StringnameThe strategy name.static java.lang.StringSTOCHASTIC_TABLEprotected static java.util.ListstrategiesThe strategies.
 - 
Constructor SummaryConstructors Constructor Description AbstractStrategy(java.lang.String name)Create a new strategy.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleandrawCard(Card[] agentcards, Card dealercard)Depending on the strategy, this methods decides whether to draw one more card or not.booleanequals(java.lang.Object o)Test if two strategies are equal.java.lang.StringgetName()Get the name.static IStrategy[]getStrategies()Get all strategies.static IStrategygetStrategy(java.lang.String name)Get a strategy per name.static java.lang.String[]getStrategyNames()Get the strategy names.inthashCode()Return the hash code.abstract intmakeBet(int account)Depending on the strategy, this methods calculates the bet-amount.java.lang.StringtoString()Return a string representation.
 
- 
- 
- 
Field Detail- 
CONSTANT_VERY_CAREFULpublic static final java.lang.String CONSTANT_VERY_CAREFUL Constants for strategy names.- See Also:
- Constant Field Values
 
 - 
CONSTANT_CAREFULpublic static final java.lang.String CONSTANT_CAREFUL - See Also:
- Constant Field Values
 
 - 
CONSTANT_RISKYpublic static final java.lang.String CONSTANT_RISKY - See Also:
- Constant Field Values
 
 - 
CONSTANT_VERY_RISKYpublic static final java.lang.String CONSTANT_VERY_RISKY - See Also:
- Constant Field Values
 
 - 
STOCHASTIC_TABLEpublic static final java.lang.String STOCHASTIC_TABLE - See Also:
- Constant Field Values
 
 - 
HUMAN_PLAYERpublic static final java.lang.String HUMAN_PLAYER - See Also:
- Constant Field Values
 
 - 
nameprotected java.lang.String name The strategy name.
 - 
strategiesprotected static final java.util.List strategies The strategies.
 
- 
 - 
Method Detail- 
makeBetpublic abstract int makeBet(int account) Depending on the strategy, this methods calculates the bet-amount.
 - 
drawCardpublic abstract boolean drawCard(Card[] agentcards, Card dealercard) Depending on the strategy, this methods decides whether to draw one more card or not.
 - 
getNamepublic java.lang.String getName() Get the name.
 - 
toStringpublic java.lang.String toString() Return a string representation.- Overrides:
- toStringin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() Return the hash code.- Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object o) Test if two strategies are equal.- Overrides:
- equalsin class- java.lang.Object
 
 - 
getStrategyNamespublic static java.lang.String[] getStrategyNames() Get the strategy names.- Returns:
- The strategy names.
 
 - 
getStrategypublic static IStrategy getStrategy(java.lang.String name) Get a strategy per name.- Parameters:
- name- The name.
- Returns:
- The strategy.
 
 - 
getStrategiespublic static IStrategy[] getStrategies() Get all strategies.- Returns:
- All strategies.
 
 
- 
 
-