Skip to content

Instantly share code, notes, and snippets.

@aacunningham
Created February 9, 2016 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aacunningham/7c99d0751beff3351291 to your computer and use it in GitHub Desktop.
Save aacunningham/7c99d0751beff3351291 to your computer and use it in GitHub Desktop.
class Node:
def __init__(self, state, parent=None, action=None, cost=0):
self.state = state
self.parent = parent
self.action = action
self.cost = cost
if parent is not None:
self.depth = parent.depth + 1
else:
self.depth = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment