From 72a86bb4c043b6316e5c5f163cdd1e66cb99229f Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Thu, 9 Aug 2018 13:07:15 +0200 Subject: Added more TODO ideas --- src/engine/bitwise_engine.rs | 1 + src/engine/geometry.rs | 3 +++ src/strategy/monte_carlo.rs | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/engine/bitwise_engine.rs b/src/engine/bitwise_engine.rs index db31511..8a4ea91 100644 --- a/src/engine/bitwise_engine.rs +++ b/src/engine/bitwise_engine.rs @@ -16,6 +16,7 @@ pub struct BitwiseGameState { pub opponent_buildings: PlayerBuildings, } +//TODO: Add in smallvec? #[derive(Debug, Clone, PartialEq, Eq)] pub struct PlayerBuildings { pub unconstructed: Vec, diff --git a/src/engine/geometry.rs b/src/engine/geometry.rs index 28df774..de9d95a 100644 --- a/src/engine/geometry.rs +++ b/src/engine/geometry.rs @@ -1,5 +1,8 @@ use engine::constants::*; +//TODO: Change Point to be a single number, or stored as a bitfield +// (bitfield to x and y for writing move might be hard? + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Point { pub x: u8, diff --git a/src/strategy/monte_carlo.rs b/src/strategy/monte_carlo.rs index 127e690..d4003bb 100644 --- a/src/strategy/monte_carlo.rs +++ b/src/strategy/monte_carlo.rs @@ -123,6 +123,7 @@ fn random_opponent_move(settings: &GameSettings, state: & random_move(&all_buildings, rng, state.unoccupied_opponent_cell_count(), |i| state.location_of_unoccupied_opponent_cell(i)) } +// TODO: Given enough energy, most opponents won't do nothing fn random_movePoint>(all_buildings: &[BuildingType], rng: &mut R, free_positions_count: usize, get_point: F) -> Command { let building_command_count = free_positions_count*all_buildings.len(); let nothing_count = 1; @@ -131,6 +132,8 @@ fn random_movePoint>(all_buildings: &[BuildingType], rng: let choice_index = rng.gen_range(0, number_of_commands); + // TODO: Remove the divide here? + if choice_index == number_of_commands - 1 { Command::Nothing } else { @@ -192,7 +195,8 @@ impl CommandScore { fn win_ratio(&self) -> i32 { (self.victories as i32 - self.defeats as i32) * 10000 / (self.attempts as i32) } - + + //TODO: Devalue nothing so that it doesn't stand and do nothing when it can do things fn init_command_scores(settings: &GameSettings, state: &GS) -> Vec { let all_buildings = sensible_buildings(settings, &state.player(), state.player_has_max_teslas()); @@ -229,6 +233,7 @@ fn sensible_buildings(settings: &GameSettings, player: &Player, has_max_teslas: } +//TODO: Heuristic that avoids building the initial energy towers all in the same row? #[cfg(feature = "energy-cutoff")] fn sensible_buildings(settings: &GameSettings, player: &Player, has_max_teslas: bool) -> Vec { let mut result = Vec::with_capacity(4); -- cgit v1.2.3