simulations.core.strategy.decisionSupportStrategy
Class DecisionSupportStrategy

java.lang.Object
  extended by simulations.core.strategy.Strategy
      extended by simulations.core.strategy.decisionSupportStrategy.DecisionSupportStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AcceptAskingPlayersStrongestThanMe, AcceptAskingPlayersWeakestThanMeStrategy, AcceptAttackedPlayersStrongestThanMeStrategy, AcceptAttackedPlayersWeakestThanMeStrategy, AcceptOneByTwoStrategy, AcceptPlayersDontAttackMeStrategy, AcceptPlayersDontAttackMeStrategy2, AcceptPlayersNeverRefuseHelpMeStrategy, AlwaysAcceptToSupportStrategy, CoalitionalDef1DecisionStrategy, CoalitionalDef2DecisionStrategy, CoalitionalDef3DecisionStrategy, CoalitionalDef4DecisionStrategy, CoalitionalDef5DecisionStrategy, NeverAcceptToSupportStrategy, RandomSupportStrategy

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

This abstract class describes haw to construct a decision 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
DecisionSupportStrategy()
          Creates a new instance of DecisionSupportStrategy
 
Method Summary
 boolean equals(java.lang.Object o)
          overload of equals method
abstract  java.lang.String getDescription()
          return the description of this decision support strategy
 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  boolean supportAttack(Player player, Player attackingPlayer, Player attackedPlayer, java.util.ArrayList playerList)
          return true if the player will support the attack.
abstract  void updateAttacksInfos(Player player, java.util.ArrayList attacksList)
          This method is called by the judge after the decision of players to attack and to ask supports to inform the strategy
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

DecisionSupportStrategy

public DecisionSupportStrategy()
Creates a new instance of DecisionSupportStrategy

Method Detail

supportAttack

public abstract boolean supportAttack(Player player,
                                      Player attackingPlayer,
                                      Player attackedPlayer,
                                      java.util.ArrayList playerList)
return true if the player will support the attack.

Parameters:
playerList - The list of remaining players
player - The owner of the strategy
attackingPlayer - The attacking player
attackedPlayer - The attacked player
Returns:
return true if the player will support the attack.

updateAttacksInfos

public abstract void updateAttacksInfos(Player player,
                                        java.util.ArrayList attacksList)
This method is called by the judge after the decision of players to attack and to ask supports to inform the strategy

Parameters:
player - The owner of the strategy
attacksList - The list of attacks

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()
return the description of this decision support strategy

Specified by:
getDescription in class Strategy
Returns:
return the description of this decision support 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.