dice_war.AI
Class Greedy

java.lang.Object
  extended by dice_war.AITemplate
      extended by dice_war.AI.Greedy
All Implemented Interfaces:
java.lang.Runnable

public class Greedy
extends AITemplate

An example of AI, the strategy is simple, attack if the enemy's dices are equal or less than mine. arrange more new dices to the nodes which have more enemies in neighbor


Field Summary
 
Fields inherited from class dice_war.AITemplate
edge, edgeList, MAX_DICE, myCountry, nodes, probabilityTable
 
Constructor Summary
Greedy()
           
 
Method Summary
protected  void arrangeNewDices(int nNewDice)
          the core of game play, when it's your turn, UserInterface will call this method.
protected  void main()
          the core of game play, when it's your turn, UserInterface will call this method.
 
Methods inherited from class dice_war.AITemplate
appendNewDice, attack, isAttackable, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Greedy

public Greedy()
Method Detail

main

protected void main()
Description copied from class: AITemplate
the core of game play, when it's your turn, UserInterface will call this method. Override this to do the strategy of attack.

Specified by:
main in class AITemplate

arrangeNewDices

protected void arrangeNewDices(int nNewDice)
Description copied from class: AITemplate
the core of game play, when it's your turn, UserInterface will call this method. Override this to do the strategy of attack.

Specified by:
arrangeNewDices in class AITemplate