summaryrefslogtreecommitdiff
path: root/src/strategy/monte_carlo.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-06-09 10:27:29 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-06-09 10:27:29 +0200
commit088f0aeb23789ace5e9b77e75d5c23f5442e4cdc (patch)
tree9efefffa9ba20fce137c17f4f688ca7f572c9978 /src/strategy/monte_carlo.rs
parent9f0838006905fd039c4e0d87a69338f33e75246d (diff)
Added pruning of buying energy buildings behind a feature flag
Diffstat (limited to 'src/strategy/monte_carlo.rs')
-rw-r--r--src/strategy/monte_carlo.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/strategy/monte_carlo.rs b/src/strategy/monte_carlo.rs
index c2f3561..0d813d3 100644
--- a/src/strategy/monte_carlo.rs
+++ b/src/strategy/monte_carlo.rs
@@ -75,12 +75,12 @@ fn simulate_to_endstate<R: Rng>(command_score: &mut CommandScore, settings: &Gam
}
fn random_player_move<R: Rng>(settings: &GameSettings, state: &GameState, rng: &mut R) -> Command {
- let all_buildings = state.player_affordable_buildings(settings);
+ let all_buildings = state.player.sensible_buildings(settings);
random_move(&state.unoccupied_player_cells, &all_buildings, rng)
}
fn random_opponent_move<R: Rng>(settings: &GameSettings, state: &GameState, rng: &mut R) -> Command {
- let all_buildings = state.opponent_affordable_buildings(settings);
+ let all_buildings = state.opponent.sensible_buildings(settings);
random_move(&state.unoccupied_opponent_cells, &all_buildings, rng)
}
@@ -151,7 +151,7 @@ impl CommandScore {
}
fn init_command_scores(settings: &GameSettings, state: &GameState) -> Vec<CommandScore> {
- let all_buildings = state.player_affordable_buildings(settings);
+ let all_buildings = state.player.sensible_buildings(settings);
let mut commands = Vec::with_capacity(state.unoccupied_player_cells.len()*all_buildings.len()+1);
commands.push(CommandScore::new(Command::Nothing));