net.sf.colossus.ai.objectives
Class PreserveCreatureTacticalObjective

java.lang.Object
  extended by net.sf.colossus.ai.objectives.AbstractTacticalObjective
      extended by net.sf.colossus.ai.objectives.PreserveCreatureTacticalObjective
All Implemented Interfaces:
TacticalObjective

 class PreserveCreatureTacticalObjective
extends AbstractTacticalObjective

The tactical objective of preserving all of a specific CreatureType. The evaluation function currently return the negative of the highest amount of point gang-banging any one of the creaturetype in our legion, multiplied by the priority. Rangestriker count for half. This doesn't take a number into account, so if you try to preserve 2 out of 3 Lions, this will try to protect ALL Lions. This is capped to 0 after the objective has failed. The objective is attained as long as enough creature are alive.

Author:
Romain Dolbeau

Field Summary
private  Client client
           
private  int count
           
private  Creature critter
           
private  Legion liveLegion
           
private static java.util.logging.Logger LOGGER
           
 
Constructor Summary
PreserveCreatureTacticalObjective(float priority, Client client, Legion liveLegion, Creature critter)
           
 
Method Summary
 java.lang.String getDescription()
          Get the description of this objective.
 boolean objectiveAttained()
          Whether the objective is already achieved
 ValueRecorder situationContributeToTheObjective()
          How much does the 'current situation' contributes to the objective.
 
Methods inherited from class net.sf.colossus.ai.objectives.AbstractTacticalObjective
changePriority, getPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

private static final java.util.logging.Logger LOGGER

critter

private final Creature critter

liveLegion

private final Legion liveLegion

client

private final Client client

count

private final int count
Constructor Detail

PreserveCreatureTacticalObjective

PreserveCreatureTacticalObjective(float priority,
                                  Client client,
                                  Legion liveLegion,
                                  Creature critter)
Method Detail

objectiveAttained

public boolean objectiveAttained()
Description copied from interface: TacticalObjective
Whether the objective is already achieved

Returns:
Whether the objective is already achieved

situationContributeToTheObjective

public ValueRecorder situationContributeToTheObjective()
Description copied from interface: TacticalObjective
How much does the 'current situation' contributes to the objective. The actual value is currently added to the overall evaluation of the whole legion move.

Returns:
How much does he 'current situation' contributes to the objective

getDescription

public java.lang.String getDescription()
Description copied from interface: TacticalObjective
Get the description of this objective.

Returns:
The description of this objective.