Skip to content

Commit fa2c4a6

Browse files
author
murez
committed
push
1 parent 4286adf commit fa2c4a6

10 files changed

Lines changed: 1882 additions & 276 deletions

File tree

HW3/p2_logic/hybridAgents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class BaseAgent(Agent):
2020
def observationFunction(self, gameState):
2121
walls = gameState.getWalls()
2222
currentState = gameState.getPacmanPosition()
23-
ghosts = gameState.getGhostPositions()
23+
ghosts = gameState.get_ghost_positions()
2424

2525
# ghosts = []
2626
# for agents in board.agentPositions[1:]:

HW6/reinforcement/autotuning.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,30 @@ def run_pacman(bias,
4848

4949

5050
pbounds = {
51-
"bias": (-10, 10),
51+
"bias": (-3, 3),
5252
"closest_weak_ghost_0": (-10, 10),
53-
"closest_weak_ghost_1": (-10, 10),
54-
"strong_ghost_1_step_0": (-10, 10),
55-
"strong_ghost_1_step_1": (-10, 10),
56-
"strong_ghost_2_step_0": (-10, 10),
57-
"strong_ghost_2_step_1": (-10, 10),
58-
"weak_ghost_0": (-10, 10),
59-
"weak_ghost_1": (-10, 10),
60-
"eats_capsule": (-10, 10),
61-
"eats_food": (-10, 10),
62-
"closest_capsule_0": (-10, 10),
63-
"closest_capsule_1": (-10, 10),
64-
"closest_food_0": (-10, 10),
65-
"closest_food_1": (-10, 10)
53+
"closest_weak_ghost_1": (-7, -5),
54+
"strong_ghost_1_step_0": (-8, -4),
55+
"strong_ghost_1_step_1": (-10, 0),
56+
"strong_ghost_2_step_0": (-10, 5),
57+
"strong_ghost_2_step_1": (-5, 5),
58+
"weak_ghost_0": (-5, 5),
59+
"weak_ghost_1": (-5, 10),
60+
"eats_capsule": (0, 10),
61+
"eats_food": (0, 10),
62+
"closest_capsule_0": (-5, 10),
63+
"closest_capsule_1": (-1, 5),
64+
"closest_food_0": (0, 10),
65+
"closest_food_1": (-4, 2)
6666
}
6767

6868
optimizer = BayesianOptimization(
6969
f=run_pacman,
7070
pbounds=pbounds,
71-
random_state=1,
71+
random_state=4,
7272
)
7373

7474
optimizer.maximize(
75-
init_points=2,
76-
n_iter=3,
75+
init_points=500,
76+
n_iter=6000,
7777
)

HW6/reinforcement/featureExtractors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def getFeatures(self, state, action):
7676
# extract the grid of food and wall locations and get the ghost locations
7777
food = state.getFood()
7878
walls = state.getWalls()
79-
ghosts = state.getGhostPositions()
79+
ghosts = state.get_ghost_positions()
8080

8181
features = util.Counter()
8282

0 commit comments

Comments
 (0)