© 2004-10 franz kurfess lab exercise reasoning csc 480: artificial intelligence wumpus world lab...

20
© 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

Post on 20-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

CSC 480: Artificial IntelligenceWumpus World Lab

CSC 480: Artificial IntelligenceWumpus World Lab

Dr. Franz J. Kurfess

Computer Science Department

Cal Poly

Page 2: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hexagonal Wumpus WorldHexagonal Wumpus World similar to the grid wumpus

world, but the underlying geometry is hexagonal

mark the status of tiles visited (V) safe (OK) possible pit (P?) confirmed pit (P!) possible wumpus (W?) confirmed wumpus (W!) percepts (SBGPC) orientation of the agent action (arrow or line)

Page 3: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Task DefinitionTask Definition add information about the stench and breeze percepts in this map by coloring

or shading the respective tiles percepts are only available for the current location the agent knows about the existence of adjacent tiles, but can’t perceive

anything about adjacent tiles use a clockwise search strategy

the agent starts from its current orientation and examines adjacent tiles in a clockwise direction

if it finds a safe, unvisited place, it proceeds there, and puts the unexamined adjacent tiles on the fringe

if there aren’t any safe unvisited ones, it continues with unexplored tiles from its fringe the fringe may be re-arranged so that adjacent tiles are explored first to minimize

movement in this online search if only risky locations are left, it takes the first one clockwise

keep track of the activities of your agent through the template below create copies of it as needed (e.g. for each step)

Page 4: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Knowledge and ReasoningKnowledge and Reasoning

accumulate knowledge your agent has about the Wumpus world current location and percept new knowledge from observation (percepts) new knowledge from reasoning

definitive locations of pits, wumpus

speculation possible locations for pit, wumpus probabilities (optional)

determine the next action

Page 5: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Alternative Mode: WW GameAlternative Mode: WW Game

if you want to make this more realistic, you can do it as a game: one person (A) sets up the environment with locations for

the wumpus and pits the other person (B), who should not know or see that

setup, traverses the Wumpus World by asking A about properties of the current tile

A responds with the percept for that location B updates its world model on the template, and decides

what the next action will be

Page 6: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW Configuration F10Hex WW Configuration F10

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

add information about the stench and breeze percepts in this map by coloring or shading the respective tiles

Page 7: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW Breeze + SmellHex WW Breeze + Smell add

information about the stench and breeze percepts in this map by coloring or shading the respective tiles

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Page 8: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW: LegendHex WW: Legend

safe location: OK

return path

possible wumpus W?

confirmed wump. W!

shoot arrow

visited location: V

possible pit P?

confirmed pit P!

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Page 9: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW: TemplateHex WW: Template

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Agent Positione.g. A

Percept[ S B G P C ]

New Knowledge observation

percepts for current square

reasoningadjacent squares ok?

speculativepossible locations for pits, wumpus

Next Action move turn left (60 degrees) turn right (60 degrees) shoot grab exit

Page 10: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW: TemplateHex WW: Template

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Agent Positione.g. A

Percept[ S B G P C ]

New Knowledge observation

percepts for current square

reasoningadjacent squares ok?

speculativepossible locations for pits, wumpus

Next Action move turn left (60 degrees) turn right (60 degrees) shoot grab exit

Page 11: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW: TemplateHex WW: Template

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Agent Positione.g. A

Percept[ S B G P C ]

New Knowledge observation

percepts for current square

reasoningadjacent squares ok?

speculativepossible locations for pits, wumpus

Next Action move turn left (60 degrees) turn right (60 degrees) shoot grab exit

Page 12: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW: TemplateHex WW: Template

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Agent Positione.g. A

Percept[ S B G P C ]

New Knowledge observation

percepts for current square

reasoningadjacent squares ok?

speculativepossible locations for pits, wumpus

Next Action move turn left (60 degrees) turn right (60 degrees) shoot grab exit

Page 13: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW: TemplateHex WW: Template

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Agent Positione.g. A

Percept[ S B G P C ]

New Knowledge observation

percepts for current square

reasoningadjacent squares ok?

speculativepossible locations for pits, wumpus

Next Action move turn left (60 degrees) turn right (60 degrees) shoot grab exit

Page 14: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW: TemplateHex WW: Template

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Agent Positione.g. A

Percept[ S B G P C ]

New Knowledge observation

percepts for current square

reasoningadjacent squares ok?

speculativepossible locations for pits, wumpus

Next Action move turn left (60 degrees) turn right (60 degrees) shoot grab exit

Page 15: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW: TemplateHex WW: Template

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Agent Positione.g. A

Percept[ S B G P C ]

New Knowledge observation

percepts for current square

reasoningadjacent squares ok?

speculativepossible locations for pits, wumpus

Next Action move turn left (60 degrees) turn right (60 degrees) shoot grab exit

Page 16: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Exploration ExampleExploration Example

The following slides illustrate the first few exploration steps of the agent.

Page 17: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW B: Exploration AHex WW B: Exploration A

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Agent Position A

Percept[ _ _ _ _ _ ]

New Knowledge observation

A safe

reasoning

B, F safe

speculative

Next Action

move

Page 18: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW B: Exploration BHex WW B: Exploration B

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Agent Position B

Percept[ _ _ _ _ _ ]

New Knowledge observation

B safe

reasoning

C, G safe

speculative

Next Action

move

Page 19: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning

Hex WW B: Exploration CHex WW B: Exploration C

A B C D E

K L M N O

U V W X Y

F G H I J

P Q R S T

Agent Position C

Percept[ _ B _ _ _ ]

New Knowledge observation

C safe

reasoning

speculative

D, H pit? Next Action

turn, (move), turn, (move), turn, turn, move

(Note: Bumps skipped)

Page 20: © 2004-10 Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly

© 2004-10 Franz Kurfess Lab Exercise Reasoning