Пример #1
0
        public HistoryMap(int size, int[] shipLengths, CellStateMap cellStateMap)
            : base(size, shipLengths, cellStateMap)
        {
            this.variations = new double[size][];

            for (int i = 0; i < this.variations.Length; i++) {
                this.variations[i] = new double[size];
            };
        }
Пример #2
0
        public HistoryMap(int size, int[] shipLengths, CellStateMap cellStateMap)
            : base(size, shipLengths, cellStateMap)
        {
            this.variations = new double[size][];

            for (int i = 0; i < this.variations.Length; i++)
            {
                this.variations[i] = new double[size];
            }
            ;
        }
Пример #3
0
        protected int weighted; //Multiplies the impact of adding this map to other maps

        #endregion Fields

        #region Constructors

        public ProbabilityMap(int size, int[] shipLengths, CellStateMap cellStateMap)
        {
            this.size = size;
            this.shipLengths = shipLengths;
            this.cellStateMap = cellStateMap;
            this.weighted = 1;

            this.map = new int[size][];

            for (int i = 0; i < map.Length; i++) {
                map[i] = new int[size];
            };
        }
Пример #4
0
        public void NewMatch() {
            this.player = this.controller.Player;
            this.match = this.player.Match;
            ShotHelper.MatchX = match.FieldSize.X - 1;
            ShotHelper.MatchY = match.FieldSize.Y - 1;

            this.shipLengths = this.match.StartingShips.Select(ship => ship.Length).ToArray();

            cellStateMap = new CellStateMap(match.FieldSize.X);

            historyMap = new HistoryMap(match.FieldSize.X, this.shipLengths, cellStateMap);
            placementMap = new PlacementMap(match.FieldSize.X, this.shipLengths, cellStateMap);
            huntingMap = new HuntingMap(match.FieldSize.X, this.shipLengths, cellStateMap);
            
        }
        protected int weighted; //Multiplies the impact of adding this map to other maps

        public ProbabilityMap(int size, int[] shipLengths, CellStateMap cellStateMap)
        {
            this.size         = size;
            this.shipLengths  = shipLengths;
            this.cellStateMap = cellStateMap;
            this.weighted     = 1;

            this.map = new int[size][];

            for (int i = 0; i < map.Length; i++)
            {
                map[i] = new int[size];
            }
            ;
        }
Пример #6
0
        protected const bool REDUCE_PROBABILITY_ON_SINK = false; // Treats sinks as a miss and reduces hunting probability as such

        public HuntingMap(int size, int[] shipLengths, CellStateMap cellStateMap)
            : base(size, shipLengths, cellStateMap)
        {
            this.weighted = 50;
        }
Пример #7
0
        public void NewMatch()
        {
            this.player = this.controller.Player;
            this.match = this.player.Match;
            ShotHelper.MatchX = match.FieldSize.X - 1;
            ShotHelper.MatchY = match.FieldSize.Y - 1;

            this.shipLengths = this.match.StartingShips.Select(ship => ship.Length).ToArray();

            cellStateMap = new CellStateMap(match.FieldSize.X);

            historyMap = new HistoryMap(match.FieldSize.X, this.shipLengths, cellStateMap);
            placementMap = new PlacementMap(match.FieldSize.X, this.shipLengths, cellStateMap);
            huntingMap = new HuntingMap(match.FieldSize.X, this.shipLengths, cellStateMap);
        }
Пример #8
0
 public PlacementMap(int size, int[] shipLengths, CellStateMap cellStateMap)
     : base(size, shipLengths, cellStateMap)
 {
 }
Пример #9
0
        protected const bool RESET_HUNTING_ON_SINK = true; // Wipes hunting mode memory when a ship is sunk, if false,

        #endregion Fields

        #region Constructors

        public HuntingMap(int size, int[] shipLengths, CellStateMap cellStateMap)
            : base(size, shipLengths, cellStateMap)
        {
            this.weighted = 50;
        }
Пример #10
0
 public PlacementMap(int size, int[] shipLengths, CellStateMap cellStateMap)
     : base(size, shipLengths, cellStateMap)
 {
 }