'hm'
This commit is contained in:
parent
75b7052e7c
commit
2dfadfd588
@ -58,13 +58,15 @@ class automata:
|
|||||||
def get_node_transition(self, q, i):
|
def get_node_transition(self, q, i):
|
||||||
result = []
|
result = []
|
||||||
# if the node exists
|
# if the node exists
|
||||||
if self.graph[q]:
|
try:
|
||||||
# search through all its connections to find value
|
# search through all its connections to find value
|
||||||
for connections in self.graph[q]:
|
for connections in self.graph[q]:
|
||||||
for value in connections:
|
for value in connections:
|
||||||
if value == i:
|
if value == i:
|
||||||
# append next node
|
# append next node
|
||||||
result.append(connections[value])
|
result.append(connections[value])
|
||||||
|
except KeyError:
|
||||||
|
return result
|
||||||
# return list of next nodes
|
# return list of next nodes
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user