Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
add algo interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Myonmu committed Sep 24, 2021
1 parent 131c7ba commit 0e8c70c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .idea/agent-aspirateur.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions Search/Search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class State(object):
def __init__(self):
raise NotImplementedError

def __eq__(self, other):
raise NotImplementedError

def __hash__(self):
raise NotImplementedError

def __str__(self):
return ""


class Problem(object):
def __init__(self, initial: State = None, goal: State = None):
self.goal = goal
self.initial = initial

def actions(self, state: State):
raise NotImplementedError

def result(self, state: State, action) -> State:
raise NotImplementedError

def goal_test(self, state: State):
return state == self.goal

def cost(self, state: State, action):
return 1

def heuristic(self, state: State, action):
return 0

def __str__(self):
return f"{type(self).__name__},{self.initial},{self.goal}"
Empty file added Search/__init__.py
Empty file.

0 comments on commit 0e8c70c

Please sign in to comment.