From e365749c378a8935517babc58a91e961b5d3ca69 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sat, 14 Sep 2024 15:42:10 -0400 Subject: [PATCH] Battleship board generator and samplers. modified: ../../../../.gitignore new file: battleship_boards.py modified: battleship_genetic.py deleted: battleship_genetic2.py modified: battleship_learning.json modified: compare_battleship.sh new file: elites.json new file: sample_from_tarball.sh new file: sample_one_from_tarball.sh --- .gitignore | 2 + .../battleship-solvers/battleship_boards.py | 63 + .../battleship-solvers/battleship_genetic.py | 461 ++- .../battleship-solvers/battleship_genetic2.py | 487 --- .../battleship_learning.json | 2954 ++++++++--------- .../battleship-solvers/compare_battleship.sh | 17 +- .../2024/battleship-solvers/elites.json | 1302 ++++++++ .../battleship-solvers/sample_from_tarball.sh | 10 + .../sample_one_from_tarball.sh | 7 + 9 files changed, 3220 insertions(+), 2083 deletions(-) create mode 100644 content/uploads/2024/battleship-solvers/battleship_boards.py delete mode 100644 content/uploads/2024/battleship-solvers/battleship_genetic2.py create mode 100644 content/uploads/2024/battleship-solvers/elites.json create mode 100644 content/uploads/2024/battleship-solvers/sample_from_tarball.sh create mode 100644 content/uploads/2024/battleship-solvers/sample_one_from_tarball.sh diff --git a/.gitignore b/.gitignore index 75b681f..f3fc21a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ __pycache__/ # C extensions *.so +*.tar.gz + .DS_Store *.swp diff --git a/content/uploads/2024/battleship-solvers/battleship_boards.py b/content/uploads/2024/battleship-solvers/battleship_boards.py new file mode 100644 index 0000000..c86d138 --- /dev/null +++ b/content/uploads/2024/battleship-solvers/battleship_boards.py @@ -0,0 +1,63 @@ +import json +import multiprocessing +import random +from tqdm import tqdm + +# Define ship configurations +ships = {"Carrier": 5, "Battleship": 4, "Cruiser": 3, "Submarine": 3, "Destroyer": 2} + + +def place_ships(grid_size=100): + """Randomly place ships on a grid.""" + grid = [""] * grid_size + for ship, size in ships.items(): + placed = False + while not placed: + orientation = random.choice(["horizontal", "vertical"]) + if orientation == "horizontal": + start = random.randint(0, grid_size - size) + if all(grid[start + i] == "" for i in range(size)): + for i in range(size): + grid[start + i] = ship + placed = True + else: + start = random.randint(0, grid_size - size * 10) + if all(grid[start + i * 10] == "" for i in range(size)): + for i in range(size): + grid[start + i * 10] = ship + placed = True + return grid + + +def worker(num_boards, output_queue): + """Worker function to generate boards.""" + for _ in range(num_boards): + board = place_ships() + output_queue.put(board) + + +def main(total_boards=1000000, num_processes=4): + """Main function to manage multiprocessing and progress tracking.""" + boards_per_process = total_boards // num_processes + output_queue = multiprocessing.Queue() + processes = [] + + for _ in range(num_processes): + p = multiprocessing.Process( + target=worker, args=(boards_per_process, output_queue) + ) + processes.append(p) + p.start() + + with open("battleship_boards.json", "w") as f: + for _ in tqdm(range(total_boards), desc="Generating Boards"): + board = output_queue.get() + json.dump(board, f) + f.write("\n") + + for p in processes: + p.join() + + +if __name__ == "__main__": + main() diff --git a/content/uploads/2024/battleship-solvers/battleship_genetic.py b/content/uploads/2024/battleship-solvers/battleship_genetic.py index 04142c8..06edffd 100644 --- a/content/uploads/2024/battleship-solvers/battleship_genetic.py +++ b/content/uploads/2024/battleship-solvers/battleship_genetic.py @@ -3,116 +3,229 @@ import json import os import sys import time +from tqdm import tqdm +from multiprocessing import Pool GRID_SIZE = 10 SHIPS = {"Carrier": 5, "Battleship": 4, "Cruiser": 3, "Submarine": 3, "Destroyer": 2} POPULATION_SIZE = 200 -GENERATIONS = 100 -MUTATION_RATE = 0.1 -GAMES_PER_INDIVIDUAL = 10 +GENERATIONS = 50 +BASE_MUTATION_RATE = 0.1 +GAMES_PER_INDIVIDUAL = 20 LEARNING_FILE = "battleship_learning.json" +MUTATION_MULTIPLIERS = { + "adjacent_hit_weight": 0.5, + "ship_size_weight": 1.5, + "parity_weight": 1.5, + "hunt_mode_threshold": 1.0, + "prob_grid_weight": 1.0, + "avoid_edges_weight": 1.0, +} + + +class Board: + def __init__(self): + self.grid = [[None for _ in range(GRID_SIZE)] for _ in range(GRID_SIZE)] + self.ships_left = set(SHIPS.keys()) + self.place_all_ships() + + def place_all_ships(self): + for ship, size in SHIPS.items(): + while True: + row = random.randint(0, GRID_SIZE - 1) + col = random.randint(0, GRID_SIZE - 1) + horizontal = random.choice([True, False]) + if self.is_valid_placement(row, col, size, horizontal): + self.place_ship(row, col, size, horizontal, ship) + break + + def is_valid_placement(self, row, col, size, horizontal): + if horizontal: + if col + size > GRID_SIZE: + return False + return all(self.grid[row][c] is None for c in range(col, col + size)) + else: + if row + size > GRID_SIZE: + return False + return all(self.grid[r][col] is None for r in range(row, row + size)) + + def place_ship(self, row, col, size, horizontal, ship): + if horizontal: + for c in range(col, col + size): + self.grid[row][c] = ship + else: + for r in range(row, row + size): + self.grid[r][col] = ship + + def is_sunk(self, ship, hits): + return all( + (r, c) in hits + for r in range(GRID_SIZE) + for c in range(GRID_SIZE) + if self.grid[r][c] == ship + ) + + def update_sunk_ships(self, hits): + for ship in list(self.ships_left): + if self.is_sunk(ship, hits): + self.ships_left.remove(ship) + + def get_remaining_ships(self): + return [size for ship, size in SHIPS.items() if ship in self.ships_left] + class BattleshipStrategy: + ADJACENT_HIT_WEIGHT_RANGE = (1, 20) + SHIP_SIZE_WEIGHT_RANGE = (0, 10) + PARITY_WEIGHT_RANGE = (0, 10) + HUNT_MODE_THRESHOLD_RANGE = (0.1, 1) + PROB_GRID_WEIGHT_RANGE = (0, 1) + AVOID_EDGES_WEIGHT_RANGE = (0, 1) + def __init__(self): - self.adjacent_hit_weight = random.uniform(1, 5) - self.checkerboard_weight = random.uniform(0, 2) - self.avoid_edges_weight = random.uniform(0, 1) - self.hunt_mode_threshold = random.uniform(0.1, 0.5) + self.adjacent_hit_weight = random.uniform(*self.ADJACENT_HIT_WEIGHT_RANGE) + self.ship_size_weight = random.uniform(*self.SHIP_SIZE_WEIGHT_RANGE) + self.parity_weight = random.uniform(*self.PARITY_WEIGHT_RANGE) + self.hunt_mode_threshold = random.uniform(*self.HUNT_MODE_THRESHOLD_RANGE) + self.prob_grid_weight = random.uniform(*self.PROB_GRID_WEIGHT_RANGE) + self.avoid_edges_weight = random.uniform(*self.AVOID_EDGES_WEIGHT_RANGE) + self._probability_grid = None + + def serialize(self, include_grid=False): + data = { + "adjacent_hit_weight": self.adjacent_hit_weight, + "ship_size_weight": self.ship_size_weight, + "parity_weight": self.parity_weight, + "hunt_mode_threshold": self.hunt_mode_threshold, + "prob_grid_weight": self.prob_grid_weight, + "avoid_edges_weight": self.avoid_edges_weight, + } + if include_grid: + data["probability_grid"] = self.probability_grid + return data + + @property + def probability_grid(self): + if self._probability_grid is None: + self.reset_probability_grid() + return self._probability_grid + + def reset_probability_grid(self): + self._probability_grid = [ + [1 for _ in range(GRID_SIZE)] for _ in range(GRID_SIZE) + ] + + def update_probability_grid(self, hits, misses): + for i in range(GRID_SIZE): + for j in range(GRID_SIZE): + if (i, j) in hits: + self.probability_grid[i][j] = 0 + elif (i, j) in misses: + self.probability_grid[i][j] = -1 + else: + self.probability_grid[i][j] = 1 + + for i, j in hits: + for di, dj in [(-1, 0), (1, 0), (0, -1), (0, 1)]: + ni, nj = i + di, j + dj + if ( + 0 <= ni < GRID_SIZE + and 0 <= nj < GRID_SIZE + and (ni, nj) not in hits + and (ni, nj) not in misses + ): + self.probability_grid[ni][nj] *= self.adjacent_hit_weight + + for i in range(GRID_SIZE): + for j in range(GRID_SIZE): + if i == 0 or i == GRID_SIZE - 1 or j == 0 or j == GRID_SIZE - 1: + self.probability_grid[i][j] *= 1 - self.avoid_edges_weight + + max_prob = max(max(row) for row in self.probability_grid if max(row) > 0) + if max_prob > 0: + for i in range(GRID_SIZE): + for j in range(GRID_SIZE): + if self.probability_grid[i][j] > 0: + self.probability_grid[i][j] = int( + (self.probability_grid[i][j] / max_prob) * 100 + ) def get_next_move(self, board, hits, misses): - scores = [[0 for _ in range(GRID_SIZE)] for _ in range(GRID_SIZE)] + self.update_probability_grid(hits, misses) + probabilities = [ + [self.probability_grid[i][j] for j in range(GRID_SIZE)] + for i in range(GRID_SIZE) + ] + remaining_ships = [size for ship, size in SHIPS.items() if size > len(hits)] for i in range(GRID_SIZE): for j in range(GRID_SIZE): if (i, j) in hits or (i, j) in misses: + probabilities[i][j] = 0 continue - # Adjacent to hit - for di, dj in [(-1, 0), (1, 0), (0, -1), (0, 1)]: - if ( - 0 <= i + di < GRID_SIZE - and 0 <= j + dj < GRID_SIZE - and (i + di, j + dj) in hits - ): - scores[i][j] += self.adjacent_hit_weight + for size in remaining_ships: + if self.can_fit_ship(board, i, j, size): + probabilities[i][j] *= self.ship_size_weight - # Checkerboard pattern if (i + j) % 2 == 0: - scores[i][j] += self.checkerboard_weight + probabilities[i][j] *= self.parity_weight - # Avoid edges - if i in [0, GRID_SIZE - 1] or j in [0, GRID_SIZE - 1]: - scores[i][j] -= self.avoid_edges_weight + max_prob = max(max(row) for row in probabilities) + for i in range(GRID_SIZE): + for j in range(GRID_SIZE): + probabilities[i][j] *= self.prob_grid_weight + if max_prob > 0: + probabilities[i][j] += (1 - self.prob_grid_weight) * ( + probabilities[i][j] / max_prob + ) - max_score = max(max(row) for row in scores) + max_prob = max(max(row) for row in probabilities) candidates = [ (i, j) for i in range(GRID_SIZE) for j in range(GRID_SIZE) - if scores[i][j] == max_score and (i, j) not in hits and (i, j) not in misses + if probabilities[i][j] == max_prob ] - return ( - random.choice(candidates) - if candidates - else random.choice( - [ - (i, j) - for i in range(GRID_SIZE) - for j in range(GRID_SIZE) - if (i, j) not in hits and (i, j) not in misses - ] - ) - ) + return random.choice(candidates) + + def can_fit_ship(self, board, row, col, size): + if col + size <= GRID_SIZE and all( + board[row][c] == 0 for c in range(col, col + size) + ): + return True + if row + size <= GRID_SIZE and all( + board[r][col] == 0 for r in range(row, row + size) + ): + return True + return False -def create_random_board(): - board = [[0 for _ in range(GRID_SIZE)] for _ in range(GRID_SIZE)] - for ship, size in SHIPS.items(): - while True: - row = random.randint(0, GRID_SIZE - 1) - col = random.randint(0, GRID_SIZE - 1) - horizontal = random.choice([True, False]) - if is_valid_placement(board, row, col, size, horizontal): - place_ship(board, row, col, size, horizontal) - break - return board - - -def is_valid_placement(board, row, col, size, horizontal): - if horizontal: - if col + size > GRID_SIZE: - return False - return all(board[row][c] == 0 for c in range(col, col + size)) - else: - if row + size > GRID_SIZE: - return False - return all(board[r][col] == 0 for r in range(row, row + size)) - - -def place_ship(board, row, col, size, horizontal): - if horizontal: - for c in range(col, col + size): - board[row][c] = 1 - else: - for r in range(row, row + size): - board[r][col] = 1 - - -def play_game(strategy): - board = create_random_board() +def play_game(strategy, use_ensemble=False): + board = Board() hits = set() misses = set() turns = 0 - ships_left = sum(SHIPS.values()) - while ships_left > 0 and turns < 100: - i, j = strategy.get_next_move(board, hits, misses) + elite_strategies = load_elite_strategies() if use_ensemble else None + + if strategy is not None: + strategy.reset_probability_grid() + + while board.ships_left and turns < 100: + if use_ensemble: + i, j = get_ensemble_move(elite_strategies, board, hits, misses) + else: + i, j = strategy.get_next_move(board.grid, hits, misses) + strategy.update_probability_grid(hits, misses) + turns += 1 - if board[i][j] == 1: + if board.grid[i][j] is not None: hits.add((i, j)) - ships_left -= 1 + ship = board.grid[i][j] + board.update_sunk_ships(hits) else: misses.add((i, j)) @@ -121,38 +234,69 @@ def play_game(strategy): def crossover(parent1, parent2): child = BattleshipStrategy() - child.avoid_edges_weight = random.choice( - [parent1.avoid_edges_weight, parent2.avoid_edges_weight] + child.adjacent_hit_weight = random.choice( + [parent1.adjacent_hit_weight, parent2.adjacent_hit_weight] ) + child.ship_size_weight = random.choice( + [parent1.ship_size_weight, parent2.ship_size_weight] + ) + child.parity_weight = random.choice([parent1.parity_weight, parent2.parity_weight]) child.hunt_mode_threshold = random.choice( [parent1.hunt_mode_threshold, parent2.hunt_mode_threshold] ) - - if parent1.adjacent_hit_weight < parent2.adjacent_hit_weight: - child.adjacent_hit_weight = parent1.adjacent_hit_weight - else: - child.adjacent_hit_weight = parent2.adjacent_hit_weight - - if parent1.checkerboard_weight < parent2.checkerboard_weight: - child.checkerboard_weight = parent1.checkerboard_weight - else: - child.checkerboard_weight = parent2.checkerboard_weight - + child.prob_grid_weight = random.choice( + [parent1.prob_grid_weight, parent2.prob_grid_weight] + ) + child.avoid_edges_weight = random.choice( + [parent1.avoid_edges_weight, parent2.avoid_edges_weight] + ) return child def mutate(individual): - if random.random() < MUTATION_RATE * 2: - individual.avoid_edges_weight = random.uniform(0, 1) - if random.random() < MUTATION_RATE * 1.5: - individual.hunt_mode_threshold = random.uniform(0.1, 0.5) - if random.random() < MUTATION_RATE * 0.8: - individual.adjacent_hit_weight = random.uniform(1, 5) - if random.random() < MUTATION_RATE * 0.8: - individual.checkerboard_weight = random.uniform(0, 2) + if ( + random.random() + < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["adjacent_hit_weight"] + ): + individual.adjacent_hit_weight = random.uniform( + *BattleshipStrategy.ADJACENT_HIT_WEIGHT_RANGE + ) + if random.random() < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["ship_size_weight"]: + individual.ship_size_weight = random.uniform( + *BattleshipStrategy.SHIP_SIZE_WEIGHT_RANGE + ) + if random.random() < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["parity_weight"]: + individual.parity_weight = random.uniform( + *BattleshipStrategy.PARITY_WEIGHT_RANGE + ) + if ( + random.random() + < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["hunt_mode_threshold"] + ): + individual.hunt_mode_threshold = random.uniform( + *BattleshipStrategy.HUNT_MODE_THRESHOLD_RANGE + ) + if random.random() < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["prob_grid_weight"]: + individual.prob_grid_weight = random.uniform( + *BattleshipStrategy.PROB_GRID_WEIGHT_RANGE + ) + if ( + random.random() + < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["avoid_edges_weight"] + ): + individual.avoid_edges_weight = random.uniform( + *BattleshipStrategy.AVOID_EDGES_WEIGHT_RANGE + ) return individual +def evaluate_strategy(strategy): + total_turns = 0 + for _ in range(GAMES_PER_INDIVIDUAL): + total_turns += play_game(strategy) + return total_turns + + def genetic_algorithm(continue_training=False): if continue_training and os.path.exists(LEARNING_FILE): with open(LEARNING_FILE, "r") as f: @@ -160,23 +304,26 @@ def genetic_algorithm(continue_training=False): population = [BattleshipStrategy() for _ in range(POPULATION_SIZE)] for i, strategy_data in enumerate(data): population[i].__dict__.update(strategy_data) - print("Continuing training from existing population.") + tqdm.write("Continuing training from existing population.") else: if os.path.exists(LEARNING_FILE): timestamp = time.strftime("%Y%m%d-%H%M%S") os.rename(LEARNING_FILE, f"{LEARNING_FILE}.{timestamp}") - print(f"Moved existing model to {LEARNING_FILE}.{timestamp}") + tqdm.write(f"Moved existing model to {LEARNING_FILE}.{timestamp}") population = [BattleshipStrategy() for _ in range(POPULATION_SIZE)] - print("Starting with a new population.") + tqdm.write("Starting with a new population.") best_fitness = float("inf") generations_without_improvement = 0 + progress_bar = tqdm( + total=GENERATIONS * POPULATION_SIZE, file=sys.stderr, desc="Overall Progress" + ) + for generation in range(GENERATIONS): - fitness_scores = [ - sum(play_game(strategy) for _ in range(GAMES_PER_INDIVIDUAL)) - for strategy in population - ] + with Pool() as pool: + fitness_scores = list(pool.imap(evaluate_strategy, population)) + progress_bar.update(POPULATION_SIZE) population = [ x @@ -194,25 +341,51 @@ def genetic_algorithm(continue_training=False): else: generations_without_improvement += 1 - print( + tqdm.write( f"Generation {generation + 1}: Best fitness = {current_best_fitness}, Avg fitness = {avg_fitness:.2f}, Best overall = {best_fitness}" ) - if generations_without_improvement >= 20: - print("No improvement for 20 generations. Stopping early.") - break - - new_population = population[:2] + elitism_count = POPULATION_SIZE // 20 + new_population = population[:elitism_count] while len(new_population) < POPULATION_SIZE: - parent1, parent2 = random.sample(population[:50], 2) + tournament_size = 5 + parent1 = min( + random.sample(population, tournament_size), + key=lambda x: fitness_scores[population.index(x)], + ) + parent2 = min( + random.sample(population, tournament_size), + key=lambda x: fitness_scores[population.index(x)], + ) + child = crossover(parent1, parent2) new_population.append(mutate(child)) population = new_population - with open(LEARNING_FILE, "w") as f: - json.dump([strategy.__dict__ for strategy in population], f) + elite_strategies = population[:elitism_count] + elite_data = [ + strategy.serialize(include_grid=True) for strategy in elite_strategies + ] + + elite_file = "elites.json" + with open(elite_file, "w") as f: + json.dump(elite_data, f, indent=4) + + try: + with open(LEARNING_FILE, "w") as f: + json.dump( + [strategy.serialize() for strategy in population], f, indent=4 + ) + except Exception as e: + tqdm.write(f"Error saving generation {generation + 1}: {e}") + + if generations_without_improvement >= 20: + tqdm.write("No improvement for 20 generations. Stopping early.") + break + + progress_bar.close() return population[0] @@ -228,10 +401,67 @@ def load_best_strategy(): return BattleshipStrategy() +def load_elite_strategies(num_elites=10): + if os.path.exists(LEARNING_FILE): + with open(LEARNING_FILE, "r") as f: + data = json.load(f) + elite_strategies = [] + for strategy_data in data[:num_elites]: + strategy = BattleshipStrategy() + strategy.__dict__.update(strategy_data) + elite_strategies.append(strategy) + return elite_strategies + else: + return [BattleshipStrategy()] + + +def get_ensemble_move(elite_strategies, board, hits, misses): + probabilities = [[0 for _ in range(GRID_SIZE)] for _ in range(GRID_SIZE)] + remaining_ships = board.get_remaining_ships() + + for strategy in elite_strategies: + for i in range(GRID_SIZE): + for j in range(GRID_SIZE): + if (i, j) in hits or (i, j) in misses: + continue + + prob = 1 + + for di, dj in [(-1, 0), (1, 0), (0, -1), (0, 1)]: + if ( + 0 <= i + di < GRID_SIZE + and 0 <= j + dj < GRID_SIZE + and (i + di, j + dj) in hits + ): + prob *= strategy.adjacent_hit_weight + + for size in remaining_ships: + if strategy.can_fit_ship(board.grid, i, j, size): + prob *= strategy.ship_size_weight + + if (i + j) % 2 == 0: + prob *= strategy.parity_weight + + if i == 0 or i == GRID_SIZE - 1 or j == 0 or j == GRID_SIZE - 1: + prob *= 1 - strategy.avoid_edges_weight + + probabilities[i][j] += prob * strategy.prob_grid_weight + + max_prob = max(max(row) for row in probabilities) + candidates = [ + (i, j) + for i in range(GRID_SIZE) + for j in range(GRID_SIZE) + if probabilities[i][j] == max_prob + ] + + return random.choice(candidates) + + def main(): if len(sys.argv) < 2: print( - "Usage: python battleship_genetic.py [train|train_continue|sample|sample_multi]" + "Usage: python battleship_genetic2.py [train|train_continue|sample|sample_multi|sample_ensemble]" ) sys.exit(1) @@ -253,9 +483,12 @@ def main(): total_turns = sum(play_game(best_strategy) for _ in range(num_games)) avg_turns = total_turns / num_games print(f"Average turns over {num_games} games: {avg_turns:.2f}") + elif mode == "sample_ensemble": + turns = play_game(None, use_ensemble=True) + print(turns) else: print( - "Invalid mode. Use 'train', 'train_continue', 'sample', or 'sample_multi'." + "Invalid mode. Use 'train', 'train_continue', 'sample', 'sample_multi', or 'sample_ensemble'." ) sys.exit(1) diff --git a/content/uploads/2024/battleship-solvers/battleship_genetic2.py b/content/uploads/2024/battleship-solvers/battleship_genetic2.py deleted file mode 100644 index f12b11e..0000000 --- a/content/uploads/2024/battleship-solvers/battleship_genetic2.py +++ /dev/null @@ -1,487 +0,0 @@ -import random -import json -import os -import sys -import time -from tqdm import tqdm -from multiprocessing import Pool - -GRID_SIZE = 10 -SHIPS = {"Carrier": 5, "Battleship": 4, "Cruiser": 3, "Submarine": 3, "Destroyer": 2} -POPULATION_SIZE = 200 -GENERATIONS = 50 -BASE_MUTATION_RATE = 0.1 -GAMES_PER_INDIVIDUAL = 20 -LEARNING_FILE = "battleship_learning.json" - -MUTATION_MULTIPLIERS = { - "adjacent_hit_weight": 0.5, - "ship_size_weight": 1.5, - "parity_weight": 1.5, - "hunt_mode_threshold": 1.0, - "prob_grid_weight": 1.0, - "avoid_edges_weight": 1.0, # Added for avoid_edges_weight -} - - -class BattleshipStrategy: - # Define ranges as class attributes - ADJACENT_HIT_WEIGHT_RANGE = (1, 20) - SHIP_SIZE_WEIGHT_RANGE = (0, 10) - PARITY_WEIGHT_RANGE = (0, 10) - HUNT_MODE_THRESHOLD_RANGE = (0.1, 1) - PROB_GRID_WEIGHT_RANGE = (0, 1) - AVOID_EDGES_WEIGHT_RANGE = (0, 1) # New weight range - - def __init__(self): - self.adjacent_hit_weight = random.uniform(*self.ADJACENT_HIT_WEIGHT_RANGE) - self.ship_size_weight = random.uniform(*self.SHIP_SIZE_WEIGHT_RANGE) - self.parity_weight = random.uniform(*self.PARITY_WEIGHT_RANGE) - self.hunt_mode_threshold = random.uniform(*self.HUNT_MODE_THRESHOLD_RANGE) - self.prob_grid_weight = random.uniform(*self.PROB_GRID_WEIGHT_RANGE) - self.avoid_edges_weight = random.uniform( - *self.AVOID_EDGES_WEIGHT_RANGE - ) # Initialize new weight - self._probability_grid = None - - def serialize(self, include_grid=False): - data = { - "adjacent_hit_weight": self.adjacent_hit_weight, - "ship_size_weight": self.ship_size_weight, - "parity_weight": self.parity_weight, - "hunt_mode_threshold": self.hunt_mode_threshold, - "prob_grid_weight": self.prob_grid_weight, - "avoid_edges_weight": self.avoid_edges_weight, # Include in serialization - } - if include_grid: - data["probability_grid"] = self.probability_grid - return data - - @property - def probability_grid(self): - if self._probability_grid is None: - self.reset_probability_grid() - return self._probability_grid - - def reset_probability_grid(self): - self._probability_grid = [ - [1 for _ in range(GRID_SIZE)] for _ in range(GRID_SIZE) - ] - - def update_probability_grid(self, hits, misses): - for i in range(GRID_SIZE): - for j in range(GRID_SIZE): - if (i, j) in hits: - self.probability_grid[i][j] = 0 - elif (i, j) in misses: - self.probability_grid[i][j] = -1 - else: - self.probability_grid[i][j] = 1 - - for i, j in hits: - for di, dj in [(-1, 0), (1, 0), (0, -1), (0, 1)]: - ni, nj = i + di, j + dj - if ( - 0 <= ni < GRID_SIZE - and 0 <= nj < GRID_SIZE - and (ni, nj) not in hits - and (ni, nj) not in misses - ): - self.probability_grid[ni][nj] *= self.adjacent_hit_weight - - # Apply avoid_edges_weight - for i in range(GRID_SIZE): - for j in range(GRID_SIZE): - if i == 0 or i == GRID_SIZE - 1 or j == 0 or j == GRID_SIZE - 1: - self.probability_grid[i][j] *= 1 - self.avoid_edges_weight - - max_prob = max(max(row) for row in self.probability_grid if max(row) > 0) - if max_prob > 0: - for i in range(GRID_SIZE): - for j in range(GRID_SIZE): - if self.probability_grid[i][j] > 0: - self.probability_grid[i][j] = int( - (self.probability_grid[i][j] / max_prob) * 100 - ) - - def get_next_move(self, board, hits, misses): - self.update_probability_grid(hits, misses) - probabilities = [ - [self.probability_grid[i][j] for j in range(GRID_SIZE)] - for i in range(GRID_SIZE) - ] - remaining_ships = [size for ship, size in SHIPS.items() if size > len(hits)] - - for i in range(GRID_SIZE): - for j in range(GRID_SIZE): - if (i, j) in hits or (i, j) in misses: - probabilities[i][j] = 0 - continue - - for size in remaining_ships: - if self.can_fit_ship(board, i, j, size): - probabilities[i][j] *= self.ship_size_weight - - if (i + j) % 2 == 0: - probabilities[i][j] *= self.parity_weight - - max_prob = max(max(row) for row in probabilities) - for i in range(GRID_SIZE): - for j in range(GRID_SIZE): - probabilities[i][j] *= self.prob_grid_weight - if max_prob > 0: - probabilities[i][j] += (1 - self.prob_grid_weight) * ( - probabilities[i][j] / max_prob - ) - - max_prob = max(max(row) for row in probabilities) - candidates = [ - (i, j) - for i in range(GRID_SIZE) - for j in range(GRID_SIZE) - if probabilities[i][j] == max_prob - ] - - return random.choice(candidates) - - def can_fit_ship(self, board, row, col, size): - if col + size <= GRID_SIZE and all( - board[row][c] == 0 for c in range(col, col + size) - ): - return True - if row + size <= GRID_SIZE and all( - board[r][col] == 0 for r in range(row, row + size) - ): - return True - return False - - -def create_random_board(): - board = [[0 for _ in range(GRID_SIZE)] for _ in range(GRID_SIZE)] - for ship, size in SHIPS.items(): - while True: - row = random.randint(0, GRID_SIZE - 1) - col = random.randint(0, GRID_SIZE - 1) - horizontal = random.choice([True, False]) - if is_valid_placement(board, row, col, size, horizontal): - place_ship(board, row, col, size, horizontal) - break - return board - - -def is_valid_placement(board, row, col, size, horizontal): - if horizontal: - if col + size > GRID_SIZE: - return False - return all(board[row][c] == 0 for c in range(col, col + size)) - else: - if row + size > GRID_SIZE: - return False - return all(board[r][col] == 0 for r in range(row, row + size)) - - -def place_ship(board, row, col, size, horizontal): - if horizontal: - for c in range(col, col + size): - board[row][c] = 1 - else: - for r in range(row, row + size): - board[r][col] = 1 - - -def play_game(strategy, use_ensemble=False): - board = create_random_board() - hits = set() - misses = set() - turns = 0 - ships_left = sum(SHIPS.values()) - - elite_strategies = load_elite_strategies() if use_ensemble else None - - # Reset the probability grid at the start of each game - strategy.reset_probability_grid() - - while ships_left > 0 and turns < 100: - if use_ensemble: - i, j = get_ensemble_move(elite_strategies, board, hits, misses) - else: - i, j = strategy.get_next_move(board, hits, misses) - - # Update the probability grid after each move - strategy.update_probability_grid(hits, misses) - - turns += 1 - if board[i][j] == 1: - hits.add((i, j)) - ships_left -= 1 - else: - misses.add((i, j)) - - return turns - - -def crossover(parent1, parent2): - child = BattleshipStrategy() - child.adjacent_hit_weight = random.choice( - [parent1.adjacent_hit_weight, parent2.adjacent_hit_weight] - ) - child.ship_size_weight = random.choice( - [parent1.ship_size_weight, parent2.ship_size_weight] - ) - child.parity_weight = random.choice([parent1.parity_weight, parent2.parity_weight]) - child.hunt_mode_threshold = random.choice( - [parent1.hunt_mode_threshold, parent2.hunt_mode_threshold] - ) - child.prob_grid_weight = random.choice( - [parent1.prob_grid_weight, parent2.prob_grid_weight] - ) - child.avoid_edges_weight = random.choice( - [parent1.avoid_edges_weight, parent2.avoid_edges_weight] - ) - return child - - -def mutate(individual): - if ( - random.random() - < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["adjacent_hit_weight"] - ): - individual.adjacent_hit_weight = random.uniform( - *BattleshipStrategy.ADJACENT_HIT_WEIGHT_RANGE - ) - if random.random() < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["ship_size_weight"]: - individual.ship_size_weight = random.uniform( - *BattleshipStrategy.SHIP_SIZE_WEIGHT_RANGE - ) - if random.random() < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["parity_weight"]: - individual.parity_weight = random.uniform( - *BattleshipStrategy.PARITY_WEIGHT_RANGE - ) - if ( - random.random() - < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["hunt_mode_threshold"] - ): - individual.hunt_mode_threshold = random.uniform( - *BattleshipStrategy.HUNT_MODE_THRESHOLD_RANGE - ) - if random.random() < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["prob_grid_weight"]: - individual.prob_grid_weight = random.uniform( - *BattleshipStrategy.PROB_GRID_WEIGHT_RANGE - ) - if ( - random.random() - < BASE_MUTATION_RATE * MUTATION_MULTIPLIERS["avoid_edges_weight"] - ): - individual.avoid_edges_weight = random.uniform( - *BattleshipStrategy.AVOID_EDGES_WEIGHT_RANGE - ) - return individual - - -def evaluate_strategy(strategy): - total_turns = 0 - for _ in range(GAMES_PER_INDIVIDUAL): - total_turns += play_game(strategy) - return total_turns - - -def genetic_algorithm(continue_training=False): - if continue_training and os.path.exists(LEARNING_FILE): - with open(LEARNING_FILE, "r") as f: - data = json.load(f) - population = [BattleshipStrategy() for _ in range(POPULATION_SIZE)] - for i, strategy_data in enumerate(data): - population[i].__dict__.update(strategy_data) - tqdm.write("Continuing training from existing population.") - else: - if os.path.exists(LEARNING_FILE): - timestamp = time.strftime("%Y%m%d-%H%M%S") - os.rename(LEARNING_FILE, f"{LEARNING_FILE}.{timestamp}") - tqdm.write(f"Moved existing model to {LEARNING_FILE}.{timestamp}") - population = [BattleshipStrategy() for _ in range(POPULATION_SIZE)] - tqdm.write("Starting with a new population.") - - best_fitness = float("inf") - generations_without_improvement = 0 - - progress_bar = tqdm( - total=GENERATIONS * POPULATION_SIZE, file=sys.stderr, desc="Overall Progress" - ) - - for generation in range(GENERATIONS): - with Pool() as pool: - fitness_scores = list(pool.imap(evaluate_strategy, population)) - progress_bar.update(POPULATION_SIZE) - - population = [ - x - for _, x in sorted( - zip(fitness_scores, population), key=lambda pair: pair[0] - ) - ] - - current_best_fitness = min(fitness_scores) - avg_fitness = sum(fitness_scores) / len(fitness_scores) - - if current_best_fitness < best_fitness: - best_fitness = current_best_fitness - generations_without_improvement = 0 - else: - generations_without_improvement += 1 - - # Use tqdm.write to output generation results - tqdm.write( - f"Generation {generation + 1}: Best fitness = {current_best_fitness}, Avg fitness = {avg_fitness:.2f}, Best overall = {best_fitness}" - ) - - elitism_count = POPULATION_SIZE // 20 - new_population = population[:elitism_count] - - while len(new_population) < POPULATION_SIZE: - tournament_size = 5 - parent1 = min( - random.sample(population, tournament_size), - key=lambda x: fitness_scores[population.index(x)], - ) - parent2 = min( - random.sample(population, tournament_size), - key=lambda x: fitness_scores[population.index(x)], - ) - - child = crossover(parent1, parent2) - new_population.append(mutate(child)) - - population = new_population - - # Dump elite strategies with probability grids after all games are played - elite_strategies = population[:elitism_count] - elite_data = [ - strategy.serialize(include_grid=True) for strategy in elite_strategies - ] - - # Reuse the same file for elites - elite_file = "elites.json" - with open(elite_file, "w") as f: - json.dump(elite_data, f, indent=4) - - # Serialize the final population without probability grids - try: - with open(LEARNING_FILE, "w") as f: - json.dump( - [strategy.serialize() for strategy in population], f, indent=4 - ) - # tqdm.write(f"Generation {generation + 1} saved successfully.") - except Exception as e: - tqdm.write(f"Error saving generation {generation + 1}: {e}") - - if generations_without_improvement >= 20: - tqdm.write("No improvement for 20 generations. Stopping early.") - break - - progress_bar.close() - - return population[0] - - -def load_best_strategy(): - if os.path.exists(LEARNING_FILE): - with open(LEARNING_FILE, "r") as f: - data = json.load(f) - best_strategy = BattleshipStrategy() - best_strategy.__dict__.update(data[0]) - return best_strategy - else: - return BattleshipStrategy() - - -def load_elite_strategies(num_elites=10): - if os.path.exists(LEARNING_FILE): - with open(LEARNING_FILE, "r") as f: - data = json.load(f) - elite_strategies = [] - for strategy_data in data[:num_elites]: - strategy = BattleshipStrategy() - strategy.__dict__.update(strategy_data) - elite_strategies.append(strategy) - return elite_strategies - else: - return [BattleshipStrategy()] - - -def get_ensemble_move(elite_strategies, board, hits, misses): - probabilities = [[0 for _ in range(GRID_SIZE)] for _ in range(GRID_SIZE)] - remaining_ships = [size for ship, size in SHIPS.items() if size > len(hits)] - - for strategy in elite_strategies: - for i in range(GRID_SIZE): - for j in range(GRID_SIZE): - if (i, j) in hits or (i, j) in misses: - continue - - prob = 1 - - for di, dj in [(-1, 0), (1, 0), (0, -1), (0, 1)]: - if ( - 0 <= i + di < GRID_SIZE - and 0 <= j + dj < GRID_SIZE - and (i + di, j + dj) in hits - ): - prob *= strategy.adjacent_hit_weight - - for size in remaining_ships: - if strategy.can_fit_ship(board, i, j, size): - prob *= strategy.ship_size_weight - - if (i + j) % 2 == 0: - prob *= strategy.parity_weight - - probabilities[i][j] += prob * strategy.prob_grid_weight - - max_prob = max(max(row) for row in probabilities) - candidates = [ - (i, j) - for i in range(GRID_SIZE) - for j in range(GRID_SIZE) - if probabilities[i][j] == max_prob - ] - - return random.choice(candidates) - - -def main(): - if len(sys.argv) < 2: - print( - "Usage: python battleship_genetic2.py [train|train_continue|sample|sample_multi|sample_ensemble]" - ) - sys.exit(1) - - mode = sys.argv[1] - - if mode == "train": - best_strategy = genetic_algorithm(continue_training=False) - print("Training completed. Best strategy saved.") - elif mode == "train_continue": - best_strategy = genetic_algorithm(continue_training=True) - print("Continued training completed. Best strategy saved.") - elif mode == "sample": - best_strategy = load_best_strategy() - turns = play_game(best_strategy) - print(turns) - elif mode == "sample_multi": - best_strategy = load_best_strategy() - num_games = 100 - total_turns = sum(play_game(best_strategy) for _ in range(num_games)) - avg_turns = total_turns / num_games - print(f"Average turns over {num_games} games: {avg_turns:.2f}") - elif mode == "sample_ensemble": - turns = play_game(None, use_ensemble=True) - print(turns) - else: - print( - "Invalid mode. Use 'train', 'train_continue', 'sample', 'sample_multi', or 'sample_ensemble'." - ) - sys.exit(1) - - -if __name__ == "__main__": - main() diff --git a/content/uploads/2024/battleship-solvers/battleship_learning.json b/content/uploads/2024/battleship-solvers/battleship_learning.json index 12b62e2..a5064ed 100644 --- a/content/uploads/2024/battleship-solvers/battleship_learning.json +++ b/content/uploads/2024/battleship-solvers/battleship_learning.json @@ -1,1602 +1,1602 @@ [ - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 8.469767665653928, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.5867407962432482, - "prob_grid_weight": 0.6393146268814945, - "avoid_edges_weight": 0.5398297180970447 - }, { "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.3018031343920857, - "parity_weight": 4.818947775298833, - "hunt_mode_threshold": 0.7289987296682638, - "prob_grid_weight": 0.4266073620103604, - "avoid_edges_weight": 0.23470834060630852 + "ship_size_weight": 3.0686198043120227, + "parity_weight": 5.466043073015681, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.27933226069242245, + "avoid_edges_weight": 0.16589607601415945 }, { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.6524831462991294, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.23470834060630852 + "adjacent_hit_weight": 12.483234380008852, + "ship_size_weight": 1.407191741328706, + "parity_weight": 4.667287029051002, + "hunt_mode_threshold": 0.19657659851885878, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.5296014931715418 }, { "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7817678292724095, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7147611813939592, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.1276943394423675, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.23560470319328064, - "parity_weight": 3.673305632413334, - "hunt_mode_threshold": 0.49012525580770483, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.6067658668891512 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.2053438642669168, - "prob_grid_weight": 0.7501450787954749, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.10163935540612123 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 9.436988264118193, - "hunt_mode_threshold": 0.9220703890603565, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.2867462590284314 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 9.773780099968516, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.8316741653358728, - "avoid_edges_weight": 0.08504691124591834 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 3.690344393932279, - "parity_weight": 4.69960316067505, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.8316741653358728, - "avoid_edges_weight": 0.7632551458531032 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 2.3254490243581705, - "ship_size_weight": 3.939962118677851, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.7788754079940208, - "prob_grid_weight": 0.6235997673154474, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 2.3254490243581705, - "ship_size_weight": 7.033504974583669, - "parity_weight": 8.319758126675055, - "hunt_mode_threshold": 0.7289987296682638, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.009221081107311901 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 5.344910407220843, - "parity_weight": 7.860780780347644, - "hunt_mode_threshold": 0.39866349095304565, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.6002747600942439 - }, - { - "adjacent_hit_weight": 5.495923404194844, - "ship_size_weight": 0.7817678292724095, - "parity_weight": 2.084637821875115, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.6496014005050048 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 2.027499931803688, - "hunt_mode_threshold": 0.3019504149458683, - "prob_grid_weight": 0.4791703757727295, - "avoid_edges_weight": 0.5184285610816615 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7817678292724095, - "parity_weight": 6.1364981003162855, - "hunt_mode_threshold": 0.1276943394423675, - "prob_grid_weight": 0.7417448538634152, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 6.410384248298411, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 5.484521147906735, - "parity_weight": 2.027499931803688, - "hunt_mode_threshold": 0.5017269807767816, - "prob_grid_weight": 0.4791703757727295, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.10163935540612123 - }, - { - "adjacent_hit_weight": 2.3254490243581705, - "ship_size_weight": 6.792846648817518, - "parity_weight": 2.2549934639601563, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.3314886149484898, - "avoid_edges_weight": 0.009221081107311901 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7817678292724095, - "parity_weight": 9.73233482196133, - "hunt_mode_threshold": 0.43595358823321606, - "prob_grid_weight": 0.20640439844964997, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 6.175349616083473, - "parity_weight": 2.027499931803688, - "hunt_mode_threshold": 0.5867407962432482, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.4061527171087387 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7817678292724095, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 2.637602113509774, - "parity_weight": 0.09653065339198297, - "hunt_mode_threshold": 0.10805265779054413, - "prob_grid_weight": 0.4791703757727295, - "avoid_edges_weight": 0.3187316432166811 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 2.6205031986727043, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 0.016318124950689405, - "parity_weight": 8.365516631827512, - "hunt_mode_threshold": 0.5549457714613905, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.5017269807767816, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 3.0370278724096202, - "ship_size_weight": 5.404161194082565, - "parity_weight": 7.633999325966561, - "hunt_mode_threshold": 0.7289987296682638, - "prob_grid_weight": 0.6235997673154474, - "avoid_edges_weight": 0.009221081107311901 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 2.5304914418678104, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.10163935540612123 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.7716175214522005, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.31109370540070247, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.5017269807767816, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.4061527171087387 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 8.469767665653928, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.2446331949725662 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.016318124950689405, - "parity_weight": 0.5901640735031422, - "hunt_mode_threshold": 0.5549457714613905, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 14.720342868365474, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 5.538611035310669, - "hunt_mode_threshold": 0.8208623430151173, - "prob_grid_weight": 0.6120255436256341, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 2.7867554517104542, - "parity_weight": 2.027499931803688, - "hunt_mode_threshold": 0.7128719431138546, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.4061527171087387 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 2.6810511141906646, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.6524831462991294, - "prob_grid_weight": 0.286813775865557, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 2.637602113509774, - "parity_weight": 4.625948440382983, - "hunt_mode_threshold": 0.10805265779054413, - "prob_grid_weight": 0.4791703757727295, - "avoid_edges_weight": 0.04501882373580979 - }, - { - "adjacent_hit_weight": 6.6711023945560965, - "ship_size_weight": 0.23560470319328064, - "parity_weight": 3.673305632413334, - "hunt_mode_threshold": 0.49012525580770483, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.6067658668891512 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 1.123309336134164, - "parity_weight": 4.625948440382983, - "hunt_mode_threshold": 0.5867407962432482, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.04501882373580979 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.09554000556527775, - "parity_weight": 2.891858172453765, - "hunt_mode_threshold": 0.15983792193139107, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.9648647465382499 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 0.016318124950689405, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.5549457714613905, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 6.2214712474160025, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 6.644885947625248, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.4541501566095818, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.3019504149458683, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.13357738012507592 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 4.419451689543182, - "hunt_mode_threshold": 0.49131291605467164, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.3187316432166811 - }, - { - "adjacent_hit_weight": 3.0370278724096202, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 8.469767665653928, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 14.720342868365474, - "ship_size_weight": 1.3230648151919133, - "parity_weight": 6.644885947625248, - "hunt_mode_threshold": 0.7788754079940208, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.96580607636592, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.7501450787954749, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 12.331373586730962, - "ship_size_weight": 6.792846648817518, - "parity_weight": 0.5901640735031422, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.8553905610691251 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 4.869025789483935, - "parity_weight": 6.505997821431616, - "hunt_mode_threshold": 0.6524831462991294, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 9.449253737759333, - "parity_weight": 1.2613796713604242, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.9413712433780423, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 2.2435140029345435, - "parity_weight": 6.1364981003162855, - "hunt_mode_threshold": 0.42623882743797514, - "prob_grid_weight": 0.47036690434859063, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 6.2214712474160025, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.43595358823321606, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 9.313136502825687, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.10163935540612123 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 2.637602113509774, - "parity_weight": 6.275005097156074, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.34817664248414426 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 7.09889204292324, - "parity_weight": 0.5901640735031422, - "hunt_mode_threshold": 0.10805265779054413, - "prob_grid_weight": 0.8679031424800879, - "avoid_edges_weight": 0.15351173798592044 - }, - { - "adjacent_hit_weight": 14.720342868365474, - "ship_size_weight": 2.637602113509774, - "parity_weight": 4.9132323879918935, - "hunt_mode_threshold": 0.10805265779054413, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.35831792304299426 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 9.449253737759333, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 5.495923404194844, - "ship_size_weight": 2.116383113324516, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.19864613953010046, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 6.505997821431616, - "hunt_mode_threshold": 0.9378930375369722, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 5.495923404194844, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 8.959010440688132, - "hunt_mode_threshold": 0.9161573972186813, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.4086752756480567 - }, - { - "adjacent_hit_weight": 8.525525845477233, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 6.1364981003162855, - "hunt_mode_threshold": 0.6524831462991294, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 3.0370278724096202, - "ship_size_weight": 5.404161194082565, - "parity_weight": 6.863429926414208, - "hunt_mode_threshold": 0.7102788495740624, - "prob_grid_weight": 0.13413977992412862, - "avoid_edges_weight": 0.5400684312413631 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 5.538611035310669, - "hunt_mode_threshold": 0.5549457714613905, - "prob_grid_weight": 0.6120255436256341, - "avoid_edges_weight": 0.5184285610816615 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.7147611813939592, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.1276943394423675, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 2.1706390463186076, - "parity_weight": 5.797472157574111, - "hunt_mode_threshold": 0.43595358823321606, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 6.92303305292662, - "parity_weight": 1.8931552645469663, - "hunt_mode_threshold": 0.4844231542499685, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.35831792304299426 - }, - { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 2.637602113509774, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.12182482440774445, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.7289987296682638, - "prob_grid_weight": 0.4266073620103604, - "avoid_edges_weight": 0.930481666218477 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 3.249159345277074, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 4.053078966925367, - "parity_weight": 4.69960316067505, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.7632551458531032 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.23560470319328064, - "parity_weight": 2.7282058785082164, - "hunt_mode_threshold": 0.15983792193139107, - "prob_grid_weight": 0.4791703757727295, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.908670200731553, - "ship_size_weight": 4.869025789483935, - "parity_weight": 6.505997821431616, - "hunt_mode_threshold": 0.7289987296682638, - "prob_grid_weight": 0.6235997673154474, - "avoid_edges_weight": 0.009221081107311901 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 6.92303305292662, - "parity_weight": 6.644885947625248, - "hunt_mode_threshold": 0.7289987296682638, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.5184285610816615 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 1.1280075422181135, - "hunt_mode_threshold": 0.39866349095304565, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.35831792304299426 - }, - { - "adjacent_hit_weight": 10.29789949219008, - "ship_size_weight": 6.175349616083473, - "parity_weight": 8.205017218093138, - "hunt_mode_threshold": 0.8529364568845463, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 2.637602113509774, - "parity_weight": 4.818947775298833, + "ship_size_weight": 0.7753733891207315, + "parity_weight": 8.775156260024483, "hunt_mode_threshold": 0.3530868889493337, - "prob_grid_weight": 0.8439085232072077, - "avoid_edges_weight": 0.2446331949725662 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.016318124950689405, - "parity_weight": 8.365516631827512, - "hunt_mode_threshold": 0.42623882743797514, - "prob_grid_weight": 0.47036690434859063, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 9.449253737759333, - "parity_weight": 5.797472157574111, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.9161573972186813, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.10163935540612123 - }, - { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 0.3811869983704619, - "hunt_mode_threshold": 0.15983792193139107, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.4171987826361968 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 6.720770182927925, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.6524831462991294, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 2.027499931803688, - "hunt_mode_threshold": 0.15983792193139107, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 3.0585687066221823, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.26299672823724063, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.0023677769707699525 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 3.9347202103954757, - "parity_weight": 3.7160192025866245, - "hunt_mode_threshold": 0.3019504149458683, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.344910407220843, - "parity_weight": 9.436988264118193, - "hunt_mode_threshold": 0.9220703890603565, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.35831792304299426 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.344910407220843, - "parity_weight": 8.205017218093138, - "hunt_mode_threshold": 0.5535619132147076, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.96580607636592, - "ship_size_weight": 0.7147611813939592, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.283814133493431, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 2.103215133073497, - "parity_weight": 5.538611035310669, - "hunt_mode_threshold": 0.8208623430151173, - "prob_grid_weight": 0.8439085232072077, - "avoid_edges_weight": 0.7948009142618758 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.7716175214522005, - "parity_weight": 4.625948440382983, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.7263998070085664 - }, - { - "adjacent_hit_weight": 18.26336291522027, - "ship_size_weight": 6.035213302875539, - "parity_weight": 6.7903183762700445, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.4791703757727295, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 8.525525845477233, - "ship_size_weight": 1.384421193219264, - "parity_weight": 6.1364981003162855, - "hunt_mode_threshold": 0.1276943394423675, - "prob_grid_weight": 0.4791703757727295, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 3.0370278724096202, - "ship_size_weight": 6.792846648817518, - "parity_weight": 7.988104745180094, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.29943983581270417, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 3.9347202103954757, - "parity_weight": 8.754644016445486, - "hunt_mode_threshold": 0.9504950907428522, - "prob_grid_weight": 0.8316741653358728, - "avoid_edges_weight": 0.05738152565943433 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 2.637602113509774, - "parity_weight": 8.754644016445486, - "hunt_mode_threshold": 0.10805265779054413, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.18651535462635638 - }, - { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 2.7867554517104542, - "parity_weight": 0.2888151927224758, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.4791703757727295, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.8208623430151173, - "prob_grid_weight": 0.6120255436256341, - "avoid_edges_weight": 0.7948009142618758 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 4.69960316067505, - "hunt_mode_threshold": 0.7788754079940208, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.08504691124591834 - }, - { - "adjacent_hit_weight": 6.2214712474160025, - "ship_size_weight": 3.481764161287071, - "parity_weight": 9.256339274397487, - "hunt_mode_threshold": 0.6524831462991294, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 14.720342868365474, - "ship_size_weight": 0.030390605849747176, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.5017269807767816, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 3.847613877576126, - "parity_weight": 8.239617167411513, - "hunt_mode_threshold": 0.7788754079940208, - "prob_grid_weight": 0.29943983581270417, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 0.5282224132788294, - "hunt_mode_threshold": 0.3019504149458683, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.5184285610816615 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 0.23560470319328064, - "parity_weight": 4.69960316067505, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 2.637602113509774, - "parity_weight": 9.83388377815975, - "hunt_mode_threshold": 0.1649545263160585, "prob_grid_weight": 0.4266073620103604, - "avoid_edges_weight": 0.3187316432166811 + "avoid_edges_weight": 0.2659648293721587 }, { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.7147611813939592, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.6524831462991294, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.23470834060630852 + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 9.88231554946138, + "parity_weight": 6.534590408973237, + "hunt_mode_threshold": 0.4804778776889068, + "prob_grid_weight": 0.8820184862665053, + "avoid_edges_weight": 0.2659648293721587 }, { "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 4.419451689543182, - "hunt_mode_threshold": 0.1884847435967914, - "prob_grid_weight": 0.3022803807605481, - "avoid_edges_weight": 0.3187316432166811 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 2.637602113509774, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.7788754079940208, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.016318124950689405, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.29943983581270417, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 8.632599015524013, - "parity_weight": 6.735370324288916, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 1.76046477961178, - "parity_weight": 5.34727749041113, + "ship_size_weight": 5.5836849809901725, + "parity_weight": 5.952911308680944, "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 + "prob_grid_weight": 0.6291566755708562, + "avoid_edges_weight": 0.2659648293721587 }, { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 4.913977511819413, - "parity_weight": 2.027499931803688, - "hunt_mode_threshold": 0.5017269807767816, - "prob_grid_weight": 0.34490570839076984, - "avoid_edges_weight": 0.23470834060630852 + "adjacent_hit_weight": 5.994844962524883, + "ship_size_weight": 9.408134641382723, + "parity_weight": 1.7901827088359201, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.2659648293721587 }, { - "adjacent_hit_weight": 14.720342868365474, - "ship_size_weight": 0.4541501566095818, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.7128719431138546, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 + "adjacent_hit_weight": 16.254111456441827, + "ship_size_weight": 3.388043217528607, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.2659648293721587 }, { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 8.365516631827512, - "hunt_mode_threshold": 0.10805265779054413, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7147611813939592, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.9378930375369722, - "prob_grid_weight": 0.018124357265414393, - "avoid_edges_weight": 0.4171987826361968 - }, - { - "adjacent_hit_weight": 8.646294099698885, - "ship_size_weight": 0.7817678292724095, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.4086752756480567 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.344910407220843, - "parity_weight": 3.1860277497640577, - "hunt_mode_threshold": 0.5867407962432482, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.1693766923589135 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 4.869025789483935, - "parity_weight": 6.032796371973468, - "hunt_mode_threshold": 0.5549457714613905, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.2446331949725662 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 9.915851500537379, - "parity_weight": 2.027499931803688, - "hunt_mode_threshold": 0.5017269807767816, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.7632551458531032 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 1.4510477662072496, - "parity_weight": 4.759751890378977, - "hunt_mode_threshold": 0.6524831462991294, - "prob_grid_weight": 0.18642602788392826, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 3.3503675612503936, + "adjacent_hit_weight": 12.483234380008852, + "ship_size_weight": 7.21351182856845, + "parity_weight": 5.264823123146412, "hunt_mode_threshold": 0.2053438642669168, - "prob_grid_weight": 0.7501450787954749, - "avoid_edges_weight": 0.22822032782464952 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 6.92303305292662, - "parity_weight": 5.538611035310669, - "hunt_mode_threshold": 0.8588770624889468, - "prob_grid_weight": 0.9997275000125091, - "avoid_edges_weight": 0.24659758631562956 + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.4706189418095357 }, { "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 5.586069804892501, + "parity_weight": 4.393248917834832, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 8.794876527044433, + "parity_weight": 9.863485369025899, + "hunt_mode_threshold": 0.5241462977052711, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 1.9897199198188606, + "ship_size_weight": 0.7753733891207315, + "parity_weight": 1.7330639651321877, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.4194097509192617, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.75527137475864, "ship_size_weight": 0.2779014464544405, - "parity_weight": 5.301785457631135, - "hunt_mode_threshold": 0.7128719431138546, - "prob_grid_weight": 0.5531691113245726, + "parity_weight": 6.006898660615957, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.19789511343571964, "avoid_edges_weight": 0.23470834060630852 }, { - "adjacent_hit_weight": 10.29789949219008, - "ship_size_weight": 2.7867554517104542, - "parity_weight": 8.205017218093138, - "hunt_mode_threshold": 0.7868345072506443, - "prob_grid_weight": 0.4791703757727295, - "avoid_edges_weight": 0.23470834060630852 + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 8.303118451965663, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.2718430977902554 }, { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.43595358823321606, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.5409902536205015 + "adjacent_hit_weight": 19.681436078292386, + "ship_size_weight": 0.7753733891207315, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.5241462977052711, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.2273391038194995 }, { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7817678292724095, - "parity_weight": 8.205017218093138, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 1.286851375114455, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.4586077644576687, - "prob_grid_weight": 0.7501450787954749, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7147611813939592, - "parity_weight": 6.505997821431616, - "hunt_mode_threshold": 0.9378930375369722, - "prob_grid_weight": 0.2457199832584427, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 2.637602113509774, - "parity_weight": 3.8319491026491805, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.5184285610816615 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.18922723913619044, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.5549457714613905, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.7716175214522005, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.15983792193139107, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 0.941014402874627, - "hunt_mode_threshold": 0.15983792193139107, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 4.869025789483935, - "parity_weight": 3.5039316930297315, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 11.425333521825637, - "ship_size_weight": 0.7147611813939592, - "parity_weight": 8.959010440688132, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 5.803669334833427, - "parity_weight": 8.828124356738908, - "hunt_mode_threshold": 0.2994783279475483, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 7.0382704704910015, - "parity_weight": 6.505997821431616, - "hunt_mode_threshold": 0.9378930375369722, - "prob_grid_weight": 0.018124357265414393, - "avoid_edges_weight": 0.4171987826361968 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.18922723913619044, - "parity_weight": 9.436988264118193, - "hunt_mode_threshold": 0.9220703890603565, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.2867462590284314 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 6.92303305292662, - "parity_weight": 4.625948440382983, - "hunt_mode_threshold": 0.5549457714613905, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.5184285610816615 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.7501450787954749, - "avoid_edges_weight": 0.3187316432166811 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.6524831462991294, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 8.959010440688132, - "hunt_mode_threshold": 0.7511883257737432, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7147611813939592, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.5867407962432482, - "prob_grid_weight": 0.6393146268814945, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.7716175214522005, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.49012525580770483, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.4171987826361968 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 5.266575221680746, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.8439085232072077, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 3.0370278724096202, - "ship_size_weight": 5.404161194082565, - "parity_weight": 0.3055068069294975, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.6120255436256341, - "avoid_edges_weight": 0.9529382772962358 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 2.1706390463186076, - "parity_weight": 4.625948440382983, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.41155384246052096, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.18922723913619044, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.7788754079940208, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.34166073158198296 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.3018031343920857, - "parity_weight": 4.818947775298833, - "hunt_mode_threshold": 0.7289987296682638, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 5.495923404194844, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 8.959010440688132, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.9035830604688461 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7147611813939592, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 5.344910407220843, + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 8.303118451965663, "parity_weight": 6.1364981003162855, - "hunt_mode_threshold": 0.7289987296682638, - "prob_grid_weight": 0.6235997673154474, - "avoid_edges_weight": 0.1693766923589135 + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.18505210302716302, + "avoid_edges_weight": 0.2659648293721587 }, { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 0.016318124950689405, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.29943983581270417, - "avoid_edges_weight": 0.23470834060630852 + "adjacent_hit_weight": 4.896593155335561, + "ship_size_weight": 4.952546330085829, + "parity_weight": 3.796730694738705, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.2659648293721587 }, { - "adjacent_hit_weight": 14.720342868365474, - "ship_size_weight": 1.3230648151919133, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.7788754079940208, - "prob_grid_weight": 0.32682925126067797, + "adjacent_hit_weight": 6.428203408396754, + "ship_size_weight": 2.134789554989954, + "parity_weight": 6.209454966186546, + "hunt_mode_threshold": 0.5241462977052711, + "prob_grid_weight": 0.065357807758469, + "avoid_edges_weight": 0.8767342712599464 + }, + { + "adjacent_hit_weight": 10.667552914268091, + "ship_size_weight": 9.759542436353485, + "parity_weight": 6.209454966186546, + "hunt_mode_threshold": 0.8081118914094031, + "prob_grid_weight": 0.9026991045852202, "avoid_edges_weight": 0.23470834060630852 }, { "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.344910407220843, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.9116630374786144, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 3.0370278724096202, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 4.899689707758876, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.29943983581270417, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 7.455095747698755, "ship_size_weight": 0.2779014464544405, - "parity_weight": 6.367442704997011, - "hunt_mode_threshold": 0.15983792193139107, + "parity_weight": 4.3322437787898425, + "hunt_mode_threshold": 0.2329082919725001, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 5.994844962524883, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 2.9870838186835034, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.37207403202344114 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 9.408134641382723, + "parity_weight": 5.47395517061166, + "hunt_mode_threshold": 0.8883371043802557, + "prob_grid_weight": 0.23729429830250515, + "avoid_edges_weight": 0.17580574756704548 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 8.77290301547829, + "parity_weight": 5.2382759739986495, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.49434352112869695 + }, + { + "adjacent_hit_weight": 8.087773564894867, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 0.6553921699638154, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.5280348480013591, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 9.88231554946138, + "parity_weight": 8.594290291827594, + "hunt_mode_threshold": 0.719872146974613, + "prob_grid_weight": 0.6317025781649804, + "avoid_edges_weight": 0.46967576014347 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 3.219284652503014, + "parity_weight": 8.775156260024483, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.4266073620103604, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 9.788403183112615, + "parity_weight": 3.453107327361261, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.49482255721518853, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 8.087773564894867, + "ship_size_weight": 3.2867817027215116, + "parity_weight": 0.6553921699638154, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.7336514659571642, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 14.38945011023267, + "ship_size_weight": 5.038323955912958, + "parity_weight": 6.209454966186546, + "hunt_mode_threshold": 0.5772039170766461, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 2.9870838186835034, + "hunt_mode_threshold": 0.8535056433179226, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.17580574756704548 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 5.586069804892501, + "parity_weight": 3.796730694738705, + "hunt_mode_threshold": 0.22549471840456095, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.16589607601415945 + }, + { + "adjacent_hit_weight": 12.483234380008852, + "ship_size_weight": 7.21351182856845, + "parity_weight": 5.853623849498528, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.4706189418095357 + }, + { + "adjacent_hit_weight": 5.994844962524883, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 4.896593155335561, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 0.6553921699638154, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 0.7753733891207315, + "parity_weight": 6.18920287413426, + "hunt_mode_threshold": 0.1630337091225052, + "prob_grid_weight": 0.4266073620103604, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 8.303118451965663, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.2718430977902554 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 5.5836849809901725, + "parity_weight": 3.3852349590111785, + "hunt_mode_threshold": 0.3302304290933093, + "prob_grid_weight": 0.8245105709261448, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 8.77290301547829, + "parity_weight": 5.2382759739986495, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.5428768635639853 + }, + { + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 4.952546330085829, + "parity_weight": 6.534590408973237, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.065357807758469, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 5.994844962524883, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 4.376012786225889, + "ship_size_weight": 6.332220349095073, + "parity_weight": 9.863485369025899, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 10.667552914268091, + "ship_size_weight": 5.038323955912958, + "parity_weight": 3.253226371830422, + "hunt_mode_threshold": 0.8081118914094031, + "prob_grid_weight": 0.065357807758469, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 10.667552914268091, + "ship_size_weight": 9.759542436353485, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.8081118914094031, + "prob_grid_weight": 0.6916738868621729, + "avoid_edges_weight": 0.16589607601415945 + }, + { + "adjacent_hit_weight": 10.667552914268091, + "ship_size_weight": 9.759542436353485, + "parity_weight": 1.035438266286507, + "hunt_mode_threshold": 0.5963755068465646, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.19238148426682244 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 8.009759071978506, + "parity_weight": 7.825171123063948, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.46967576014347 + }, + { + "adjacent_hit_weight": 10.667552914268091, + "ship_size_weight": 8.77290301547829, + "parity_weight": 5.2382759739986495, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 2.01962887975058, + "parity_weight": 8.330005066172998, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 8.794876527044433, + "parity_weight": 8.330005066172998, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 4.599919822331002, + "ship_size_weight": 5.038323955912958, + "parity_weight": 7.825171123063948, + "hunt_mode_threshold": 0.5772039170766461, + "prob_grid_weight": 0.3508113582328297, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 3.7306335461461684, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.8346647821065747, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.8915515744413623, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.16589607601415945 + }, + { + "adjacent_hit_weight": 3.4138866035033915, + "ship_size_weight": 7.21351182856845, + "parity_weight": 3.1344762653808775, + "hunt_mode_threshold": 0.8651399444315484, + "prob_grid_weight": 0.7674589658245065, + "avoid_edges_weight": 0.7041956825708141 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 3.388043217528607, + "parity_weight": 0.5042321458058141, + "hunt_mode_threshold": 0.6382322105702483, + "prob_grid_weight": 0.4266073620103604, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 5.038323955912958, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.2718430977902554 + }, + { + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 1.469380804564484, + "parity_weight": 6.115991482185395, + "hunt_mode_threshold": 0.719872146974613, + "prob_grid_weight": 0.6317025781649804, + "avoid_edges_weight": 0.5915235644502262 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.5752605228914742, + "parity_weight": 3.796730694738705, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 1.2065691188091654, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.2819019348405092, + "avoid_edges_weight": 0.4144656915854532 + }, + { + "adjacent_hit_weight": 12.483234380008852, + "ship_size_weight": 6.831022144569911, + "parity_weight": 4.667287029051002, + "hunt_mode_threshold": 0.19657659851885878, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 2.9870838186835034, + "hunt_mode_threshold": 0.5963755068465646, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.5428768635639853 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 7.642510817121048, + "parity_weight": 3.249466261082322, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 8.054024944960899, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.19657659851885878, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 4.599919822331002, + "ship_size_weight": 5.9812869551378745, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.407488457059233, + "prob_grid_weight": 0.18505210302716302, + "avoid_edges_weight": 0.16589607601415945 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 6.55415325767609, + "parity_weight": 4.3322437787898425, + "hunt_mode_threshold": 0.19657659851885878, + "prob_grid_weight": 0.7674589658245065, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 5.719246885548651, + "parity_weight": 1.7976126266456982, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.18505210302716302, + "avoid_edges_weight": 0.16589607601415945 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 8.794876527044433, + "parity_weight": 3.253226371830422, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.065357807758469, + "avoid_edges_weight": 0.6047037552795537 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 9.88231554946138, + "parity_weight": 6.534590408973237, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.8820184862665053, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 8.77290301547829, + "parity_weight": 6.115991482185395, + "hunt_mode_threshold": 0.4804778776889068, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.5428768635639853 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 3.008817138081249, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.23729429830250515, + "avoid_edges_weight": 0.2718430977902554 + }, + { + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 8.275106616709172, + "parity_weight": 6.534590408973237, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.6317025781649804, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 4.896593155335561, + "ship_size_weight": 7.492728948160163, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.5012895464027081, + "prob_grid_weight": 0.2711561935555683, + "avoid_edges_weight": 0.5428768635639853 + }, + { + "adjacent_hit_weight": 12.483234380008852, + "ship_size_weight": 5.038323955912958, + "parity_weight": 3.253226371830422, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.2266582936223942 + }, + { + "adjacent_hit_weight": 8.087773564894867, + "ship_size_weight": 8.794876527044433, + "parity_weight": 0.6553921699638154, + "hunt_mode_threshold": 0.422369478495502, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.8296359335183711 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 2.515207564765616, + "parity_weight": 8.775156260024483, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 4.896593155335561, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 1.7330639651321877, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.4194097509192617, + "avoid_edges_weight": 0.19125797566001645 + }, + { + "adjacent_hit_weight": 14.38945011023267, + "ship_size_weight": 9.461619496391956, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.5651366792978962, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.16589607601415945 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 9.408134641382723, + "parity_weight": 1.7901827088359201, + "hunt_mode_threshold": 0.7644792447453854, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 9.88231554946138, + "parity_weight": 3.796730694738705, + "hunt_mode_threshold": 0.8081118914094031, + "prob_grid_weight": 0.6317025781649804, + "avoid_edges_weight": 0.46967576014347 + }, + { + "adjacent_hit_weight": 4.376012786225889, + "ship_size_weight": 4.952546330085829, + "parity_weight": 9.863485369025899, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.9583249748388906 + }, + { + "adjacent_hit_weight": 8.087773564894867, + "ship_size_weight": 6.785824455992765, + "parity_weight": 1.6086739595235522, + "hunt_mode_threshold": 0.2053438642669168, "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.10163935540612123 + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 8.794876527044433, + "parity_weight": 3.253226371830422, + "hunt_mode_threshold": 0.1394995927117076, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 1.9897199198188606, + "ship_size_weight": 1.7861306733921956, + "parity_weight": 3.253226371830422, + "hunt_mode_threshold": 0.1394995927117076, + "prob_grid_weight": 0.7575530194999872, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 14.38945011023267, + "ship_size_weight": 5.038323955912958, + "parity_weight": 6.579111263219906, + "hunt_mode_threshold": 0.5772039170766461, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.2070225064991037 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 3.582523162062472, + "hunt_mode_threshold": 0.22549471840456095, + "prob_grid_weight": 0.23729429830250515, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 5.9812869551378745, + "parity_weight": 1.7901827088359201, + "hunt_mode_threshold": 0.8081118914094031, + "prob_grid_weight": 0.877985322187728, + "avoid_edges_weight": 0.2087429607057102 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.5752605228914742, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.9955153507684203, + "avoid_edges_weight": 0.2718430977902554 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 8.588881648002168, + "parity_weight": 1.7901827088359201, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.2711561935555683, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 2.134789554989954, + "parity_weight": 3.582523162062472, + "hunt_mode_threshold": 0.876992328292057, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.8110002911671883 }, { "adjacent_hit_weight": 19.577100495854815, "ship_size_weight": 0.2779014464544405, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5531691113245726, + "parity_weight": 9.863485369025899, + "hunt_mode_threshold": 0.3173590600826165, + "prob_grid_weight": 0.4266073620103604, + "avoid_edges_weight": 0.12760694190729982 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 2.9104056568895755, + "parity_weight": 4.827300178294837, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 12.714572927240942, + "ship_size_weight": 8.303118451965663, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.6604988725617944, + "avoid_edges_weight": 0.2675297757895241 + }, + { + "adjacent_hit_weight": 10.96215480443272, + "ship_size_weight": 5.9812869551378745, + "parity_weight": 5.466043073015681, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 4.599919822331002, + "ship_size_weight": 6.785824455992765, + "parity_weight": 5.710267865412282, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.2819019348405092, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 14.38945011023267, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 8.300151770154487, + "hunt_mode_threshold": 0.5772039170766461, + "prob_grid_weight": 0.9026129447969164, + "avoid_edges_weight": 0.8503266337081925 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 2.6117253778867, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.598741688608093, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 2.01962887975058, + "parity_weight": 4.627342743789782, + "hunt_mode_threshold": 0.9570441190878503, + "prob_grid_weight": 0.5188954568324395, "avoid_edges_weight": 0.23470834060630852 }, { "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.016318124950689405, - "parity_weight": 8.365516631827512, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.8258193336615137 + "ship_size_weight": 6.193240927722483, + "parity_weight": 5.466043073015681, + "hunt_mode_threshold": 0.3991290573962111, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.40707409041522524 }, { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 6.065720351749599, - "parity_weight": 1.9167734639690859, - "hunt_mode_threshold": 0.877236483622105, - "prob_grid_weight": 0.9997275000125091, - "avoid_edges_weight": 0.24659758631562956 + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 4.449798070990115, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.2711561935555683, + "avoid_edges_weight": 0.6261288925111945 }, { - "adjacent_hit_weight": 19.96580607636592, - "ship_size_weight": 0.2940705436097524, + "adjacent_hit_weight": 4.896593155335561, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 0.9712409848596792, + "hunt_mode_threshold": 0.11404845462966033, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 5.591474348078627, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.6093889136187759, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 16.254111456441827, + "ship_size_weight": 0.02921149824838598, + "parity_weight": 8.233437968417208, + "hunt_mode_threshold": 0.5963755068465646, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.5428768635639853 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 5.586069804892501, "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.6524831462991294, - "prob_grid_weight": 0.32682925126067797, + "hunt_mode_threshold": 0.9126046865886257, + "prob_grid_weight": 0.1678654895104562, "avoid_edges_weight": 0.23470834060630852 }, { - "adjacent_hit_weight": 2.3254490243581705, - "ship_size_weight": 6.924220789271559, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.7289987296682638, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.009221081107311901 + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 1.7485124965728394, + "parity_weight": 4.827300178294837, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.065357807758469, + "avoid_edges_weight": 0.5296014931715418 }, { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7817678292724095, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.6415296563816181, - "avoid_edges_weight": 0.7969827764012682 + "adjacent_hit_weight": 19.75527137475864, + "ship_size_weight": 3.318824583015677, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.4599875259516344, + "avoid_edges_weight": 0.23470834060630852 }, { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.611714494417753, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.9976767993950569, - "avoid_edges_weight": 0.3187316432166811 + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 7.1704700257601415, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.5639771505282046, + "avoid_edges_weight": 0.5296014931715418 }, { - "adjacent_hit_weight": 10.29789949219008, - "ship_size_weight": 6.175349616083473, - "parity_weight": 8.205017218093138, - "hunt_mode_threshold": 0.25279170529501593, - "prob_grid_weight": 0.6568900836224837, - "avoid_edges_weight": 0.4656965969928337 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7817678292724095, - "parity_weight": 5.797472157574111, - "hunt_mode_threshold": 0.43595358823321606, + "adjacent_hit_weight": 8.087773564894867, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 7.825171123063948, + "hunt_mode_threshold": 0.3530868889493337, "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.34166073158198296 + "avoid_edges_weight": 0.23470834060630852 }, { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.7716175214522005, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.2624278915715169, + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 5.038323955912958, + "parity_weight": 6.209454966186546, + "hunt_mode_threshold": 0.9299216412929068, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.16589607601415945 + }, + { + "adjacent_hit_weight": 16.254111456441827, + "ship_size_weight": 5.9812869551378745, + "parity_weight": 5.466043073015681, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 4.599919822331002, + "ship_size_weight": 5.038323955912958, + "parity_weight": 8.330005066172998, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.3508113582328297, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 8.087773564894867, + "ship_size_weight": 1.407191741328706, + "parity_weight": 0.6553921699638154, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.4987701442576551, "avoid_edges_weight": 0.23470834060630852 }, { "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.7716175214522005, - "parity_weight": 4.625948440382983, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.08504691124591834 + "ship_size_weight": 1.407191741328706, + "parity_weight": 1.9132914863424622, + "hunt_mode_threshold": 0.9990809341853193, + "prob_grid_weight": 0.2711561935555683, + "avoid_edges_weight": 0.8642561717509587 + }, + { + "adjacent_hit_weight": 5.994844962524883, + "ship_size_weight": 8.77290301547829, + "parity_weight": 5.2382759739986495, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.5428768635639853 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 6.348126791101947, + "parity_weight": 5.420928254655672, + "hunt_mode_threshold": 0.9990809341853193, + "prob_grid_weight": 0.877985322187728, + "avoid_edges_weight": 0.14662386124215065 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 0.6553921699638154, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.6261288925111945 }, { "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.928779110041181, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.23923250432522725, - "prob_grid_weight": 0.5531691113245726, + "ship_size_weight": 8.275106616709172, + "parity_weight": 3.1255548292201962, + "hunt_mode_threshold": 0.3173590600826165, + "prob_grid_weight": 0.8245105709261448, "avoid_edges_weight": 0.23470834060630852 }, { - "adjacent_hit_weight": 3.592852373307834, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 2.027499931803688, - "hunt_mode_threshold": 0.3254588170369711, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.2446331949725662 + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 4.2947247973468, + "parity_weight": 3.253226371830422, + "hunt_mode_threshold": 0.1394995927117076, + "prob_grid_weight": 0.9023480753728529, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 4.896593155335561, + "ship_size_weight": 1.407191741328706, + "parity_weight": 4.667287029051002, + "hunt_mode_threshold": 0.9032341953003225, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.5428768635639853 }, { "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.7501450787954749, - "avoid_edges_weight": 0.23470834060630852 + "ship_size_weight": 6.785824455992765, + "parity_weight": 8.330005066172998, + "hunt_mode_threshold": 0.3733119296897912, + "prob_grid_weight": 0.3312219534170622, + "avoid_edges_weight": 0.7454330686689987 }, { - "adjacent_hit_weight": 3.0370278724096202, - "ship_size_weight": 6.078507048706982, - "parity_weight": 5.34727749041113, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.537602545328691, - "avoid_edges_weight": 0.9529382772962358 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 2.2549934639601563, + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 5.5836849809901725, + "parity_weight": 6.534590408973237, "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.121927902457034, - "avoid_edges_weight": 0.23470834060630852 + "prob_grid_weight": 0.6317025781649804, + "avoid_edges_weight": 0.2659648293721587 }, { - "adjacent_hit_weight": 19.96580607636592, + "adjacent_hit_weight": 19.126287517488507, "ship_size_weight": 0.2779014464544405, - "parity_weight": 4.393248917834832, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.7417448538634152, - "avoid_edges_weight": 0.34166073158198296 + "parity_weight": 3.582523162062472, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.8245105709261448, + "avoid_edges_weight": 0.37207403202344114 }, { "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 1.9130307744781316, + "parity_weight": 8.775156260024483, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.065357807758469, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 9.310949893632435, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.9032341953003225, + "prob_grid_weight": 0.2711561935555683, + "avoid_edges_weight": 0.5428768635639853 + }, + { + "adjacent_hit_weight": 4.896593155335561, "ship_size_weight": 0.2779014464544405, - "parity_weight": 7.988104745180094, - "hunt_mode_threshold": 0.22539205093999387, - "prob_grid_weight": 0.8439085232072077, - "avoid_edges_weight": 0.23470834060630852 + "parity_weight": 1.411120874007662, + "hunt_mode_threshold": 0.22549471840456095, + "prob_grid_weight": 0.23729429830250515, + "avoid_edges_weight": 0.7454330686689987 }, { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 0.23560470319328064, - "parity_weight": 3.889948746229084, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.7632551458531032 - }, - { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 0.2779014464544405, - "parity_weight": 2.027499931803688, - "hunt_mode_threshold": 0.9091171712653319, - "prob_grid_weight": 0.4302001617121506, - "avoid_edges_weight": 0.7948009142618758 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 6.065720351749599, - "parity_weight": 3.3503675612503936, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.5531691113245726, + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 2.515207564765616, + "parity_weight": 1.7901827088359201, + "hunt_mode_threshold": 0.11964935705353427, + "prob_grid_weight": 0.1678654895104562, "avoid_edges_weight": 0.23470834060630852 }, { "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 5.7716175214522005, - "parity_weight": 4.69960316067505, - "hunt_mode_threshold": 0.15983792193139107, - "prob_grid_weight": 0.9497243218899789, - "avoid_edges_weight": 0.5672047804709047 + "ship_size_weight": 5.648472726636793, + "parity_weight": 3.796730694738705, + "hunt_mode_threshold": 0.9769590729399378, + "prob_grid_weight": 0.7332873685697293, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 3.037351234498513, + "parity_weight": 4.837359862024064, + "hunt_mode_threshold": 0.785593198386542, + "prob_grid_weight": 0.3312219534170622, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 5.264823123146412, + "hunt_mode_threshold": 0.5677494993800748, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.16589607601415945 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 5.648472726636793, + "parity_weight": 1.7901827088359201, + "hunt_mode_threshold": 0.22549471840456095, + "prob_grid_weight": 0.23729429830250515, + "avoid_edges_weight": 0.7697622957088427 }, { "adjacent_hit_weight": 19.577100495854815, "ship_size_weight": 0.2779014464544405, - "parity_weight": 5.538611035310669, - "hunt_mode_threshold": 0.8208623430151173, - "prob_grid_weight": 0.8566983212117297, - "avoid_edges_weight": 0.7948009142618758 + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.065357807758469, + "avoid_edges_weight": 0.7454330686689987 }, { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 1.0481077704257125, - "parity_weight": 6.644885947625248, - "hunt_mode_threshold": 0.1276943394423675, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.5184285610816615 + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 8.303118451965663, + "parity_weight": 6.534590408973237, + "hunt_mode_threshold": 0.4804778776889068, + "prob_grid_weight": 0.8820184862665053, + "avoid_edges_weight": 0.4297048881361649 + }, + { + "adjacent_hit_weight": 19.75527137475864, + "ship_size_weight": 6.147683370697216, + "parity_weight": 5.466043073015681, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.5752605228914742, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.9032341953003225, + "prob_grid_weight": 0.877985322187728, + "avoid_edges_weight": 0.34312445122534285 + }, + { + "adjacent_hit_weight": 5.994844962524883, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 1.5883128287927928, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.5428768635639853 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 2.515207564765616, + "parity_weight": 9.975087886016505, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 1.7354319256979245, + "parity_weight": 0.6553921699638154, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.7336514659571642, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 5.5836849809901725, + "parity_weight": 2.9870838186835034, + "hunt_mode_threshold": 0.3302304290933093, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 8.087773564894867, + "ship_size_weight": 5.118303011248196, + "parity_weight": 0.9712409848596792, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.4987701442576551, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 6.468922196720895, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.5241462977052711, + "prob_grid_weight": 0.992580790119959, + "avoid_edges_weight": 0.16589607601415945 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 3.796730694738705, + "hunt_mode_threshold": 0.950869945988991, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 12.483234380008852, + "ship_size_weight": 8.275106616709172, + "parity_weight": 5.264823123146412, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.1949834930360982, + "avoid_edges_weight": 0.17982544142989687 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 3.796730694738705, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.877985322187728, + "avoid_edges_weight": 0.12760694190729982 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 5.648472726636793, + "parity_weight": 3.796730694738705, + "hunt_mode_threshold": 0.22549471840456095, + "prob_grid_weight": 0.23729429830250515, + "avoid_edges_weight": 0.6587954841569541 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 8.275106616709172, + "parity_weight": 0.9712409848596792, + "hunt_mode_threshold": 0.17233242701214357, + "prob_grid_weight": 0.4266073620103604, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 4.130324181789419, + "parity_weight": 5.420928254655672, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.2711561935555683, + "avoid_edges_weight": 0.2675297757895241 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.5677494993800748, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 6.55415325767609, + "parity_weight": 1.4799589118341683, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 16.254111456441827, + "ship_size_weight": 3.388043217528607, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.1276052836941518 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 6.785824455992765, + "parity_weight": 8.330005066172998, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.3312219534170622, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 4.599919822331002, + "ship_size_weight": 1.2065691188091654, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.8245105709261448, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 1.9897199198188606, + "ship_size_weight": 2.134789554989954, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.5241462977052711, + "prob_grid_weight": 0.7575530194999872, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 6.349767051449646, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 1.5190233043543722, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.3071292214078144, + "avoid_edges_weight": 0.12760694190729982 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 9.88231554946138, + "parity_weight": 5.936772440946989, + "hunt_mode_threshold": 0.4804778776889068, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 3.4138866035033915, + "ship_size_weight": 7.21351182856845, + "parity_weight": 1.4680441322771909, + "hunt_mode_threshold": 0.22549471840456095, + "prob_grid_weight": 0.7674589658245065, + "avoid_edges_weight": 0.17580574756704548 + }, + { + "adjacent_hit_weight": 10.96215480443272, + "ship_size_weight": 0.7753733891207315, + "parity_weight": 6.209454966186546, + "hunt_mode_threshold": 0.3839716201164475, + "prob_grid_weight": 0.4194097509192617, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 2.324643868077051, + "parity_weight": 5.466043073015681, + "hunt_mode_threshold": 0.15579468050376855, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 4.376012786225889, + "ship_size_weight": 6.332220349095073, + "parity_weight": 9.863485369025899, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.065357807758469, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 8.087773564894867, + "ship_size_weight": 1.407191741328706, + "parity_weight": 4.283657272486269, + "hunt_mode_threshold": 0.19657659851885878, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 10.667552914268091, + "ship_size_weight": 6.785824455992765, + "parity_weight": 5.466043073015681, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.04060146705440215, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 12.483234380008852, + "ship_size_weight": 9.30129162033857, + "parity_weight": 5.264823123146412, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.19118657155952357 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 7.950559710889992, + "parity_weight": 1.7901827088359201, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 9.408134641382723, + "parity_weight": 1.7953714204742988, + "hunt_mode_threshold": 0.8883371043802557, + "prob_grid_weight": 0.4266073620103604, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 2.01962887975058, + "parity_weight": 3.582523162062472, + "hunt_mode_threshold": 0.8247423901047466, + "prob_grid_weight": 0.23729429830250515, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 6.55415325767609, + "parity_weight": 6.115991482185395, + "hunt_mode_threshold": 0.4804778776889068, + "prob_grid_weight": 0.6317025781649804, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 4.952546330085829, + "parity_weight": 1.7953714204742988, + "hunt_mode_threshold": 0.17233242701214357, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 10.667552914268091, + "ship_size_weight": 2.01962887975058, + "parity_weight": 8.330005066172998, + "hunt_mode_threshold": 0.3721324292758954, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.7454330686689987 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 3.582523162062472, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.23729429830250515, + "avoid_edges_weight": 0.12760694190729982 + }, + { + "adjacent_hit_weight": 11.800524704398738, + "ship_size_weight": 0.7753733891207315, + "parity_weight": 1.6036581881451895, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.7076474366541579 + }, + { + "adjacent_hit_weight": 10.667552914268091, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 6.209454966186546, + "hunt_mode_threshold": 0.5677494993800748, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 9.408134641382723, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.407488457059233, + "prob_grid_weight": 0.4661189045104577, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 9.88231554946138, + "parity_weight": 6.534590408973237, + "hunt_mode_threshold": 0.719872146974613, + "prob_grid_weight": 0.8820184862665053, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 0.02921149824838598, + "parity_weight": 3.249466261082322, + "hunt_mode_threshold": 0.7041007570971411, + "prob_grid_weight": 0.4987701442576551, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 5.994844962524883, + "ship_size_weight": 0.2779014464544405, + "parity_weight": 6.24186381020873, + "hunt_mode_threshold": 0.4804778776889068, + "prob_grid_weight": 0.8726954813988514, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 2.01962887975058, + "parity_weight": 1.5190233043543722, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.16589607601415945 }, { "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 2.055217618981212, - "parity_weight": 4.436293658220476, - "hunt_mode_threshold": 0.10805265779054413, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.35831792304299426 - }, - { - "adjacent_hit_weight": 7.455095747698755, - "ship_size_weight": 0.7147611813939592, - "parity_weight": 0.7071978739779183, - "hunt_mode_threshold": 0.7102788495740624, - "prob_grid_weight": 0.13413977992412862, - "avoid_edges_weight": 0.9529382772962358 + "ship_size_weight": 8.303118451965663, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.9955153507684203, + "avoid_edges_weight": 0.2718430977902554 }, { "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.23560470319328064, - "parity_weight": 4.69960316067505, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 + "ship_size_weight": 8.303118451965663, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.8081118914094031, + "prob_grid_weight": 0.992580790119959, + "avoid_edges_weight": 0.16589607601415945 }, { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 4.053078966925367, - "parity_weight": 5.338344078340791, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.08504691124591834 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 4.869025789483935, - "parity_weight": 6.505997821431616, - "hunt_mode_threshold": 0.131668242165648, - "prob_grid_weight": 0.43480679985790816, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 6.92303305292662, - "parity_weight": 7.988104745180094, - "hunt_mode_threshold": 0.44792826408093045, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.24659758631562956 - }, - { - "adjacent_hit_weight": 13.844534383750897, - "ship_size_weight": 0.2940705436097524, - "parity_weight": 5.567253840168976, - "hunt_mode_threshold": 0.1276943394423675, - "prob_grid_weight": 0.32682925126067797, - "avoid_edges_weight": 0.5145461230577483 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.23560470319328064, - "parity_weight": 8.959010440688132, - "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 5.989378497323124, - "ship_size_weight": 7.1417529111579325, - "parity_weight": 4.305338614688149, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.2678624985617166, - "avoid_edges_weight": 0.7632551458531032 - }, - { - "adjacent_hit_weight": 10.29789949219008, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 8.205017218093138, - "hunt_mode_threshold": 0.7868345072506443, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.5409902536205015 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 4.69960316067505, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.5310034408794387, - "avoid_edges_weight": 0.23470834060630852 - }, - { - "adjacent_hit_weight": 3.0370278724096202, - "ship_size_weight": 6.792846648817518, - "parity_weight": 0.5901640735031422, - "hunt_mode_threshold": 0.7919328110109498, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.9529382772962358 - }, - { - "adjacent_hit_weight": 19.577100495854815, - "ship_size_weight": 0.18922723913619044, - "parity_weight": 4.189565897698494, - "hunt_mode_threshold": 0.5194097056214101, - "prob_grid_weight": 0.4987701442576551, - "avoid_edges_weight": 0.34166073158198296 + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 7.21351182856845, + "parity_weight": 1.4680441322771909, + "hunt_mode_threshold": 0.19657659851885878, + "prob_grid_weight": 0.8245105709261448, + "avoid_edges_weight": 0.7041956825708141 }, { "adjacent_hit_weight": 19.577100495854815, "ship_size_weight": 0.2779014464544405, - "parity_weight": 6.505997821431616, - "hunt_mode_threshold": 0.9378930375369722, - "prob_grid_weight": 0.5531691113245726, - "avoid_edges_weight": 0.2446331949725662 + "parity_weight": 6.115991482185395, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.19789511343571964, + "avoid_edges_weight": 0.2659648293721587 }, { - "adjacent_hit_weight": 2.3254490243581705, - "ship_size_weight": 6.792846648817518, - "parity_weight": 6.1364981003162855, - "hunt_mode_threshold": 0.5549457714613905, - "prob_grid_weight": 0.2624278915715169, - "avoid_edges_weight": 0.5184285610816615 + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 9.88231554946138, + "parity_weight": 6.534590408973237, + "hunt_mode_threshold": 0.4804778776889068, + "prob_grid_weight": 0.8820184862665053, + "avoid_edges_weight": 0.2659648293721587 }, { - "adjacent_hit_weight": 15.996261389904152, - "ship_size_weight": 0.7984631209121251, - "parity_weight": 2.027499931803688, + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 4.056734759499134, + "parity_weight": 1.8852328708712618, + "hunt_mode_threshold": 0.8444811476984724, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 1.6279047299453342, + "parity_weight": 0.6553921699638154, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.2711561935555683, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 4.599919822331002, + "ship_size_weight": 1.2065691188091654, + "parity_weight": 1.6796984982256657, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.2819019348405092, + "avoid_edges_weight": 0.07713023731455548 + }, + { + "adjacent_hit_weight": 8.393692079008169, + "ship_size_weight": 1.7485124965728394, + "parity_weight": 8.330005066172998, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.3312219534170622, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 3.4138866035033915, + "ship_size_weight": 2.303856615289477, + "parity_weight": 1.4680441322771909, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.4266073620103604, + "avoid_edges_weight": 0.7041956825708141 + }, + { + "adjacent_hit_weight": 5.994844962524883, + "ship_size_weight": 7.21351182856845, + "parity_weight": 9.669140110314064, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.065357807758469, + "avoid_edges_weight": 0.37207403202344114 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 1.407191741328706, + "parity_weight": 9.975087886016505, + "hunt_mode_threshold": 0.719872146974613, + "prob_grid_weight": 0.2711561935555683, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 12.483234380008852, + "ship_size_weight": 0.5752605228914742, + "parity_weight": 3.796730694738705, + "hunt_mode_threshold": 0.8081118914094031, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.14662386124215065 + }, + { + "adjacent_hit_weight": 8.087773564894867, + "ship_size_weight": 8.303118451965663, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.9955153507684203, + "avoid_edges_weight": 0.2718430977902554 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 6.55415325767609, + "parity_weight": 9.946434919878023, + "hunt_mode_threshold": 0.2329082919725001, + "prob_grid_weight": 0.5188954568324395, + "avoid_edges_weight": 0.7398046064711428 + }, + { + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 9.684818925870895, + "parity_weight": 6.209454966186546, + "hunt_mode_threshold": 0.1394995927117076, + "prob_grid_weight": 0.065357807758469, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 16.934290638080522, + "ship_size_weight": 8.77290301547829, + "parity_weight": 5.2382759739986495, + "hunt_mode_threshold": 0.985237716244456, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.5296014931715418 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 5.5836849809901725, + "parity_weight": 8.330005066172998, "hunt_mode_threshold": 0.3302304290933093, - "prob_grid_weight": 0.4791703757727295, + "prob_grid_weight": 0.3312219534170622, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 1.9897199198188606, + "ship_size_weight": 6.785824455992765, + "parity_weight": 3.582523162062472, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.7393662502785493, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 5.994844962524883, + "ship_size_weight": 9.639643999389465, + "parity_weight": 8.330005066172998, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.3312219534170622, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 1.9808601830435846, + "parity_weight": 1.7901827088359201, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 9.88231554946138, + "parity_weight": 2.2248088262634202, + "hunt_mode_threshold": 0.4804778776889068, + "prob_grid_weight": 0.19102565876727762, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 10.667552914268091, + "ship_size_weight": 1.407191741328706, + "parity_weight": 6.209454966186546, + "hunt_mode_threshold": 0.8081118914094031, + "prob_grid_weight": 0.4795681491015149, + "avoid_edges_weight": 0.23470834060630852 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 8.794876527044433, + "parity_weight": 6.534590408973237, + "hunt_mode_threshold": 0.2556833099269248, + "prob_grid_weight": 0.8820184862665053, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 2.2773146430764557, + "parity_weight": 1.7901827088359201, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.10586855560315023, + "avoid_edges_weight": 0.2659648293721587 + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 9.400357287459503, + "parity_weight": 4.393248917834832, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.6577060753849168, "avoid_edges_weight": 0.23470834060630852 } ] \ No newline at end of file diff --git a/content/uploads/2024/battleship-solvers/compare_battleship.sh b/content/uploads/2024/battleship-solvers/compare_battleship.sh index 39e1355..c4aee8d 100644 --- a/content/uploads/2024/battleship-solvers/compare_battleship.sh +++ b/content/uploads/2024/battleship-solvers/compare_battleship.sh @@ -2,6 +2,7 @@ RUNS=100 PROB_FILE="prob_results.txt" +#PROB_FILE2="prob_results2.txt" GENETIC_FILE="genetic_results.txt" GENETIC_FILE2="genetic_results_ensemble.txt" @@ -45,16 +46,22 @@ calculate_stats() { # Run probability grid simulation run_simulation "battleship_prob.py" $PROB_FILE "Probability Grid" -# Run genetic algorithm simulation -run_simulation "battleship_genetic2.py" $GENETIC_FILE "Genetic Algorithm" +# Run probability grid simulation +#run_simulation "battleship_prob2.py" $PROB_FILE2 "Probability Grid 2" # Run genetic algorithm simulation -run_simulation "battleship_genetic2.py" $GENETIC_FILE2 "Genetic Algorithm Ensemble" +run_simulation "battleship_genetic.py" $GENETIC_FILE "Genetic Algorithm" + +# Run genetic algorithm simulation +# temporarily commented out because the single top elite often works better... +#run_simulation "battleship_genetic.py" $GENETIC_FILE2 "Genetic Algorithm Ensemble" # Calculate and display statistics calculate_stats $PROB_FILE "Probability Grid" +#calculate_stats $PROB_FILE2 "Probability Grid 2" calculate_stats $GENETIC_FILE "Genetic Algorithm" -calculate_stats $GENETIC_FILE2 "Genetic Algorithm Ensemble" +#calculate_stats $GENETIC_FILE2 "Genetic Algorithm Ensemble" # Clean up -rm $PROB_FILE $GENETIC_FILE $GENETIC_FILE2 +#rm $PROB_FILE $PROB_FILE2 $GENETIC_FILE $GENETIC_FILE2 +rm $PROB_FILE $GENETIC_FILE diff --git a/content/uploads/2024/battleship-solvers/elites.json b/content/uploads/2024/battleship-solvers/elites.json new file mode 100644 index 0000000..7668546 --- /dev/null +++ b/content/uploads/2024/battleship-solvers/elites.json @@ -0,0 +1,1302 @@ +[ + { + "adjacent_hit_weight": 13.844534383750897, + "ship_size_weight": 3.0686198043120227, + "parity_weight": 5.466043073015681, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.27933226069242245, + "avoid_edges_weight": 0.16589607601415945, + "probability_grid": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + ] + }, + { + "adjacent_hit_weight": 12.483234380008852, + "ship_size_weight": 1.407191741328706, + "parity_weight": 4.667287029051002, + "hunt_mode_threshold": 0.19657659851885878, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.5296014931715418, + "probability_grid": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + ] + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 0.7753733891207315, + "parity_weight": 8.775156260024483, + "hunt_mode_threshold": 0.3530868889493337, + "prob_grid_weight": 0.4266073620103604, + "avoid_edges_weight": 0.2659648293721587, + "probability_grid": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + ] + }, + { + "adjacent_hit_weight": 19.126287517488507, + "ship_size_weight": 9.88231554946138, + "parity_weight": 6.534590408973237, + "hunt_mode_threshold": 0.4804778776889068, + "prob_grid_weight": 0.8820184862665053, + "avoid_edges_weight": 0.2659648293721587, + "probability_grid": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + ] + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 5.5836849809901725, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.3302304290933093, + "prob_grid_weight": 0.6291566755708562, + "avoid_edges_weight": 0.2659648293721587, + "probability_grid": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + ] + }, + { + "adjacent_hit_weight": 5.994844962524883, + "ship_size_weight": 9.408134641382723, + "parity_weight": 1.7901827088359201, + "hunt_mode_threshold": 0.8832537254062759, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.2659648293721587, + "probability_grid": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + ] + }, + { + "adjacent_hit_weight": 16.254111456441827, + "ship_size_weight": 3.388043217528607, + "parity_weight": 5.952911308680944, + "hunt_mode_threshold": 0.4494897103447033, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.2659648293721587, + "probability_grid": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + ] + }, + { + "adjacent_hit_weight": 12.483234380008852, + "ship_size_weight": 7.21351182856845, + "parity_weight": 5.264823123146412, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.4706189418095357, + "probability_grid": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + ] + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 5.586069804892501, + "parity_weight": 4.393248917834832, + "hunt_mode_threshold": 0.2053438642669168, + "prob_grid_weight": 0.1678654895104562, + "avoid_edges_weight": 0.23470834060630852, + "probability_grid": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + ] + }, + { + "adjacent_hit_weight": 19.577100495854815, + "ship_size_weight": 8.794876527044433, + "parity_weight": 9.863485369025899, + "hunt_mode_threshold": 0.5241462977052711, + "prob_grid_weight": 0.9026991045852202, + "avoid_edges_weight": 0.23470834060630852, + "probability_grid": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + ] + } +] \ No newline at end of file diff --git a/content/uploads/2024/battleship-solvers/sample_from_tarball.sh b/content/uploads/2024/battleship-solvers/sample_from_tarball.sh new file mode 100644 index 0000000..01cc783 --- /dev/null +++ b/content/uploads/2024/battleship-solvers/sample_from_tarball.sh @@ -0,0 +1,10 @@ +# Variables +TARBALL="battleship_boards.json.tar.gz" +SAMPLE_FILE="sampled_boards.json" +NUM_SAMPLES=1000 # Number of random samples to extract + +# Stream the tarball and sample lines +tar -xzOf "$TARBALL" | shuf -n "$NUM_SAMPLES" > "$SAMPLE_FILE" + +# Output the location of the sampled file +echo "Random samples saved to $SAMPLE_FILE" diff --git a/content/uploads/2024/battleship-solvers/sample_one_from_tarball.sh b/content/uploads/2024/battleship-solvers/sample_one_from_tarball.sh new file mode 100644 index 0000000..f3d6c7d --- /dev/null +++ b/content/uploads/2024/battleship-solvers/sample_one_from_tarball.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Variable +TARBALL="battleship_boards.json.tar.gz" + +# Stream the tarball and sample one random line +tar -xzOf "$TARBALL" | shuf -n 1