Package megamek.client.bot.princess
Class BehaviorSettings
java.lang.Object
megamek.client.bot.princess.BehaviorSettings
- All Implemented Interfaces:
Serializable
- Since:
- 17-Aug-2013 10:47 PM
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final double[]static final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIgnoredUnitTarget(int unitID) Add the given unit ID to the ignored target list.voidaddPriorityUnit(int id) Add an enemy unit to the priority list.voidAdd an enemy unit to the priority list.voidaddStrategicTarget(String target) Adds a target that Princess will attempt to move to and attack.voidEmpty out the ignored target list.booleanintintintHow quickly will I try to escape once damaged?doubleHow quickly will I try to escape once damaged?doublegetBraveryValue(int index) How quickly will I try to escape once damaged?getCopy()Returns the name for this type of behavior.Princess's home edge.intintintgetFallShameValue(int index) intintDeprecated, for removal: This API element is subject to removal in a future version.doubleDeprecated, for removal: This API element is subject to removal in a future version.since 0.50.08, usegetMutualSupportValue().doublegetHerdMentalityValue(int index) Deprecated, for removal: This API element is subject to removal in a future version.since 0.50.08, usegetMutualSupportValue(int).intHow close to I want to get to my enemies?doubleHow close to I want to get to my enemies?doublegetHyperAggressionValue(int index) How close to I want to get to my enemies?intHow close do I want to stick to my teammates?doubleHow close do I want to stick to my teammates?doublegetMutualSupportValue(int index) How close do I want to stick to my teammates?intPrincess's home edge.intHow worried about enemy damage am I?doubleHow worried about enemy damage am I?doublegetSelfPreservationValue(int index) How worried about enemy damage am I?A list of hexes that Princess will attempt to move to and attack.inthashCode()booleanbooleanbooleanDeprecated, for removal: This API element is subject to removal in a future version.since 0.50.08, useisExclusiveMutualSupport().booleanbooleanbooleanWhen this is true, Princess will follow the Forced Withdrawal rules from Total Warfare.booleanvoidremoveIgnoredUnitTarget(int unitID) Remove the given unit ID from the ignored target list.voidsetAllowFacingTolerance(int allowFacingTolerance) voidsetAllowFacingTolerance(String allowFacingTolerance) voidsetAntiCrowding(int antiCrowding) voidsetAntiCrowding(String antiCrowding) voidsetAutoFlee(boolean autoFlee) voidsetBraveryIndex(int index) How quickly will I try to escape once damaged?voidsetBraveryIndex(String index) How quickly will I try to escape once damaged?voidsetCombatPosture(String combatPosture) voidsetCombatPosture(CombatPosture combatPosture) voidsetDescription(String description) Sets the name for this type of behavior.voidsetDestinationEdge(int destinationEdge) Princess's home edge.voidsetDestinationEdge(String destinationEdge) Deprecated, for removal: This API element is subject to removal in a future version.unusedvoidsetDestinationEdge(CardinalEdge destinationEdge) Princess's home edge.voidsetExclusiveHerding(boolean exclusiveHerding) Deprecated, for removal: This API element is subject to removal in a future version.since 0.50.08, usesetExclusiveMutualSupport(boolean).voidsetExclusiveHerding(String exclusiveHerding) Deprecated, for removal: This API element is subject to removal in a future version.since 0.50.08, usesetExclusiveMutualSupport(String).voidsetExclusiveMutualSupport(boolean exclusiveMutualSupport) voidsetExclusiveMutualSupport(String exclusiveMutualSupport) voidsetExperimental(boolean experimental) voidsetExperimental(String experimental) voidsetFallShameIndex(int index) voidsetFallShameIndex(String index) voidsetFavorHigherTMM(int favorHigherTMM) voidsetFavorHigherTMM(String favorHigherTMM) voidsetForcedWithdrawal(boolean forcedWithdrawal) When this is true, Princess will follow the Forced Withdrawal rules from Total Warfare.voidsetForcedWithdrawal(String forcedWithdrawal) When this is true, Princess will follow the Forced Withdrawal rules from Total Warfare.voidsetHerdMentalityIndex(int herdMentalityIndex) Deprecated, for removal: This API element is subject to removal in a future version.since 0.50.08, usesetMutualSupportIndex(int).voidsetHerdMentalityIndex(String index) Deprecated, for removal: This API element is subject to removal in a future version.since 0.50.08, usesetMutualSupportIndex(String).voidsetHyperAggressionIndex(int hyperAggressionIndex) How close to I want to get to my enemies?voidsetHyperAggressionIndex(String index) How close to I want to get to my enemies?voidsetIAmAPirate(boolean iAmAPirate) voidsetIAmAPirate(String iAmAPirate) voidsetIgnoreDamageOutput(boolean ignoreDamageOutput) voidsetMutualSupportIndex(int mutualSupportIndex) How close do I want to stick to my teammates?voidsetMutualSupportIndex(String index) How close do I want to stick to my teammates?voidsetNumberOfEnemiesToConsiderFacing(int numberOfEnemiesToConsiderFacing) voidsetNumberOfEnemiesToConsiderFacing(String numberOfEnemiesToConsiderFacing) voidsetRetreatEdge(int retreatEdge) Princess's home edge.voidsetRetreatEdge(String retreatEdge) Princess's home edge.voidsetRetreatEdge(CardinalEdge retreatEdge) Princess's home edge.voidsetSelfPreservationIndex(int selfPreservationIndex) How worried about enemy damage am I?voidsetSelfPreservationIndex(String index) How worried about enemy damage am I?booleanbooleantoLog()
-
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
-
BehaviorSettings
public BehaviorSettings() -
BehaviorSettings
- Throws:
PrincessException
-
-
Method Details
-
getCopy
- 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
- 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
- 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
-
getCombatPosture
- Returns:
- whether my force is attacking, defending, or deciding for itself. See
CombatPosture.
-
setCombatPosture
- Parameters:
combatPosture- whether my force is attacking, defending, or deciding for itself;nullresets toCombatPosture.AUTO
-
setCombatPosture
-
isExclusiveHerding
Deprecated, for removal: This API element is subject to removal in a future version.since 0.50.08, useisExclusiveMutualSupport(). 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.since 0.50.08, usesetExclusiveMutualSupport(boolean).- 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.since 0.50.08, usesetExclusiveMutualSupport(String).- 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
Returns the name for this type of behavior.- Returns:
- the name for this type of behavior.
-
setDescription
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
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
Adds a target that Princess will attempt to move to and attack.- Parameters:
target- The target to be added.
-
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
- 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
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
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
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 theFALL_SHAME_VALUESsought.- 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 currentFALL_SHAME_VALUES.
-
setFallShameIndex
- Parameters:
index- The index of my currentFALL_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
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, for removal: This API element is subject to removal in a future version.since 0.50.08, usegetMutualSupportIndex(). 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, for removal: This API element is subject to removal in a future version.since 0.50.08, usegetMutualSupportValue().How close do I want to stick to my teammates?- Returns:
- Current mutual support value.
-
getHerdMentalityValue
Deprecated, for removal: This API element is subject to removal in a future version.since 0.50.08, usegetMutualSupportValue(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, usesetMutualSupportIndex(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, usesetMutualSupportIndex(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
Princess's home edge.- Returns:
- The
CardinalEdgeprincess will flee to.
-
setDestinationEdge
Princess's home edge.- Parameters:
destinationEdge- TheCardinalEdgeprincess should flee to.
-
setDestinationEdge
public void setDestinationEdge(int destinationEdge) Princess's home edge.- Parameters:
destinationEdge- the index of theCardinalEdgeprincess should flee to. SeeCardinalEdge.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.unusedPrincess's home edge.- Parameters:
destinationEdge- the index of theCardinalEdgeprincess should flee to. SeeCardinalEdge.getIndex()- Throws:
PrincessException
-
getRetreatEdge
Princess's home edge.- Returns:
- The
CardinalEdgeprincess will flee to.
-
setRetreatEdge
Princess's home edge.- Parameters:
retreatEdge- TheCardinalEdgeprincess should flee to.
-
setRetreatEdge
public void setRetreatEdge(int retreatEdge) Princess's home edge.- Parameters:
retreatEdge- the index of theCardinalEdgeprincess should flee to. SeeCardinalEdge.getIndex()
-
setRetreatEdge
Princess's home edge.- Parameters:
retreatEdge- the index of theCardinalEdgeprincess should flee to. SeeCardinalEdge.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
- 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
- Throws:
PrincessException
-
getFavorHigherTMM
public int getFavorHigherTMM() -
setFavorHigherTMM
public void setFavorHigherTMM(int favorHigherTMM) -
setFavorHigherTMM
- Throws:
PrincessException
-
setHyperAggressionIndex
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
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
- Returns:
- A string log of these behavior settings.
-
equals
-
hashCode
public int hashCode()
-
getMutualSupportIndex().