From 53e4cc580d87c6c67d95b7303ebd37f78a039b4b Mon Sep 17 00:00:00 2001 From: ZhuangYumin Date: Mon, 1 Jul 2024 03:33:31 +0000 Subject: [PATCH] slightly opt --- multiagent/multiAgents.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multiagent/multiAgents.py b/multiagent/multiAgents.py index 4532a56..92c85fd 100644 --- a/multiagent/multiAgents.py +++ b/multiagent/multiAgents.py @@ -397,6 +397,8 @@ def betterEvaluationFunction(currentGameState: GameState): da_for_capsules=DistanceAnalysis(current_self_position,capsules_position) da_for_edible_ghosts=DistanceAnalysis(current_self_position,edible_ghosts_positions) res=da_for_capsules*2-da_for_unscared_ghosts*2-da_for_scared_ghosts*0.2+da_for_foods*0.2+da_for_edible_ghosts*1 + if da_for_unscared_ghosts<1/6: + res+=(da_for_foods*0.2+da_for_edible_ghosts*1)*5 # res*=random.uniform(0.9, 1.1) res*=100 global last_score