simulations.core.strategy.askingSupportStrategy
Class AskingStrategy

java.lang.Object
  extended by simulations.core.strategy.Strategy
      extended by simulations.core.strategy.askingSupportStrategy.AskingStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AskingEveryoneStrategy, AskingNoBodyStrategy, AskingPlayersDontAttackMeStrategy, AskingPlayersDontAttackMeStrategy2, AskingPlayersNeverRefuseToHelpMeStrategy, AskingStrongestThanMeStrategy, AskingWeakestThanMeStrategy, CoalitionalDef1AskingStrategy, CoalitionalDef2AskingStrategy, CoalitionalDef3AskingStrategy, CoalitionalDef4AskingStrategy, CoalitionalDef5AskingStrategy, RandomAskingStrategy

public abstract class AskingStrategy
extends Strategy
implements java.lang.Cloneable, java.io.Serializable

This abstract class describes haw to construct an asking strategy

See Also:
Serialized Form

Field Summary
protected  boolean memoryParam
          True if the strategy is memory signifiant
protected  boolean negative
          True if the strategy is the negation
 
Fields inherited from class simulations.core.strategy.Strategy
abr, memory, name, randomGenerator
 
Constructor Summary
AskingStrategy()
          Creates a new instance of AskingStrategy
 
Method Summary
 boolean equals(java.lang.Object o)
          overload of equals method
abstract  java.lang.String getDescription()
          This method returns the description of the strategy
abstract  java.util.ArrayList getPlayersToAskSupport(Player player, Player attackedPlayer, java.util.ArrayList playerList)
          Returns the list of players to ask support.
 boolean isMemoryParam()
          Getter for property memoryParam.
 boolean isNegative()
          Getter for property negative.
 void setMemoryParam(boolean memoryParam)
          Setter for property memoryParam.
 void setNegative(boolean negative)
          Setter for property negative.
abstract  void updateLastTurn(Turn turn, Player player, java.util.ArrayList remainingPlayers)
          This method is called by the judge to inform players of the last turn
 
Methods inherited from class simulations.core.strategy.Strategy
getAbr, getMemory, getName, getRandomGenerator, setAbr, setMemory, setName, setRandomGenerator, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

negative

protected boolean negative
True if the strategy is the negation


memoryParam

protected boolean memoryParam
True if the strategy is memory signifiant

Constructor Detail

AskingStrategy

public AskingStrategy()
Creates a new instance of AskingStrategy

Method Detail

getPlayersToAskSupport

public abstract java.util.ArrayList getPlayersToAskSupport(Player player,
                                                           Player attackedPlayer,
                                                           java.util.ArrayList playerList)
Returns the list of players to ask support.

Parameters:
attackedPlayer - The attacked player
player - The attacking player
playerList - The list of avalaible player
Returns:
Returns the list of players to ask support.

updateLastTurn

public abstract void updateLastTurn(Turn turn,
                                    Player player,
                                    java.util.ArrayList remainingPlayers)
This method is called by the judge to inform players of the last turn

Parameters:
turn - The turn
player - The owner of the strategy
remainingPlayers - The list of the remaining players

getDescription

public abstract java.lang.String getDescription()
This method returns the description of the strategy

Specified by:
getDescription in class Strategy
Returns:
returns the description of the strategy

equals

public boolean equals(java.lang.Object o)
overload of equals method

Overrides:
equals in class Strategy
Parameters:
o - The object to compare
Returns:
Returns true if this and o are equals

isNegative

public boolean isNegative()
Getter for property negative.

Returns:
Value of property negative.

setNegative

public void setNegative(boolean negative)
Setter for property negative.

Parameters:
negative - New value of property negative.

isMemoryParam

public boolean isMemoryParam()
Getter for property memoryParam.

Returns:
Value of property memoryParam.

setMemoryParam

public void setMemoryParam(boolean memoryParam)
Setter for property memoryParam.

Parameters:
memoryParam - New value of property memoryParam.