jagafa.ai
Class ProbabilityTable

java.lang.Object
  extended by jagafa.ai.ProbabilityTable

public class ProbabilityTable
extends java.lang.Object

ProbabylityTable provides functions to calculate probabilities for all players having cards of a color or having a specific card (all from the view of a Player) ProbabilityTable is the core of the ProbabilityAI AI implementation

See Also:
ProbabilityAI

Constructor Summary
ProbabilityTable(Player p, JassRound game)
          Constructor: Create the ProbabilityTable and init all values
 
Method Summary
 float getCardProb(Player p, Card c)
          Get the probability of a Player having a specific card
 float getColorProb(Player p, int color)
          Get the probability of a Player having cards of a specific color
 java.lang.String toString()
           
 void update()
          Update the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProbabilityTable

public ProbabilityTable(Player p,
                        JassRound game)
Constructor: Create the ProbabilityTable and init all values

Parameters:
p - The viewpoint Player
game - The game object
Method Detail

update

public void update()
Update the table


getColorProb

public float getColorProb(Player p,
                          int color)
Get the probability of a Player having cards of a specific color

Parameters:
p - The relevant Player
color - The relevant color
Returns:
A double representing the chance of player p having a card of color

getCardProb

public float getCardProb(Player p,
                         Card c)
Get the probability of a Player having a specific card

Parameters:
p - The relevant Player
c - The relevant card
Returns:
A double value representing the chance of player p having c in his hand

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 2005 MA Software. All Rights Reserved.