def setUp(self): self.initial_state_dict = { 'characters': { 'alice': { 'alive': True }, 'bob': { 'alive': True } } } self.state = State.from_dict(self.initial_state_dict) self.goal_fn = dead_goal_factory('bob')
def plan_search(actor, state, state_validation_function): # actor - main agent in the current planning frame pass if __name__ == "__main__": initial_state_json = { 'characters': { "steven": { 'name': 'Steven', 'alive': True }, "hank": { 'name': 'Hank', 'alive': True }, "harris": { 'name': 'Harris', 'alive': True } } } initial_state = State(json.dumps(initial_state_json)) dead_goal_verify = dead_goal_factory('harris') print "SATISFIED?: %s" % dead_goal_verify(initial_state) state_history = StateHistory(initial_state=initial_state) state_history.apply_action(Kill(['hank'], ['harris'])) print state_history.pretty() print "SATISFIED?: %s" % dead_goal_verify(State(state_history._history[-1]))