bot.module.th.estimation
Class Estimation

java.lang.Object
  extended by bot.module.th.estimation.Estimation
All Implemented Interfaces:
IF_GetEstimation, IF_Estimation

public class Estimation
extends java.lang.Object
implements IF_Estimation

This class initializes the estimation of x opponents for a given amount of competitions
It holds the estimation data in the Map opponentsEstimations
- BY NOW ONLY THE ESTIMATION OF THE SPECIAL ROUND "PREFLOPSHC" IS EXEMPLARILY IMPLEMENTED -

Author:
Witthold/Korol

Field Summary
private  int competitionId
           
private  int[] completedCompetitionsIds
           
private  java.lang.String myName
           
private  java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,Opponent>> opponentsEstimations
          Map holding all estimations by opponent and competition
playerId, HashMap oppPerCompetition: competitionId, estimation
private  java.util.List<java.lang.String> playersExplicitely
          if players were explicitly announced, estimate only those
(package private)  long timestamp
           
 
Constructor Summary
Estimation(java.lang.String myName, long beginAt, java.util.List<java.lang.String> restrictToPlayers)
          Constructor
 
Method Summary
private  boolean addOpponentWithCompetition(int player_id, int competition_id)
          add opponent with competition to Map opponentsEstimations
 boolean estimate()
          estimate opponent over all rounds
TODO booleans to IF_EstimationAtRound
 void estimateCompletedCompetitions(int gamedef_id)
          process all completed competitions right now
since the participation players are unknown right now
estimate all players played this gamedef
 java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,Opponent>> getOpponentsEstimations()
           
 boolean initNewCompetition()
          set currently running competition
cleanup opponentsEstimations by not participating estimated players
private  void setCompletedCompetitionsIds(int gamedef_id, long timestamp)
          get all completed competitions with current gamedef
private  void setOpponentsEstimations()
          fill opponentsAtCompetition with completed competitions by playerId, competitionId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myName

private java.lang.String myName

timestamp

long timestamp

playersExplicitely

private java.util.List<java.lang.String> playersExplicitely
if players were explicitly announced, estimate only those


completedCompetitionsIds

private int[] completedCompetitionsIds

competitionId

private int competitionId

opponentsEstimations

private java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,Opponent>> opponentsEstimations
Map holding all estimations by opponent and competition
playerId, HashMap oppPerCompetition: competitionId, estimation

Constructor Detail

Estimation

public Estimation(java.lang.String myName,
                  long beginAt,
                  java.util.List<java.lang.String> restrictToPlayers)
Constructor

Parameters:
myName - - bots name
beginAt - - - ability to reduce estimation of completed competitions to specific date (timestamp)
restrictToPlayers - - ability to reduce estimation of completed competitions to specific players
Method Detail

estimateCompletedCompetitions

public void estimateCompletedCompetitions(int gamedef_id)
Description copied from interface: IF_Estimation
process all completed competitions right now
since the participation players are unknown right now
estimate all players played this gamedef

Specified by:
estimateCompletedCompetitions in interface IF_Estimation
Parameters:
gamedef_id - - already generated by db -

setCompletedCompetitionsIds

private void setCompletedCompetitionsIds(int gamedef_id,
                                         long timestamp)
get all completed competitions with current gamedef

Parameters:
gamedef_id - - already generated by db

setOpponentsEstimations

private void setOpponentsEstimations()
fill opponentsAtCompetition with completed competitions by playerId, competitionId


addOpponentWithCompetition

private boolean addOpponentWithCompetition(int player_id,
                                           int competition_id)
add opponent with competition to Map opponentsEstimations

Parameters:
player_id -
competition_id - already generated by db
Returns:
competition is new to Map opponentsEstimations

initNewCompetition

public boolean initNewCompetition()
Description copied from interface: IF_Estimation
set currently running competition
cleanup opponentsEstimations by not participating estimated players

Specified by:
initNewCompetition in interface IF_Estimation
Returns:
competition is new

estimate

public boolean estimate()
Description copied from interface: IF_Estimation
estimate opponent over all rounds
TODO booleans to IF_EstimationAtRound

Specified by:
estimate in interface IF_Estimation
Returns:
true, if no errors occured

getOpponentsEstimations

public java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,Opponent>> getOpponentsEstimations()
Specified by:
getOpponentsEstimations in interface IF_Estimation
Returns:
Map opponentsEstimations holding all estimations by opponent and competition
Maps format:
playerId, Map oppPerCompetition: competitionId, estimation