From 7ce4c6c5ae5c63e9b0a3d2358b3f4f06323adde7 Mon Sep 17 00:00:00 2001 From: cdez Date: Sat, 15 Feb 2025 01:52:36 -0700 Subject: [PATCH] Finished the parsing of node stuff. Starting the DRDViz thing. --- RouteFinding/05_tests.py | 16 ++++++++++++---- RouteFinding/30node.png | Bin 0 -> 2396 bytes 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 RouteFinding/30node.png diff --git a/RouteFinding/05_tests.py b/RouteFinding/05_tests.py index f0b45c2..dd669d8 100644 --- a/RouteFinding/05_tests.py +++ b/RouteFinding/05_tests.py @@ -1,4 +1,6 @@ # Define Searcher, hSLD, SearchNode. +import DRDViz + class SearchNode: def __init__(self, label, value): self.label = label @@ -53,12 +55,18 @@ class Searcher: nodePaths[mapContents[nodeIter][1]][mapContents[nodeIter][0]] = mapContents[nodeIter][2] else: nodePaths[mapContents[nodeIter][1]][mapContents[nodeIter][0]] = mapContents[nodeIter][2] - - # print(nodeLoc) - print(nodePaths) + self.nodePaths = nodePaths + self.nodeLocs = nodeLoc + # need to get the myViz attribute by importing the DRDViz stuff. + self.myViz = DRDViz.DRDViz() + # now, start using the myViz thingy to 'display' a map. + def setStartGoal(self, startNode, endNode): + self.startNode = startNode + self.endNode = endNode # (b) Show your program loading in the 30-node sample file. -s=Searcher("30node.txt") +# s=Searcher("30node.txt") +s=Searcher("samplemap-1.txt") # (c) Show you program setting start node=U and end node=T. s.setStartGoal('U','T') # myViz should be a DRDViz instance -> save map to file on disk. diff --git a/RouteFinding/30node.png b/RouteFinding/30node.png new file mode 100644 index 0000000000000000000000000000000000000000..17b4ea042846cd00588f8a30da94b471d0edae25 GIT binary patch literal 2396 zcmeAS@N?(olHy`uVBq!ia0y~yU}|7sV0^&A1{5*9c;^X_vMh0pC<)F_D=AMbN@eg( zEGfvzFUiSFQYcF;D$dN$GuAWHGuBbaC@Co@w$j(ng)7j@FG|-x|8?J2pdp+E9+AZi z4E%{8%(%jSc_sq`$4O5Y$B>FSZ?73LGAQsIFgURP`9r2YHLj|%^JjDz7>v%n2kN|M z)WE=C$R@y`aEyV8;fRC-LxTh}2ZKN|10zEcj{<{34