Created
February 27, 2013 02:13
-
-
Save stuntgoat/5044357 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Search(object): | |
def __init__(self, state, *args, **kwargs): | |
self.state = state | |
self.cost_func = None | |
def actions(self): | |
""" | |
Returns a set of actions. | |
""" | |
pass | |
def transition(self, action): | |
""" | |
Called on self.action(<choice>) and sets self.state | |
to a new value. | |
""" | |
pass | |
def goal_test(self): | |
""" | |
Checks self.state for the goal state. | |
Returns a boolean. | |
""" | |
raise Exception('self.goal_test has not been defined') | |
def set_cost_func(self, func): | |
""" | |
Sets the cost function. | |
""" | |
self.cost_func = func |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment