Fix some returns and other problems.
This commit is contained in:
parent
45f4f3b707
commit
29c46717d9
2 changed files with 1 additions and 5 deletions
|
|
@ -114,14 +114,12 @@ class Searcher:
|
|||
for item in nodeList:
|
||||
if item not in self.open:
|
||||
self.open.insert(0, item)
|
||||
return None
|
||||
def insert_end(self, nodeList):
|
||||
# forwards "sort"
|
||||
# loop through each element, and apply it to the end of the open list.
|
||||
for item in nodeList:
|
||||
if item not in self.open:
|
||||
self.open.append(item)
|
||||
return None
|
||||
def insert_ordered(self, nodeList):
|
||||
# sort by the lowest cost after adding all the elements to the open list.
|
||||
# add the nodes to the list
|
||||
|
|
@ -132,11 +130,9 @@ class Searcher:
|
|||
self.open.clear()
|
||||
# replace it with the sorted list by extending the blank list.
|
||||
self.open.extend(sortedList)
|
||||
return None
|
||||
|
||||
# (b) Show your program loading in the 30-node sample file.
|
||||
# s=Searcher("30node.txt")
|
||||
s=Searcher("samplemap-1.txt")
|
||||
s=Searcher("30node.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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue