Mario doesn't die instantly when he falls in a pit. (not on-flag-pole?): Indicates whether we've reached our final goal, the flag pole!īelow-viewport?: One of Mario's primary hazards is falling into bottomless pits. The 7 main factors of our current heuristic are: getByte mem 0x0770 ) ) ypos ( byte-format (. getByte mem 0x00B5 ) below-viewport? ( > vertical-position 1 ) on-flag-pole? ( = 0x03 (. getByte mem 0x0700 ) vertical-position (. ( defn dist "Checks the current RAM and estimates the current distance from the goal." ( let ( retro/retro_unserialize save-state ( alength save-state ) ) ) ( let [ mem ( retro/retro_get_memory_data RETRO_MEMORY_SYSTEM_RAM ) screen-tile (. For our implementation, it doesn't matter what the heuristic returns as long as it can be compared against other values returned from dist. The solver accepts a dist function that should return a comparable heuristic value. Try to find a path from the start to the solution." ( ( solve ( priority-map start ( dist start ) ) dist successors done? # ) ] ( swap! state-cache assoc new-inputs new-state ) new-inputs ) ) ( defn successors "Generates successor states given past inputs." ( into ( comp ( map ( fn ] ( set ( if dir ( conj buttons dir ) buttons ) ) ) ) ( map ( fn ( next-state inputs controls ( inc ( rand-int 60 ) ) ) ) ) ) ( combo/cartesian-product ( combo/subsets buttons ) directions ) ) ) Distance ( defn solve "Given a `start` state, a distance estimating function,Ī `successors` function, and a function that says when we're `done`,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |