Removed deconstruction from the list of commands considered
authorJustin Worthe <justin@worthe-it.co.za>
Sat, 30 Jun 2018 11:33:36 +0000 (13:33 +0200)
committerJustin Worthe <justin@worthe-it.co.za>
Sat, 30 Jun 2018 11:33:36 +0000 (13:33 +0200)
I don't think deconstruction is a necessary part of a viable strategy
for now.

src/strategy/monte_carlo.rs

index dbeac2f..ba4310d 100644 (file)
@@ -159,10 +159,9 @@ impl CommandScore {
         let all_buildings = state.player.sensible_buildings(state.count_player_teslas() < 2, settings);
 
         let building_command_count = state.unoccupied_player_cells.len()*all_buildings.len();
-        let deconstruct_count = (settings.size.x as usize *settings.size.y as usize / 2) - state.unoccupied_player_cells.len();
         let nothing_count = 1;
         
-        let mut commands = Vec::with_capacity(building_command_count + deconstruct_count + nothing_count);
+        let mut commands = Vec::with_capacity(building_command_count + nothing_count);
         commands.push(CommandScore::new(Command::Nothing));
 
         for &position in &state.unoccupied_player_cells {
@@ -171,10 +170,6 @@ impl CommandScore {
             }
         }
 
-        for &position in &state.occupied_player_cells() {
-            commands.push(CommandScore::new(Command::Deconstruct(position)));
-        }
-
         commands
     }
 }