/** * @file Globals.java * @brief * File containing the Globals class, a helper class for the * vector based evaluation system * * @author Christos Choutouridis 8997 cchoutou@ece.auth.gr * @author Konstantina Tsechelidou 8445 konstsec@ece.auth.gr */ package gr.auth.ee.dsproject.node; import gr.auth.ee.dsproject.pacman.PacmanUtilities; /** * @class Globals * @brief * Contains constants and factors to trick * the Node evaluation algorithm */ public class Globals { /* * Evaluation settings */ /** * Mixing factor for the minimum distance */ // ghosts public static final double EVAL_GHOSTDIST_MIN_FACTOR = 0.85; public static final double EVAL_GHOSTDIST_AVER_FACTOR = 1 - EVAL_GHOSTDIST_MIN_FACTOR; public static final double EVAL_GHOSTMINDIST_ISOLATION = 1; public static final int EVAL_GHOST_BOOST = 2; public static final int EVAL_GHOSTBOOST_OFFSET = -25; public static final int EVAL_GHOST_TERRITORY = 6; public static final int EVAL_GHOSTTERRITORY_OFFSET = -50; // flags public static final int EVAL_FLAG_BOOST = 2; public static final int EVAL_FLAGBOOST_OFFSET = 25; /** * Evaluation mixing factor representing how much the individual * evaluation values(host, flag, torus) affect the final evaluation of the position */ public static final double EVAL_GHOSTDIST_FACTOR = 0.65; public static final double EVAL_FLAGDIST_FACTOR = 0.40; public static final double EVAL_TORUSDIST_FACTOR = 0.04; /* * Tree settings */ public static final int MINMAXTREE_MAX_DEPTH = 2; // MUST be multiple of 2 /* * Maze setting */ public static final int[] POSITION_FALSE = {-1, -1}; public static final int DISTANCE_MAX = PacmanUtilities.numberOfRows + PacmanUtilities.numberOfColumns - 1; public static final int DISTANCE_FALSE = -1; public static final int FLAGDIST_MAX = 26; // add some for safety (lowers the gain) public static final int BORDERDIST_MAX = 12; // add some for safety (lowers the gain) /* * In order to find out when a creature is inside a cavity we manually * define the box limits of the cavity boxes of the current maze here * :) */ public static final int BOXES[][][] = { { { 5, 5}, { 8, 8} }, { { 5, 16}, { 8, 19} }, { {11, 5}, {14, 8} }, { {11, 16}, {14, 19} } }; /** * Torus borders are the squares in the outer limits of the maze where * there are no walls. Pacman'a gravity can curve the maze plane to * a torus through these squares. This function check if a box is * a torus border box */ public static final int TORUS_BORDERS[][] = { {0, 11}, {0, 12}, {0, 13}, {9, 0}, {9, 24}, {10, 0}, {10, 24}, {19, 11}, {19, 12}, {19, 13}, }; /* * General algorithm constants */ public static final int NO_PLACE = -1; // out of region square public static final int INVALID_MOVE = -1; // invalid move marker public static final int EVAL_MAX = 100; // out max evaluation value public static final int EVAL_MIN = 0; // our minimum evaluation value public static final int EVAL_FINAL_MAX = 100; public static final int EVAL_FINAL_MIN = -100; public static final int NO_EVAL = EVAL_FINAL_MIN-1; // mark the invalid on no evaluation }