megamek.client.bot
Class MoveOption

java.lang.Object
  extended by megamek.common.MovePath
      extended by megamek.client.bot.MoveOption
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class MoveOption
extends MovePath

TODO: add the notion of a dependent state (at least a first pass estimate of worst case threat) for when psr's are made. TODO: add a notion of a blocked move, something that could open up after another mech moves.

See Also:
Serialized Form

Nested Class Summary
static class MoveOption.DamageInfo
           
static class MoveOption.DistanceComparator
           
static class MoveOption.Table
           
static class MoveOption.WeightedComparator
           
 
Nested classes/interfaces inherited from class megamek.common.MovePath
MovePath.Key, MovePath.MovePathComparator, MovePath.MoveStepType
 
Field Summary
static int ATTACK_MOD
           
static int ATTACK_PC
           
(package private)  double damage
           
(package private)  java.util.HashMap<CEntity,MoveOption.DamageInfo> damageInfos
           
static int DEFENCE_MOD
           
static int DEFENCE_PC
           
static MoveOption.DistanceComparator DISTANCE_COMPARATOR
           
(package private)  boolean doomed
           
(package private)  boolean inDanger
           
(package private)  boolean isPhysical
           
(package private)  double movement_threat
           
(package private)  double self_damage
           
(package private)  double self_threat
           
(package private)  double threat
           
(package private)  java.util.ArrayList<java.lang.String> tv
           
(package private)  double utility
           
(package private)  boolean utilityCalculated
           
 
Fields inherited from class megamek.common.MovePath
DEFAULT_PATHFINDER_TIME_LIMIT, entity, game, steps
 
Constructor Summary
MoveOption(IGame game, CEntity centity)
           
MoveOption(MoveOption base)
           
 
Method Summary
 MoveOption addStep(MovePath.MoveStepType step_type)
          Add a new step to the movement path.
 boolean changeToPhysical()
           
 MoveOption clone()
          Clones this path, will contain a new clone of the steps so that the clone is independent from the original.
(package private)  CEntity getCEntity()
           
 double getDamage(CEntity e)
           
 MoveOption.DamageInfo getDamageInfo(CEntity cen, boolean create)
           
 double getDistUtility()
           
 double getMaxModifiedDamage(MoveOption enemy, int modifier, int apc)
          get maximum damage in this current state from enemy accounting for torso twisting and slightly for heat -- the ce passed in is supposed to be the enemy mech
 double getMinDamage(CEntity e)
           
 int[] getModifiers(Entity te)
          TODO: replace with more common logic approximates the attack and defensive modifies assumes that set state has been called
 int getMovementheatBuildup()
           
(package private)  int getPhysicalTargetId()
          There could still be a problem here, but now it's the callers problem
 double getThreat(CEntity e)
           
 double getUtility()
          TODO: the result of this calculation should be cached...
 void setDamage(CEntity e, double value)
           
 void setState()
           
 void setThreat(CEntity e, double value)
           
 java.lang.String toString()
           
 
Methods inherited from class megamek.common.MovePath
addManeuver, addStep, addStep, addStep, addStep, addStep, addStep, addStep, addStep, canShift, clear, clipToPossible, compile, contains, findPathTo, getAdjustedFacing, getDirection, getEntity, getFinalAltitude, getFinalClimbMode, getFinalCoords, getFinalElevation, getFinalFacing, getFinalHullDown, getFinalNDown, getFinalProne, getFinalVectors, getFinalVelocity, getHexesMoved, getKey, getLastStep, getLastStepMovementType, getMpUsed, getNextMoves, getSecondFinalPosition, getSecondLastStep, getStep, getSteps, hasActiveMASC, isCareful, isFlying, isJumping, isMoveLegal, lateralShiftForTurn, length, printAllSteps, removeLastStep, rotatePathfinder, setCareful
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DISTANCE_COMPARATOR

public static final MoveOption.DistanceComparator DISTANCE_COMPARATOR

ATTACK_MOD

public static final int ATTACK_MOD
See Also:
Constant Field Values

DEFENCE_MOD

public static final int DEFENCE_MOD
See Also:
Constant Field Values

ATTACK_PC

public static final int ATTACK_PC
See Also:
Constant Field Values

DEFENCE_PC

public static final int DEFENCE_PC
See Also:
Constant Field Values

utilityCalculated

boolean utilityCalculated

inDanger

boolean inDanger

doomed

boolean doomed

isPhysical

boolean isPhysical

utility

double utility

self_threat

double self_threat

movement_threat

double movement_threat

self_damage

double self_damage

damage

double damage

threat

double threat

tv

transient java.util.ArrayList<java.lang.String> tv

damageInfos

transient java.util.HashMap<CEntity,MoveOption.DamageInfo> damageInfos
Constructor Detail

MoveOption

public MoveOption(IGame game,
                  CEntity centity)

MoveOption

public MoveOption(MoveOption base)
Method Detail

clone

public MoveOption clone()
Description copied from class: MovePath
Clones this path, will contain a new clone of the steps so that the clone is independent from the original.

Overrides:
clone in class MovePath
Returns:
the cloned MovePath

getThreat

public double getThreat(CEntity e)

setThreat

public void setThreat(CEntity e,
                      double value)

getMinDamage

public double getMinDamage(CEntity e)

getDamage

public double getDamage(CEntity e)

setDamage

public void setDamage(CEntity e,
                      double value)

getCEntity

CEntity getCEntity()

addStep

public MoveOption addStep(MovePath.MoveStepType step_type)
Description copied from class: MovePath
Add a new step to the movement path.

Overrides:
addStep in class MovePath
Parameters:
step_type - the type of movement.

getMovementheatBuildup

public int getMovementheatBuildup()

changeToPhysical

public boolean changeToPhysical()

setState

public void setState()

getModifiers

public int[] getModifiers(Entity te)
TODO: replace with more common logic approximates the attack and defensive modifies assumes that set state has been called


getUtility

public double getUtility()
TODO: the result of this calculation should be cached...


getMaxModifiedDamage

public double getMaxModifiedDamage(MoveOption enemy,
                                   int modifier,
                                   int apc)
get maximum damage in this current state from enemy accounting for torso twisting and slightly for heat -- the ce passed in is supposed to be the enemy mech


getDamageInfo

public MoveOption.DamageInfo getDamageInfo(CEntity cen,
                                           boolean create)

getDistUtility

public double getDistUtility()

getPhysicalTargetId

int getPhysicalTargetId()
There could still be a problem here, but now it's the callers problem


toString

public java.lang.String toString()
Overrides:
toString in class MovePath