Class MinefieldDeploymentPlanner

java.lang.Object
megamek.client.bot.princess.MinefieldDeploymentPlanner

public class MinefieldDeploymentPlanner extends Object
This class handles evaluating spaces on the board for the purposes of minefield deployment
  • Field Details

    • DISALLOWED_TERRAIN_TYPES

      public static final Set<Integer> DISALLOWED_TERRAIN_TYPES
    • POSITIVE_BUT_LOW_VALUE

      public static final int POSITIVE_BUT_LOW_VALUE
      See Also:
  • Constructor Details

    • MinefieldDeploymentPlanner

      public MinefieldDeploymentPlanner(Player player, Game game)
      Constructor for the minefield deployment planner. Initializes opposition unit counts and "reasonable" vibrabomb setting
  • Method Details

    • markMinePlacement

      public void markMinePlacement(Coords coords)
      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

      public Map<Double,List<Coords>> 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 randomized
    • buildCoalescedMinefieldScores

      public Map<Coords,Double> buildCoalescedMinefieldScores(int minefieldType, Board board)
      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

      public int getIndividualHexScoreForMeks(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
    • getIndividualHexScoreForTrackedVees

      public int getIndividualHexScoreForTrackedVees(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 vehicle
    • getIndividualHexScoreForWheeledVees

      public int getIndividualHexScoreForWheeledVees(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 vehicle
    • getIndividualHexScoreForHoverVees

      public int getIndividualHexScoreForHoverVees(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 1
    • getIndividualHexScoreForInfantry

      public int getIndividualHexScoreForInfantry(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.