From 088f0aeb23789ace5e9b77e75d5c23f5442e4cdc Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sat, 9 Jun 2018 10:27:29 +0200 Subject: Added pruning of buying energy buildings behind a feature flag --- src/strategy/monte_carlo.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/strategy/monte_carlo.rs') 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(command_score: &mut CommandScore, settings: &Gam } fn random_player_move(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(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 { - 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)); -- cgit v1.2.3