This commit is contained in:
William Fu-Hinthorn
2024-03-03 17:52:12 -08:00
parent 33d36c37b4
commit 699d89b3d9
+3 -3
View File
@@ -191,9 +191,9 @@
" node = node.parent\n",
" # Reverse the final back-tracked trajectory to return in the correct order\n",
" return messages[::-1] # root solution, reflection, child 1, ...\n",
" \n",
"\n",
" def _get_all_children(self):\n",
" all_nodes = [self]\n",
" all_nodes = []\n",
" nodes = deque()\n",
" nodes.append(self)\n",
" while nodes:\n",
@@ -205,7 +205,7 @@
"\n",
" def get_best_solution(self):\n",
" \"\"\"Return the best solution from within the current sub-tree.\"\"\"\n",
" all_nodes = self._get_all_children()\n",
" all_nodes = [self] + self._get_all_children()\n",
" best_node = max(\n",
" all_nodes,\n",
" # We filter out all non-terminal, non-solution trajectories\n",