1 / 19

Problem solving in state spaces

Problem solving in state spaces. State representation and the problem solving agent algorithm. Problem-solving agent. environment described as state space agent actions can change one state to some others current situation is one state in space goal situation is another state

eyad
Download Presentation

Problem solving in state spaces

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Problem solvinginstate spaces State representation and the problem solving agent algorithm

  2. Problem-solving agent • environment described as state space • agent actions can change one state to some others • current situation is one state in space • goal situation is another state • problem solving agent finds sequence of actions to move from current to goal state D Goforth - COSC 4117, fall 2006

  3. Problem-solving agent - example A farmer agent traveling with a bag of grain, a fox and a duck comes to a river he must cross on the way to market. There is on the shore a boat so small that he can only take one of his market products across at a time. He cannot leave the fox alone with the duck, nor the duck with the grain. How does he get his produce safely across the river? D Goforth - COSC 4117, fall 2006

  4. What kind of problem? • fully / partly observable • deterministic / stochastic • sequential / episodic • static / dynamic • discrete / continuous • single- / multi-agent D Goforth - COSC 4117, fall 2006

  5. What kind of problem? • fully / partly observable • deterministic / stochastic • sequential / episodic • static / dynamic • discrete / continuous • single- / multi-agent D Goforth - COSC 4117, fall 2006

  6. Utility-based agent Algorithm: • Perceive state • If no plan exists, develop a plan • Act according to plan • internal state representing environment • goals expressed in terms of environment and/or agent states • performance measure rationality • NOT REFLEX; ‘tries’ actions internally and tests results against goals AND performance measure D Goforth - COSC 4117, fall 2006

  7. Utility-based agent’s view Crossing river problem state space: which bank are farmer and produce on? Possible actions: cross river alone or with one item Current state: all on left bank Goal state: all on right bank Problem: plan a sequence of crossings to get from start (left bank) to goal (right) while avoiding other terminal states. D Goforth - COSC 4117, fall 2006

  8. Internal model • State of environment – data structure • Perceptions and actions • Current state • Goal state • “Intelligence” to develop a plan • Possible form of plan: Look-up table or rules or list of actions (perception -> action) D Goforth - COSC 4117, fall 2006

  9. The simple problem solver Restricted form of general agent: Figure 3.1, p.61 function Simple-Problem-Solving-Agent( percept) returns action seq an action sequence, initially empty state some description of the current world state goal a goal, initially null problem a problem formulation state = Update-State(state, percept) if seq is empty (ie – do plan (search) first time only) goal = Formulate-Goal(state) if (state==goal) return nil problem = Formulate-Problem(state, goal) performance seq = Search(problem) action = First(seq) (no replanning) seq = Rest(seq) return action D Goforth - COSC 4117, fall 2006

  10. Problem-solving agent State space: possible locations of four objects: Agent, fox, duck, grain on left or right bank: e.g.: Agent: left fox: left duck: left grain: right State space has 24 = 16 states A f d g L L L R D Goforth - COSC 4117, fall 2006

  11. Problem-solving agent Possible actions: Agent can cross river, taking any object on same side with it. R R L R Af A f d g Ad R L R R L L L R A R L L R D Goforth - COSC 4117, fall 2006

  12. Problem-solving agent Start state: Goal state: F f d g L L L L F f d g R R R R D Goforth - COSC 4117, fall 2006

  13. Problem-solving agent Performance measure: • get to goal state • minimize number of trips • avoid losing produce Constraints: • possible actions • boat size • dangerous combinations of position D Goforth - COSC 4117, fall 2006

  14. Problem-solving agentstate-space and actions R L L L L L L L F Fg Fd Ff R R L L R L R L R L L R F F F L R L L L L R L L L L R Fg Ff Fd Fd Ff Fg R R R L R R L R R L R R F F F L R R L L R L R L L R R Ff Fd Fg R R R R L R R R F

  15. Problem-solving agent (formulate problem)STATES TO AVOID R L L L L L L L R R L L R L R L R L L R L R L L L L R L L L L R R R R L R R L R R L R R L R R L L R L R L L R R R R R R L R R R

  16. R L L L L L L L R R L L R L R L R L L R R R R L L R L L L L R L L L L R Ff R R R L R R L R R L R R 3 L R R L L R L R L L R R R R R R L R R R Problem-solving agent – example Node in search space L L R L F 2 D Goforth - COSC 4117, fall 2006

  17. R L L L L L L L R R L L R L R L R L L R R R R L L R L L L L R L L L L R Ff R R R L R R L R R L R R 3 L R R L L R L R L L R R R R R R L R R R Problem-solving agent – example A solution sequence: Fd F Ff Fd Fg F Fd D Goforth - COSC 4117, fall 2006

  18. The simple problem solver Restricted form of general agent: Figure 3.1, p.61 function Simple-Problem-Solving-Agent( percept) returns action seq an action sequence, initially empty state some description of the current world state goal a goal, initially null problem a problem formulation state = Update-State(state, percept) if seq is empty (ie – do plan (search) first time only) goal = Formulate-Goal(state) if (state==goal) return nil problem = Formulate-Problem(state, goal) performance seq = Search(problem) action = First(seq) seq = Rest(seq) return action Fd F Ff Fd Fg F Fd D Goforth - COSC 4117, fall 2006

  19. General search algorithms Review breadth-first and depth-first traversals in graphs D Goforth - COSC 4117, fall 2006

More Related