Package megamek.client.bot.princess
Class MinefieldDeploymentPlanner
java.lang.Object
megamek.client.bot.princess.MinefieldDeploymentPlanner
This class handles evaluating spaces on the board for the purposes of minefield deployment
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionMinefieldDeploymentPlanner(Player player, Game game) Constructor for the minefield deployment planner. -
Method Summary
Modifier and TypeMethodDescriptionbuildCoalescedMinefieldScores(int minefieldType, Board board) Given a minefield type (from Minefield class), build a map of coordinates and their associated scores.getBucketedCandidateCoords(int minefieldType, Board board) Given a minefield type, the player, game and board Return a set of coordinates sorted into buckets by their utility score Within a bucket, the list of coordinates is randomizedintgetIndividualHexScoreForHoverVees(Hex hex, Board board) Worker function that takes the current hex and determines how good it is for placing a minefield into when the opponent is a hover vehicle Pro tip: mines are not very effective against hovercraft, so we cap this value at 1intgetIndividualHexScoreForInfantry(Hex hex, Board board) Worker function that takes the current hex and determines how good it is for placing a minefield into when the opponent is a mek Note that infantry is inherently less valuable BV-wise, so we cap the hex scores at 1.intgetIndividualHexScoreForMeks(Hex hex, Board board) Worker function that takes the current hex and determines how good it is for placing a minefield into when the opponent is a mekintgetIndividualHexScoreForTrackedVees(Hex hex, Board board) Worker function that takes the current hex and determines how good it is for placing a minefield into when the opponent is a tracked vehicleintgetIndividualHexScoreForWheeledVees(Hex hex, Board board) Worker function that takes the current hex and determines how good it is for placing a minefield into when the opponent is a wheeled vehiclegetMinefieldScores(int minefieldType, int unitType, EntityMovementMode movementMode, Board board) Given a mine field type (from Minefield class), a unit type (mek, tank etc), a movement mode (e.g.intRecommended weight setting for vibrabombs, calculated at initialization based on the number and weights of enemy meks presentvoidmarkMinePlacement(Coords coords) Increment mine placement counter
-
Field Details
-
DISALLOWED_TERRAIN_TYPES
-
POSITIVE_BUT_LOW_VALUE
public static final int POSITIVE_BUT_LOW_VALUE- See Also:
-
-
Constructor Details
-
MinefieldDeploymentPlanner
Constructor for the minefield deployment planner. Initializes opposition unit counts and "reasonable" vibrabomb setting
-
-
Method Details
-
markMinePlacement
Increment mine placement counter -
getVibrabombSetting
public int getVibrabombSetting()Recommended weight setting for vibrabombs, calculated at initialization based on the number and weights of enemy meks present -
getBucketedCandidateCoords
Given a minefield type, the player, game and board Return a set of coordinates sorted into buckets by their utility score Within a bucket, the list of coordinates is randomized -
buildCoalescedMinefieldScores
Given a minefield type (from Minefield class), build a map of coordinates and their associated scores. It's a weighted average depending on the numbers and types of units the opponent has. Currently, we only consider meks and ground-bound vehicles. -
getMinefieldScores
public Map<Coords,Integer> getMinefieldScores(int minefieldType, int unitType, EntityMovementMode movementMode, Board board) Given a mine field type (from Minefield class), a unit type (mek, tank etc), a movement mode (e.g. walking, wheeld etc) and the board, get a map of hexes and their suitability values for minefield placement -
getIndividualHexScoreForMeks
Worker function that takes the current hex and determines how good it is for placing a minefield into when the opponent is a mek -
getIndividualHexScoreForTrackedVees
Worker function that takes the current hex and determines how good it is for placing a minefield into when the opponent is a tracked vehicle -
getIndividualHexScoreForWheeledVees
Worker function that takes the current hex and determines how good it is for placing a minefield into when the opponent is a wheeled vehicle -
getIndividualHexScoreForHoverVees
Worker function that takes the current hex and determines how good it is for placing a minefield into when the opponent is a hover vehicle Pro tip: mines are not very effective against hovercraft, so we cap this value at 1 -
getIndividualHexScoreForInfantry
Worker function that takes the current hex and determines how good it is for placing a minefield into when the opponent is a mek Note that infantry is inherently less valuable BV-wise, so we cap the hex scores at 1.
-