|
Jadex 0.96 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjadex.examples.blackjack.player.strategies.AbstractStrategy
public abstract class AbstractStrategy
Abstract base class for strategies.
Field Summary | |
---|---|
static String |
CONSTANT_CAREFUL
|
static String |
CONSTANT_RISKY
|
static String |
CONSTANT_VERY_CAREFUL
Constants for strategy names. |
static String |
CONSTANT_VERY_RISKY
|
static String |
HUMAN_PLAYER
|
static String |
STOCHASTIC_TABLE
|
Constructor Summary | |
---|---|
AbstractStrategy(String name)
Create a new strategy. |
Method Summary | |
---|---|
abstract boolean |
drawCard(Card[] agentcards,
Card dealercard)
Depending on the strategy, this methods decides whether to draw one more card or not. |
boolean |
equals(Object o)
Test if two strategies are equal. |
String |
getName()
Get the name. |
static IStrategy[] |
getStrategies()
Get all strategies. |
static IStrategy |
getStrategy(String name)
Get a strategy per name. |
static String[] |
getStrategyNames()
Get the strategy names. |
int |
hashCode()
Return the hash code. |
abstract int |
makeBet(int account)
Depending on the strategy, this methods calculates the bet-amount. |
String |
toString()
Return a string representation. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CONSTANT_VERY_CAREFUL
public static final String CONSTANT_CAREFUL
public static final String CONSTANT_RISKY
public static final String CONSTANT_VERY_RISKY
public static final String STOCHASTIC_TABLE
public static final String HUMAN_PLAYER
Constructor Detail |
---|
public AbstractStrategy(String name)
Method Detail |
---|
public abstract int makeBet(int account)
makeBet
in interface IStrategy
account
- The account-status of the player.
public abstract boolean drawCard(Card[] agentcards, Card dealercard)
drawCard
in interface IStrategy
agentcards
- A String-array containing all the players cards.dealercard
- This String represents the dealer's open card.
public String getName()
getName
in interface IStrategy
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public static String[] getStrategyNames()
public static IStrategy getStrategy(String name)
name
- The name.
public static IStrategy[] getStrategies()
|
Jadex 0.96 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.