cz.nipax.hippo.pexeso
Class AI_lhd

java.lang.Object
  extended by cz.nipax.hippo.pexeso.AI
      extended by cz.nipax.hippo.pexeso.AI_random
          extended by cz.nipax.hippo.pexeso.AI_forgetting
              extended by cz.nipax.hippo.pexeso.AI_lhd

public class AI_lhd
extends AI_forgetting

Implementation of "classic" inteligence with LHD and not enhanced random. LHD = little hell deamon. After every turn it mixes the the pieces that AI knows so AI is going to make a lot of mistakes. This AI is cursed because of lhd :-)


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.nipax.hippo.pexeso.AI_forgetting
AI_forgetting.Piece
 
Field Summary
(package private)  int m_type
           
 
Fields inherited from class cz.nipax.hippo.pexeso.AI_forgetting
m_field, m_lastID, m_turn, m_x, m_y, my_turn
 
Fields inherited from class cz.nipax.hippo.pexeso.AI
DEBUG, m_killed, m_pg, MOVESLEEP
 
Constructor Summary
AI_lhd(Playground pg, int type)
          Just a simple constructor
 
Method Summary
 java.lang.String getname()
          Get name of AI
protected  void little_hell_deamon()
          Randomly mixes knowlages of AI.
 void onturn()
          Cursing the AI :-)
 void revealed(int x, int y, int ID)
          Respond to revealed and cursing the AI.
protected  boolean switchpieces(int x, int y, int a, int b)
          Switches pieces in AI_forgetting.m_field.
protected  boolean try_turn(int x, int y)
          Just removed random moves because it is done by LHD.
 
Methods inherited from class cz.nipax.hippo.pexeso.AI_forgetting
first_random_move, first_turn, ivalidate, second_random_move, second_turn, thread_turn
 
Methods inherited from class cz.nipax.hippo.pexeso.AI_random
random_move
 
Methods inherited from class cz.nipax.hippo.pexeso.AI
kill, println, setSleep, userinput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_type

int m_type
Constructor Detail

AI_lhd

public AI_lhd(Playground pg,
              int type)
Just a simple constructor

Method Detail

getname

public java.lang.String getname()
Get name of AI

Overrides:
getname in class AI_forgetting
Returns:
string with name

try_turn

protected boolean try_turn(int x,
                           int y)
Just removed random moves because it is done by LHD.

Overrides:
try_turn in class AI_forgetting
Parameters:
x - coordinate of wanted move
y - coordinate of wanted move

onturn

public void onturn()
Cursing the AI :-)

Overrides:
onturn in class AI_forgetting

revealed

public void revealed(int x,
                     int y,
                     int ID)
Respond to revealed and cursing the AI.

Overrides:
revealed in class AI_forgetting
Parameters:
x - coordinate of revealed card
y - coordinate of revealed card
ID - ID of revealed card

little_hell_deamon

protected void little_hell_deamon()
Randomly mixes knowlages of AI.


switchpieces

protected boolean switchpieces(int x,
                               int y,
                               int a,
                               int b)
Switches pieces in AI_forgetting.m_field.

Parameters:
x - coordinate of first piece
y - coordinate of first piece
a - coordinate of second piece
b - coordinate of second piece
Returns:
true if switch was successfull