Created
January 24, 2014 10:38
-
-
Save puterleat/8595192 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
| def plan_goal(desired_outcome, environment, movie_of_my_plan=[]): | |
| possibilities = filter(outcome_to_action_mapping, desired_outcome, environment) | |
| sort(possibilities, key=magic_inverse_inference_function_which_includes_affordances) | |
| best_bet = possibilities.pop() | |
| if is_an_an_actionable_thing(best_bet): | |
| movie_of_my_plan.append(best_bet) | |
| if calculate_subjective_probability(desired_outcome) < 1: | |
| return | |
| else: | |
| return plan_goal(best_bet, environment, movie_of_my_plan) | |
| return plan_goal(desired_outcome, environment, movie_of_my_plan) | |
| # plan the activity rather than do it now | |
| plans = plan_goal("Attract a mate", "At the disco", [empty list... no plans as yet]) | |
| print plans | |
| > ["Attract a mate", "Dance like a boss", "Buy drinks", "Start a fight", "Despair"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment