Class BehaviorSettings

java.lang.Object
megamek.client.bot.princess.BehaviorSettings
All Implemented Interfaces:
Serializable

public class BehaviorSettings extends Object implements Serializable
Since:
17-Aug-2013 10:47 PM
See Also:
  • Field Details

    • BRAVERY

      protected static final double[] BRAVERY
    • MAX_NUMBER_OF_ENEMIES_TO_CONSIDER_FACING

      public static final int MAX_NUMBER_OF_ENEMIES_TO_CONSIDER_FACING
      See Also:
    • MIN_NUMBER_OF_ENEMIES_TO_CONSIDER_FACING

      public static final int MIN_NUMBER_OF_ENEMIES_TO_CONSIDER_FACING
      See Also:
    • DEFAULT_NUMBER_OF_ENEMIES_TO_CONSIDER_FACING

      public static final int DEFAULT_NUMBER_OF_ENEMIES_TO_CONSIDER_FACING
      See Also:
    • MAX_ALLOW_FACING_TOLERANCE

      public static final int MAX_ALLOW_FACING_TOLERANCE
      See Also:
    • MIN_ALLOW_FACING_TOLERANCE

      public static final int MIN_ALLOW_FACING_TOLERANCE
      See Also:
    • DEFAULT_ALLOW_FACING_TOLERANCE

      public static final int DEFAULT_ALLOW_FACING_TOLERANCE
      See Also:
  • Constructor Details

  • Method Details

    • getCopy

      public BehaviorSettings getCopy() throws PrincessException
      Throws:
      PrincessException
    • isExperimental

      public boolean isExperimental()
      Returns:
      TRUE if I am running experimental features.
    • setExperimental

      public void setExperimental(boolean experimental)
      Parameters:
      experimental - Set TRUE if I am running experimental features.
    • setExperimental

      public void setExperimental(String experimental)
      Parameters:
      experimental - Set TRUE if I am running experimental features.
    • isIgnoreDamageOutput

      public boolean isIgnoreDamageOutput()
      Returns:
      TRUE if I am running experimental features.
    • setIgnoreDamageOutput

      public void setIgnoreDamageOutput(boolean ignoreDamageOutput)
      Parameters:
      ignoreDamageOutput - Set TRUE if I am running experimental features.
    • iAmAPirate

      public boolean iAmAPirate()
      Returns:
      TRUE if I am a bloody pirate. Ignores the dishonored enemies list and just attacks.
    • setIAmAPirate

      public void setIAmAPirate(boolean iAmAPirate)
      Parameters:
      iAmAPirate - Set TRUE if I am a bloody pirate.
    • setIAmAPirate

      public void setIAmAPirate(String iAmAPirate)
      Parameters:
      iAmAPirate - Set TRUE if I am a bloody pirate.
    • isExclusiveMutualSupport

      public boolean isExclusiveMutualSupport()
      Returns:
      TRUE if I should only form up with my units.
    • setExclusiveMutualSupport

      public void setExclusiveMutualSupport(boolean exclusiveMutualSupport)
      Parameters:
      exclusiveMutualSupport - Set TRUE if I should only form up with my units.
    • setExclusiveMutualSupport

      public void setExclusiveMutualSupport(String exclusiveMutualSupport)
    • getCombatPosture

      public CombatPosture getCombatPosture()
      Returns:
      whether my force is attacking, defending, or deciding for itself. See CombatPosture.
    • setCombatPosture

      public void setCombatPosture(@Nullable CombatPosture combatPosture)
      Parameters:
      combatPosture - whether my force is attacking, defending, or deciding for itself; null resets to CombatPosture.AUTO
    • setCombatPosture

      public void setCombatPosture(String combatPosture)
    • isExclusiveHerding

      @Deprecated(since="0.50.08", forRemoval=true) public boolean isExclusiveHerding()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 0.50.08, use isExclusiveMutualSupport(). The setting was renamed from herding to mutual support; this delegates so code outside MegaMek keeps building.
      Returns:
      TRUE if I should only form up with my units.
    • setExclusiveHerding

      @Deprecated(since="0.50.08", forRemoval=true) public void setExclusiveHerding(boolean exclusiveHerding)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      exclusiveHerding - Set TRUE if I should only form up with my units.
    • setExclusiveHerding

      @Deprecated(since="0.50.08", forRemoval=true) public void setExclusiveHerding(String exclusiveHerding)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      exclusiveHerding - Set TRUE if I should only form up with my units.
    • shouldGoHome

      public boolean shouldGoHome()
      Returns:
      TRUE if I should immediately proceed to my home board edge.
    • shouldAutoFlee

      public boolean shouldAutoFlee()
      Returns:
      TRUE if I should flee off the board even if I am not crippled or Forced Withdrawal is not in effect.
    • setAutoFlee

      public void setAutoFlee(boolean autoFlee)
      Parameters:
      autoFlee - Set TRUE if I should flee off the board even if I am not crippled or Forced Withdrawal is not in effect.
    • getDescription

      public String getDescription()
      Returns the name for this type of behavior.
      Returns:
      the name for this type of behavior.
    • setDescription

      public void setDescription(String description) throws PrincessException
      Sets the name for this type of behavior. Must be unique in order to save. Throws a PrincessException when the description is empty.
      Parameters:
      description - The name to be used.
      Throws:
      PrincessException
    • getStrategicBuildingTargets

      public Set<String> getStrategicBuildingTargets()
      A list of hexes that Princess will attempt to move to and attack.
      Returns:
      A list of hexes that Princess will attempt to move to and attack.
    • addStrategicTarget

      public void addStrategicTarget(String target)
      Adds a target that Princess will attempt to move to and attack.
      Parameters:
      target - The target to be added.
    • getIgnoredUnitTargets

      public Set<Integer> getIgnoredUnitTargets()
      Returns:
      A list of enemy units that Princess will ignore completely.
    • addIgnoredUnitTarget

      public void addIgnoredUnitTarget(int unitID)
      Add the given unit ID to the ignored target list.
    • removeIgnoredUnitTarget

      public void removeIgnoredUnitTarget(int unitID)
      Remove the given unit ID from the ignored target list.
    • clearIgnoredUnitTargets

      public void clearIgnoredUnitTargets()
      Empty out the ignored target list.
    • getPriorityUnitTargets

      public Set<Integer> getPriorityUnitTargets()
      Returns:
      A list of enemy units that Princess will prioritize over others.
    • addPriorityUnit

      public void addPriorityUnit(int id)
      Add an enemy unit to the priority list.
      Parameters:
      id - The ID of the unit to be added.
    • addPriorityUnit

      public void addPriorityUnit(String id)
      Add an enemy unit to the priority list.
      Parameters:
      id - The ID of the unit to be added.
    • isForcedWithdrawal

      public boolean isForcedWithdrawal()
      When this is true, Princess will follow the Forced Withdrawal rules from Total Warfare.
      Returns:
      Should Princess follow the Forced Withdrawal rules?
    • setForcedWithdrawal

      public void setForcedWithdrawal(boolean forcedWithdrawal)
      When this is true, Princess will follow the Forced Withdrawal rules from Total Warfare.
      Parameters:
      forcedWithdrawal - Should Princess follow the Forced Withdrawal rules?
    • setForcedWithdrawal

      public void setForcedWithdrawal(String forcedWithdrawal)
      When this is true, Princess will follow the Forced Withdrawal rules from Total Warfare.
      Parameters:
      forcedWithdrawal - Should Princess follow the Forced Withdrawal rules?
    • getBraveryIndex

      public int getBraveryIndex()
      How quickly will I try to escape once damaged?
      Returns:
      Index of the Bravery value.
    • getBraveryValue

      public double getBraveryValue()
      How quickly will I try to escape once damaged?
      Returns:
      Bravery modifier value.
    • getBraveryValue

      public double getBraveryValue(int index)
      How quickly will I try to escape once damaged?
      Parameters:
      index - The index of the Bravery modifier to retrieve.
      Returns:
      Bravery modifier value at given index.
    • setBraveryIndex

      public void setBraveryIndex(int index)
      How quickly will I try to escape once damaged?
      Parameters:
      index - The index of the Bravery modifier to be used.
    • setBraveryIndex

      public void setBraveryIndex(String index) throws PrincessException
      How quickly will I try to escape once damaged?
      Parameters:
      index - The index of the Bravery modifier to be used.
      Throws:
      PrincessException
    • getFallShameIndex

      public int getFallShameIndex()
      Returns:
      The index of my current FALL_SHAME_VALUES.
    • getFallShameValue

      public int getFallShameValue()
      Returns:
      How much do I want to avoid failed Piloting Rolls?
    • getFallShameValue

      public int getFallShameValue(int index)
      Parameters:
      index - The index of the FALL_SHAME_VALUES sought.
      Returns:
      The value at the given index. Indexes less than 0 are treated as 0 and indexes greater than 10 are treated as 10.
    • setFallShameIndex

      public void setFallShameIndex(int index)
      Parameters:
      index - The index of my current FALL_SHAME_VALUES.
    • setFallShameIndex

      public void setFallShameIndex(String index) throws PrincessException
      Parameters:
      index - The index of my current FALL_SHAME_VALUES.
      Throws:
      PrincessException
    • getMutualSupportIndex

      public int getMutualSupportIndex()
      How close do I want to stick to my teammates?
      Returns:
      Index of the current mutual support value.
    • getMutualSupportValue

      public double getMutualSupportValue()
      How close do I want to stick to my teammates?
      Returns:
      Current mutual support value.
    • getMutualSupportValue

      public double getMutualSupportValue(int index)
      How close do I want to stick to my teammates?
      Parameters:
      index - The index [0-10] of the mutual support value that should be used.
      Returns:
      The mutual support value at the specified index.
    • setMutualSupportIndex

      public void setMutualSupportIndex(int mutualSupportIndex)
      How close do I want to stick to my teammates?
      Parameters:
      mutualSupportIndex - The index [0-10] of the mutual support that should be used.
    • setMutualSupportIndex

      public void setMutualSupportIndex(String index) throws PrincessException
      How close do I want to stick to my teammates?
      Parameters:
      index - The index ["0"-"10"] of the mutual support value that should be used.
      Throws:
      PrincessException
    • getHerdMentalityIndex

      @Deprecated(since="0.50.08", forRemoval=true) public int getHerdMentalityIndex()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 0.50.08, use getMutualSupportIndex(). The setting was renamed from herding to mutual support; this delegates so code outside MegaMek keeps building.
      How close do I want to stick to my teammates?
      Returns:
      Index of the current mutual support value.
    • getHerdMentalityValue

      @Deprecated(since="0.50.08", forRemoval=true) public double getHerdMentalityValue()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 0.50.08, use getMutualSupportValue().
      How close do I want to stick to my teammates?
      Returns:
      Current mutual support value.
    • getHerdMentalityValue

      @Deprecated(since="0.50.08", forRemoval=true) public double getHerdMentalityValue(int index)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 0.50.08, use getMutualSupportValue(int).
      How close do I want to stick to my teammates?
      Parameters:
      index - The index [0-10] of the mutual support value that should be used.
      Returns:
      The mutual support value at the specified index.
    • setHerdMentalityIndex

      @Deprecated(since="0.50.08", forRemoval=true) public void setHerdMentalityIndex(int herdMentalityIndex)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 0.50.08, use setMutualSupportIndex(int).
      How close do I want to stick to my teammates?
      Parameters:
      herdMentalityIndex - The index [0-10] of the mutual support that should be used.
    • setHerdMentalityIndex

      @Deprecated(since="0.50.08", forRemoval=true) public void setHerdMentalityIndex(String index) throws PrincessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 0.50.08, use setMutualSupportIndex(String).
      How close do I want to stick to my teammates?
      Parameters:
      index - The index ["0"-"10"] of the mutual support value that should be used.
      Throws:
      PrincessException
    • getDestinationEdge

      public CardinalEdge getDestinationEdge()
      Princess's home edge.
      Returns:
      The CardinalEdge princess will flee to.
    • setDestinationEdge

      public void setDestinationEdge(@Nullable CardinalEdge destinationEdge)
      Princess's home edge.
      Parameters:
      destinationEdge - The CardinalEdge princess should flee to.
    • setDestinationEdge

      public void setDestinationEdge(int destinationEdge)
      Princess's home edge.
      Parameters:
      destinationEdge - the index of the CardinalEdge princess should flee to. See CardinalEdge.getIndex()
    • setDestinationEdge

      @Deprecated(since="0.50.06", forRemoval=true) public void setDestinationEdge(String destinationEdge) throws PrincessException
      Deprecated, for removal: This API element is subject to removal in a future version.
      unused
      Princess's home edge.
      Parameters:
      destinationEdge - the index of the CardinalEdge princess should flee to. See CardinalEdge.getIndex()
      Throws:
      PrincessException
    • getRetreatEdge

      public CardinalEdge getRetreatEdge()
      Princess's home edge.
      Returns:
      The CardinalEdge princess will flee to.
    • setRetreatEdge

      public void setRetreatEdge(@Nullable CardinalEdge retreatEdge)
      Princess's home edge.
      Parameters:
      retreatEdge - The CardinalEdge princess should flee to.
    • setRetreatEdge

      public void setRetreatEdge(int retreatEdge)
      Princess's home edge.
      Parameters:
      retreatEdge - the index of the CardinalEdge princess should flee to. See CardinalEdge.getIndex()
    • setRetreatEdge

      public void setRetreatEdge(String retreatEdge) throws PrincessException
      Princess's home edge.
      Parameters:
      retreatEdge - the index of the CardinalEdge princess should flee to. See CardinalEdge.getIndex()
      Throws:
      PrincessException
    • getHyperAggressionIndex

      public int getHyperAggressionIndex()
      How close to I want to get to my enemies?
      Returns:
      Index of the current hyper aggression value.
    • getHyperAggressionValue

      public double getHyperAggressionValue()
      How close to I want to get to my enemies?
      Returns:
      Current hyper aggression value.
    • getHyperAggressionValue

      public double getHyperAggressionValue(int index)
      How close to I want to get to my enemies?
      Parameters:
      index - The index[0-10] of the hyper aggression value desired.
      Returns:
      The hyper aggression value at the given index.
    • setHyperAggressionIndex

      public void setHyperAggressionIndex(int hyperAggressionIndex)
      How close to I want to get to my enemies?
      Parameters:
      hyperAggressionIndex - The index [0-10] of the hyper aggression value to be used.
    • getAntiCrowding

      public int getAntiCrowding()
    • setAntiCrowding

      public void setAntiCrowding(int antiCrowding)
    • setAntiCrowding

      public void setAntiCrowding(String antiCrowding) throws PrincessException
      Throws:
      PrincessException
    • getNumberOfEnemiesToConsiderFacing

      public int getNumberOfEnemiesToConsiderFacing()
    • setNumberOfEnemiesToConsiderFacing

      public void setNumberOfEnemiesToConsiderFacing(String numberOfEnemiesToConsiderFacing) throws PrincessException
      Throws:
      PrincessException
    • setNumberOfEnemiesToConsiderFacing

      public void setNumberOfEnemiesToConsiderFacing(int numberOfEnemiesToConsiderFacing)
    • getAllowFacingTolerance

      public int getAllowFacingTolerance()
    • setAllowFacingTolerance

      public void setAllowFacingTolerance(int allowFacingTolerance)
    • setAllowFacingTolerance

      public void setAllowFacingTolerance(String allowFacingTolerance) throws PrincessException
      Throws:
      PrincessException
    • getFavorHigherTMM

      public int getFavorHigherTMM()
    • setFavorHigherTMM

      public void setFavorHigherTMM(int favorHigherTMM)
    • setFavorHigherTMM

      public void setFavorHigherTMM(String favorHigherTMM) throws PrincessException
      Throws:
      PrincessException
    • setHyperAggressionIndex

      public void setHyperAggressionIndex(String index) throws PrincessException
      How close to I want to get to my enemies?
      Parameters:
      index - The index ["0"-"10"] of the hyper aggression value to be used.
      Throws:
      PrincessException
    • getSelfPreservationIndex

      public int getSelfPreservationIndex()
      How worried about enemy damage am I?
      Returns:
      Index of the current self-preservation value.
    • getSelfPreservationValue

      public double getSelfPreservationValue()
      How worried about enemy damage am I?
      Returns:
      The current self-preservation value.
    • getSelfPreservationValue

      public double getSelfPreservationValue(int index)
      How worried about enemy damage am I?
      Parameters:
      index - The index [0-10] of the self-preservation value desired.
      Returns:
      The self-preservation value at the specified index.
    • setSelfPreservationIndex

      public void setSelfPreservationIndex(int selfPreservationIndex)
      How worried about enemy damage am I?
      Parameters:
      selfPreservationIndex - The index [0-10] of the self-preservation value to be used.
    • setSelfPreservationIndex

      public void setSelfPreservationIndex(String index) throws PrincessException
      How worried about enemy damage am I?
      Parameters:
      index - The index ["0"-"10"] of the self-preservation value to be used.
      Throws:
      PrincessException
    • isDefault

      public boolean isDefault()
      Returns:
      TRUE if this is the default behavior settings for a princess bot.
    • toLog

      public String toLog()
      Returns:
      A string log of these behavior settings.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object