Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 5.6.58) Copyright (c) 1990-2008 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word). ?- ['gridworld.pro', 'agent.pro']. % gridworld.pro compiled 0.00 sec, 12,484 bytes Warning: /import/adams/1/wobcke/Courses/COMP9414/assignment/2012/agent.pro:47: Singleton variables: [Beliefs] % agent.pro compiled 0.01 sec, 9,564 bytes true. ?- agent_trial. Cycle 0: Event: junk value 0 appears at (1,2) World: [junk(1, 2, 0)] Beliefs: [at(0, 0)] Percepts: [junk(1, 2, 0)] Intentions: [[goal(1, 2, 0), []]] New Intentions: [[goal(1, 2, 0), [move(1, 1), move(1, 2), pickup(1, 2)]]] Action: move(1, 0) scores 0 Updated World: [junk(1, 2, 0)] Observation: at(1, 0) Updated Beliefs: [at(1, 0)] Updated Intentions: [[goal(1, 2, 0), [move(1, 1), move(1, 2), pickup(1, 2)]]] Cycle 1: World: [junk(1, 2, 0)] Beliefs: [at(1, 0)] Percepts: [junk(1, 2, 0)] Intentions: [[goal(1, 2, 0), [move(1, 1), move(1, 2), pickup(1, 2)]]] New Intentions: [[goal(1, 2, 0), [move(1, 2), pickup(1, 2)]]] Action: move(1, 1) scores 0 Updated World: [junk(1, 2, 0)] Observation: at(1, 1) Updated Beliefs: [at(1, 1)] Updated Intentions: [[goal(1, 2, 0), [move(1, 2), pickup(1, 2)]]] Cycle 2: World: [junk(1, 2, 0)] Beliefs: [at(1, 1)] Percepts: [junk(1, 2, 0)] Intentions: [[goal(1, 2, 0), [move(1, 2), pickup(1, 2)]]] New Intentions: [[goal(1, 2, 0), [pickup(1, 2)]]] Action: move(1, 2) scores 0 Updated World: [junk(1, 2, 0)] Observation: at(1, 2) Updated Beliefs: [at(1, 2)] Updated Intentions: [[goal(1, 2, 0), [pickup(1, 2)]]] Cycle 3: World: [junk(1, 2, 0)] Beliefs: [at(1, 2)] Percepts: [junk(1, 2, 0)] Intentions: [[goal(1, 2, 0), [pickup(1, 2)]]] New Intentions: [[goal(1, 2, 0), []]] Action: pickup(1, 2) scores 0 Updated World: [] Observation: cleaned(1, 2) Updated Beliefs: [at(1, 2)] Updated Intentions: [] Cycle 4: World: [] Beliefs: [at(1, 2)] Percepts: [] Intentions: [] New Intentions: [] Action: move(2, 2) scores 0 Updated World: [] Observation: at(2, 2) Updated Beliefs: [at(2, 2)] Updated Intentions: [] Cycle 5: World: [] Beliefs: [at(2, 2)] Percepts: [] Intentions: [] New Intentions: [] Action: move(3, 2) scores 0 Updated World: [] Observation: at(3, 2) Updated Beliefs: [at(3, 2)] Updated Intentions: [] Cycle 6: World: [] Beliefs: [at(3, 2)] Percepts: [] Intentions: [] New Intentions: [] Action: move(4, 2) scores 0 Updated World: [] Observation: at(4, 2) Updated Beliefs: [at(4, 2)] Updated Intentions: [] Cycle 7: World: [] Beliefs: [at(4, 2)] Percepts: [] Intentions: [] New Intentions: [] Action: move(5, 2) scores 0 Updated World: [] Observation: at(5, 2) Updated Beliefs: [at(5, 2)] Updated Intentions: [] Cycle 8: World: [] Beliefs: [at(5, 2)] Percepts: [] Intentions: [] New Intentions: [] Action: move(6, 2) scores 0 Updated World: [] Observation: at(6, 2) Updated Beliefs: [at(6, 2)] Updated Intentions: [] Cycle 9: World: [] Beliefs: [at(6, 2)] Percepts: [] Intentions: [] New Intentions: [] Action: move(7, 2) scores 0 Updated World: [] Observation: at(7, 2) Updated Beliefs: [at(7, 2)] Updated Intentions: [] Cycle 10: World: [] Beliefs: [at(7, 2)] Percepts: [] Intentions: [] New Intentions: [] Action: move(8, 2) scores 0 Updated World: [] Observation: at(8, 2) Updated Beliefs: [at(8, 2)] Updated Intentions: [] Cycle 11: Event: junk value 5 appears at (4,4) World: [junk(4, 4, 5)] Beliefs: [at(8, 2)] Percepts: [junk(4, 4, 5)] Intentions: [[goal(4, 4, 5), []]] New Intentions: [[goal(4, 4, 5), [move(6, 2), move(5, 2), move(4, 2), move(4, 3), move(4, 4), pickup(4, 4)]]] Action: move(7, 2) scores 0 Updated World: [junk(4, 4, 5)] Observation: at(7, 2) Updated Beliefs: [at(7, 2)] Updated Intentions: [[goal(4, 4, 5), [move(6, 2), move(5, 2), move(4, 2), move(4, 3), move(4, 4), pickup(4, 4)]]] Cycle 12: World: [junk(4, 4, 5)] Beliefs: [at(7, 2)] Percepts: [junk(4, 4, 5)] Intentions: [[goal(4, 4, 5), [move(6, 2), move(5, 2), move(4, 2), move(4, 3), move(4, 4), pickup(4, 4)]]] New Intentions: [[goal(4, 4, 5), [move(5, 2), move(4, 2), move(4, 3), move(4, 4), pickup(4, 4)]]] Action: move(6, 2) scores 0 Updated World: [junk(4, 4, 5)] Observation: at(6, 2) Updated Beliefs: [at(6, 2)] Updated Intentions: [[goal(4, 4, 5), [move(5, 2), move(4, 2), move(4, 3), move(4, 4), pickup(4, 4)]]] Cycle 13: World: [junk(4, 4, 5)] Beliefs: [at(6, 2)] Percepts: [junk(4, 4, 5)] Intentions: [[goal(4, 4, 5), [move(5, 2), move(4, 2), move(4, 3), move(4, 4), pickup(4, 4)]]] New Intentions: [[goal(4, 4, 5), [move(4, 2), move(4, 3), move(4, 4), pickup(4, 4)]]] Action: move(5, 2) scores 0 Updated World: [junk(4, 4, 5)] Observation: at(5, 2) Updated Beliefs: [at(5, 2)] Updated Intentions: [[goal(4, 4, 5), [move(4, 2), move(4, 3), move(4, 4), pickup(4, 4)]]] Cycle 14: World: [junk(4, 4, 5)] Beliefs: [at(5, 2)] Percepts: [junk(4, 4, 5)] Intentions: [[goal(4, 4, 5), [move(4, 2), move(4, 3), move(4, 4), pickup(4, 4)]]] New Intentions: [[goal(4, 4, 5), [move(4, 3), move(4, 4), pickup(4, 4)]]] Action: move(4, 2) scores 0 Updated World: [junk(4, 4, 5)] Observation: at(4, 2) Updated Beliefs: [at(4, 2)] Updated Intentions: [[goal(4, 4, 5), [move(4, 3), move(4, 4), pickup(4, 4)]]] Cycle 15: Event: junk value 0 appears at (3,7) World: [junk(4, 4, 5), junk(3, 7, 0)] Beliefs: [at(4, 2)] Percepts: [junk(4, 4, 5), junk(3, 7, 0)] Intentions: [[goal(4, 4, 5), [move(4, 3), move(4, 4), pickup(4, 4)]], [goal(3, 7, 0), []]] New Intentions: [[goal(4, 4, 5), [move(4, 4), pickup(4, 4)]], [goal(3, 7, 0), []]] Action: move(4, 3) scores 0 Updated World: [junk(4, 4, 5), junk(3, 7, 0)] Observation: at(4, 3) Updated Beliefs: [at(4, 3)] Updated Intentions: [[goal(4, 4, 5), [move(4, 4), pickup(4, 4)]], [goal(3, 7, 0), []]] Cycle 16: World: [junk(4, 4, 5), junk(3, 7, 0)] Beliefs: [at(4, 3)] Percepts: [junk(4, 4, 5), junk(3, 7, 0)] Intentions: [[goal(4, 4, 5), [move(4, 4), pickup(4, 4)]], [goal(3, 7, 0), []]] New Intentions: [[goal(4, 4, 5), [pickup(4, 4)]], [goal(3, 7, 0), []]] Action: move(4, 4) scores 0 Updated World: [junk(4, 4, 5), junk(3, 7, 0)] Observation: at(4, 4) Updated Beliefs: [at(4, 4)] Updated Intentions: [[goal(4, 4, 5), [pickup(4, 4)]], [goal(3, 7, 0), []]] Cycle 17: Event: junk value 1 appears at (1,4) Event: junk value 6 appears at (0,1) World: [junk(4, 4, 5), junk(3, 7, 0), junk(1, 4, 1), junk(0, 1, 6)] Beliefs: [at(4, 4)] Percepts: [junk(4, 4, 5), junk(3, 7, 0), junk(1, 4, 1), junk(0, 1, 6)] Intentions: [[goal(4, 4, 5), [pickup(4, 4)]], [goal(1, 4, 1), []], [goal(3, 7, 0), []], [goal(0, 1, 6), []]] New Intentions: [[goal(4, 4, 5), []], [goal(1, 4, 1), []], [goal(3, 7, 0), []], [goal(0, 1, 6), []]] Action: pickup(4, 4) scores 5 Updated World: [junk(3, 7, 0), junk(1, 4, 1), junk(0, 1, 6)] Observation: cleaned(4, 4) Updated Beliefs: [at(4, 4)] Updated Intentions: [[goal(1, 4, 1), []], [goal(3, 7, 0), []], [goal(0, 1, 6), []]] Cycle 18: Event: junk value 1 appears at (1,2) World: [junk(3, 7, 0), junk(1, 4, 1), junk(0, 1, 6), junk(1, 2, 1)] Beliefs: [at(4, 4)] Percepts: [junk(3, 7, 0), junk(1, 4, 1), junk(0, 1, 6), junk(1, 2, 1)] Intentions: [[goal(1, 4, 1), []], [goal(3, 7, 0), []], [goal(1, 2, 1), []], [goal(0, 1, 6), []]] New Intentions: [[goal(1, 4, 1), [move(2, 4), move(1, 4), pickup(1, 4)]], [goal(3, 7, 0), []], [goal(1, 2, 1), []], [goal(0, 1, 6), []]] Action: move(3, 4) scores 0 Updated World: [junk(3, 7, 0), junk(1, 4, 1), junk(0, 1, 6), junk(1, 2, 1)] Observation: at(3, 4) Updated Beliefs: [at(3, 4)] Updated Intentions: [[goal(1, 4, 1), [move(2, 4), move(1, 4), pickup(1, 4)]], [goal(3, 7, 0), []], [goal(1, 2, 1), []], [goal(0, 1, 6), []]] Cycle 19: World: [junk(3, 7, 0), junk(1, 4, 1), junk(0, 1, 6), junk(1, 2, 1)] Beliefs: [at(3, 4)] Percepts: [junk(3, 7, 0), junk(1, 4, 1), junk(0, 1, 6), junk(1, 2, 1)] Intentions: [[goal(1, 4, 1), [move(2, 4), move(1, 4), pickup(1, 4)]], [goal(3, 7, 0), []], [goal(1, 2, 1), []], [goal(0, 1, 6), []]] New Intentions: [[goal(1, 4, 1), [move(1, 4), pickup(1, 4)]], [goal(3, 7, 0), []], [goal(1, 2, 1), []], [goal(0, 1, 6), []]] Action: move(2, 4) scores 0 Updated World: [junk(3, 7, 0), junk(1, 4, 1), junk(0, 1, 6), junk(1, 2, 1)] Observation: at(2, 4) Updated Beliefs: [at(2, 4)] Updated Intentions: [[goal(1, 4, 1), [move(1, 4), pickup(1, 4)]], [goal(3, 7, 0), []], [goal(1, 2, 1), []], [goal(0, 1, 6), []]] Total score: 5 true.