C# Класс EricVoglBattleship.AdaptiveBattleshipOffense

Battleship offense that attempts to shoot at the most probable location on the board, given possible ship positions and previous placement history
Наследование: IBattleshipOffense
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Cleanup ( GameEndState state ) : void

Cleans up an offense

DumpProbabilities ( ) : void

Display probabilities (DEBUG)

Fire ( ) : Position

Fires at a position

Hit ( ) : void

Register last fire as a hit

Initialize ( BattleshipPlayer player ) : void

Initializes a battleship offense

Miss ( ) : void

Register last fire as a miss

RegisterEnemyPositions ( List ships ) : void

Enemy positions sent to us after game ends

Sink ( string s ) : void

Notify that a ship has sunk

Приватные методы

Метод Описание
AdjacentPositions ( Position p ) : IEnumerable

Returns all positions adjacent to a position

AdjustNotAdjacentScore ( Position pos ) : void

Adjust scores in the not-adjacent matrix

AdjustScore ( Position pos ) : void

Adjust scores based on the last shot

CheckAdjacent ( int row, int col, List candidates, double &maxValue ) : void

Checks adjacent squares for candidates

DestroyShot ( ) : List

Find next best shots in destroy mode

DetermineRemainingPositions ( ) : void

Adjust the total remaining positions

HistoricalHitProbability ( int row, int col ) : double

Determines the historical hit probability

NeighborScore ( Position pos, bool normalize ) : double

Determines the Neighbor score at a given position

Score ( int row, int col, bool includeNeighbor ) : double

Determines total probability at position p

SearchShot ( bool even ) : List

Choose the next best shot in Search mode

Sink ( Ship ship ) : void

Adjust position possibilies based on the fact that a ship was sunk

Описание методов

Cleanup() публичный Метод

Cleans up an offense
public Cleanup ( GameEndState state ) : void
state GameEndState
Результат void

DumpProbabilities() публичный Метод

Display probabilities (DEBUG)
public DumpProbabilities ( ) : void
Результат void

Fire() публичный Метод

Fires at a position
public Fire ( ) : Position
Результат Position

Hit() публичный Метод

Register last fire as a hit
public Hit ( ) : void
Результат void

Initialize() публичный Метод

Initializes a battleship offense
public Initialize ( BattleshipPlayer player ) : void
player BattleshipUtility.BattleshipPlayer owning player
Результат void

Miss() публичный Метод

Register last fire as a miss
public Miss ( ) : void
Результат void

RegisterEnemyPositions() публичный Метод

Enemy positions sent to us after game ends
public RegisterEnemyPositions ( List ships ) : void
ships List
Результат void

Sink() публичный Метод

Notify that a ship has sunk
public Sink ( string s ) : void
s string Code representing the ship
Результат void