From c9673414cf8edfe8488d75a554931b62e7ddbdda Mon Sep 17 00:00:00 2001 From: Tata0703 Date: Tue, 15 Apr 2025 21:55:33 +0800 Subject: [PATCH 1/2] fix backend removed simulation bug --- .../app/api/lwats/agents_async/SearchAgents/base_agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visual-tree-search-backend/app/api/lwats/agents_async/SearchAgents/base_agent.py b/visual-tree-search-backend/app/api/lwats/agents_async/SearchAgents/base_agent.py index 2ac8092..8917dc8 100644 --- a/visual-tree-search-backend/app/api/lwats/agents_async/SearchAgents/base_agent.py +++ b/visual-tree-search-backend/app/api/lwats/agents_async/SearchAgents/base_agent.py @@ -137,7 +137,7 @@ async def remove_simulated_trajectory(self, starting_node, terminal_node: LATSNo } trajectory_data.append(node_data) - await self.websocket_simulation_removed(trajectory_data, websocket=None) + await self.websocket_simulation_removed(trajectory_data, websocket=websocket) pass def _get_trajectory_data(self, terminal_node: LATSNode): From 31fd2c9d800adeb20e45450f69eda667107d88ba Mon Sep 17 00:00:00 2001 From: Tata0703 Date: Tue, 15 Apr 2025 22:20:28 +0800 Subject: [PATCH 2/2] update page --- visual-tree-search-app/components/LATSVisual.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/visual-tree-search-app/components/LATSVisual.tsx b/visual-tree-search-app/components/LATSVisual.tsx index 9da32cb..f720f35 100644 --- a/visual-tree-search-app/components/LATSVisual.tsx +++ b/visual-tree-search-app/components/LATSVisual.tsx @@ -95,7 +95,7 @@ const LATSVisual: React.FC = ({ messages }) => { } // Handle tree structure updates - if ((data.type === 'tree_update_node_expansion' || data.type === 'tree_update_node_children_evaluation') + if ((data.type === 'tree_update_node_expansion' || data.type === 'tree_update_node_children_evaluation' || data.typ === 'tree_update_node_backpropagation') && Array.isArray(data.tree)) { // Preserve simulation flags when updating from tree if (updatedTreeNodes.some(node => node.isSimulated)) { @@ -151,11 +151,8 @@ const LATSVisual: React.FC = ({ messages }) => { // Handle simulation removal if (data.type === 'removed_simulation') { - // Remove simulation flags instead of removing nodes - updatedTreeNodes = updatedTreeNodes.map(node => ({ - ...node, - isSimulated: false // Remove simulation flag - })); + // Remove all simulated nodes from the tree + updatedTreeNodes = updatedTreeNodes.filter(node => !node.isSimulated); newSimulatedNodes = []; // Clear simulated nodes list newSimulationStartNodeId = null; // Clear simulation start node