| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 37110de commit 809988d
13 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -514,7 +514,7 @@ def add_thing(self, thing, location=(1, 1), exclude_duplicate_class_items=False) | |||
| 514 | 514 | def is_inbounds(self, location): | |
| 515 | 515 | """Checks to make sure that the location is inbounds (within walls if we have walls)""" | |
| 516 | 516 | x, y = location | |
| 517 | - return not (x < self.x_start or x >= self.x_end or y < self.y_start or y >= self.y_end) | ||
| 517 | + return not (x < self.x_start or x > self.x_end or y < self.y_start or y > self.y_end) | ||
| 518 | 518 | ||
| 519 | 519 | def random_location_inbounds(self, exclude=None): | |
| 520 | 520 | """Returns a random location that is inbounds (within walls if we have walls)""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -210,12 +210,12 @@ def backprop(n, utility): | |||
| 210 | 210 | ||
| 211 | 211 | root = MCT_Node(state=state) | |
| 212 | 212 | ||
| 213 | - while N > 0: | ||
| 213 | + for _ in range(N): | ||
| 214 | 214 | leaf = select(root) | |
| 215 | 215 | child = expand(leaf) | |
| 216 | 216 | result = simulate(game, child.state) | |
| 217 | 217 | backprop(child, result) | |
| 218 | - N -= 1 | ||
| 218 | + | ||
| 219 | 219 | max_state = max(root.children, key=lambda p: p.N) | |
| 220 | 220 | ||
| 221 | 221 | return root.children.get(max_state) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments