2017-10-11

Oct 11 In-Class Exercise.

Hi Everyone,
Post your solutions to the Oct 11 In-Class Exercise to this thread.
Best,
Chris
Hi Everyone, Post your solutions to the Oct 11 In-Class Exercise to this thread. Best, Chris

-- Oct 11 In-Class Exercise
 Knowledge base: 
 A database of explored squares (inputed into a 2d array of list objects 
 [stench, breeze, glitter, bump, scream, explored] 
 with each filled with a value, ? for unknown, x for known, and x? for posibility) 
 and partially guessed squares with flags
 
 
 Tell: If a stench, breeze, glitter, bump, scream is detected mark adjacent unexplored 
 squares with the proper flags and set unexplored to explored in current square. 
 Ask: What is currently sensed? 
(Edited: 2017-10-11)
Knowledge base: A database of explored squares (inputed into a 2d array of list objects [stench, breeze, glitter, bump, scream, explored] with each filled with a value, ? for unknown, x for known, and x? for posibility) and partially guessed squares with flags Tell: If a stench, breeze, glitter, bump, scream is detected mark adjacent unexplored squares with the proper flags and set unexplored to explored in current square. Ask: What is currently sensed?

-- Oct 11 In-Class Exercise
 1. The dungeon/kb can be represented as a dictionary, mapping a room number to percepts and whether it's been explored.
 2. Tell: Update neighboring nodes based on precepts. Each node will respond with 'X?' where 'X' is 'pit', 'wumpus', etc. if it has one neighbor with these precepts. When it has two neighboring nodes with the same precept, it will be marked as 'W!', for example.
 3. Ask: Get the status of a neighbor.
(Edited: 2017-10-11)
1. The dungeon/kb can be represented as a dictionary, mapping a room number to percepts and whether it's been explored. 2. Tell: Update neighboring nodes based on precepts. Each node will respond with 'X?' where 'X' is 'pit', 'wumpus', etc. if it has one neighbor with these precepts. When it has two neighboring nodes with the same precept, it will be marked as 'W!', for example. 3. Ask: Get the status of a neighbor.

User Icon
-- Oct 11 In-Class Exercise
  • The knowledge base can be a list of cells which contains different things including gold, wumpus and traps.
  • Tell(i, j) set the room environment with location i, j.
  • Ask(i, j) get the room environment with location i, j.
Student: Xin (Joy) Yan
(Edited: 2017-10-11)
* The knowledge base can be a list of cells which contains different things including gold, wumpus and traps. * Tell(i, j) set the room environment with location i, j. * Ask(i, j) get the room environment with location i, j. Student: Xin (Joy) Yan

-- Oct 11 In-Class Exercise
Student: Phyllis Lau
 1. Using a dictionary which maps the room coordinates [x,y] to whatever the agent is perceiving (percept)
 2. TELL: Keep adding new keys for associated adjacent location of room with associated percepts to update the knowledge base 
 3. ASK: Access percept using its corresponding location of room to answer query 
(Edited: 2017-10-11)
Student: Phyllis Lau 1. Using a dictionary which maps the room coordinates [x,y] to whatever the agent is perceiving (percept) 2. TELL: Keep adding new keys for associated adjacent location of room with associated percepts to update the knowledge base 3. ASK: Access percept using its corresponding location of room to answer query

-- Oct 11 In-Class Exercise
1. Suggest in one or two sentences how KB could be implemented as a data structure or in a database.
Ans:
We can use python dictionary to store what we know, for instance: we can store the square coordinates as the key, and store whatever we know about that square as the corresponding value. i.e. {2.1: ok, 3.1: pit…..}

2. Describe in one or two sentences how you could implement Tell.
Ans:
If the agent senses anything in the current square, we will update its neighbor squares with the sense. e.g. When we are at square 2.1 and sense breeze, we will use the dictionary to get the square coordinates and set its value as pit. i.e. {2.1: ok, 2.2: possible pit, 3.1: possible pit, ….}

3. Describe in one or two sentences how you could implement Ask.
Ans:
If we want to know a specific square information, we will use dictionary to retrieve the value by the given key. e.g. If we want to know square 2.1, we can use dict.get(2.1), then it will return the value (i.e. ok) that we want to know
(Edited: 2017-10-11)
1. Suggest in one or two sentences how KB could be implemented as a data structure or in a database. <br> Ans: <br> We can use python dictionary to store what we know, for instance: we can store the square coordinates as the key, and store whatever we know about that square as the corresponding value. i.e. {2.1: ok, 3.1: pit…..} <br><br> 2. Describe in one or two sentences how you could implement Tell. <br> Ans: <br> If the agent senses anything in the current square, we will update its neighbor squares with the sense. e.g. When we are at square 2.1 and sense breeze, we will use the dictionary to get the square coordinates and set its value as pit. i.e. {2.1: ok, 2.2: possible pit, 3.1: possible pit, ….} <br><br> 3. Describe in one or two sentences how you could implement Ask. <br> Ans: <br> If we want to know a specific square information, we will use dictionary to retrieve the value by the given key. e.g. If we want to know square 2.1, we can use dict.get(2.1), then it will return the value (i.e. ok) that we want to know <br>

-- Oct 11 In-Class Exercise
1. we could implement a 2-dimensional matrix of nodes that will represent each room. Each node has a state, possible state, and a list of percepts. 2.Tell would simply be to add percepts and state of a certain room. And update neighbors possible state 3.ask would simply return what it knows about a room. It will search up the room in the matrix and return all percepts or data in the node.
1. we could implement a 2-dimensional matrix of nodes that will represent each room. Each node has a state, possible state, and a list of percepts. 2.Tell would simply be to add percepts and state of a certain room. And update neighbors possible state 3.ask would simply return what it knows about a room. It will search up the room in the matrix and return all percepts or data in the node.

-- Oct 11 In-Class Exercise
 1) The KB could be implemented as a dictionary where each grid tile's
 coordinates would be used as keys and percepts would be used as values.
 2) Tell could be implemented by retrieving the dictionary entry that
 corresponds to the grid tile's coordinate and setting that entry's
 value to the percepts received.
 3) Ask could be implemented by retrieving the dictionary entry that
 corresponds to the requested grid tile's coordinate.
1) The KB could be implemented as a dictionary where each grid tile's coordinates would be used as keys and percepts would be used as values. 2) Tell could be implemented by retrieving the dictionary entry that corresponds to the grid tile's coordinate and setting that entry's value to the percepts received. 3) Ask could be implemented by retrieving the dictionary entry that corresponds to the requested grid tile's coordinate.

-- Oct 11 In-Class Exercise
 
 multidimensional array with the appropriate values take the database as input.
for every listed location marked with the following values of known, unknown and partially guessed..
 
 Tell: If any of the entries in the array is found mark the adjacent unvisited  squares with the proper value. 
 Ask: What location i am currently exploring
multidimensional array with the appropriate values take the database as input. for every listed location marked with the following values of known, unknown and partially guessed.. Tell: If any of the entries in the array is found mark the adjacent unvisited squares with the proper value. Ask: What location i am currently exploring

-- Oct 11 In-Class Exercise
Each square -> an object square letter: (B, G, P, S, W) square confirmed: boolean boolean visited
2-d List of squares list(i, j) = square (i,j)
2. Tell would update the adjacent squares at player's current position, square get's an updated letter, and its visited is set to true
3. if a query was for which square to take, we would look at neighbors of player's current spot, and ask(i,j) could be made to return whether to take the square, not, or unsure based on the knowledge we know about square i,j.
Each square -> an object square letter: (B, G, P, S, W) square confirmed: boolean boolean visited 2-d List of squares list(i, j) = square (i,j) 2. Tell would update the adjacent squares at player's current position, square get's an updated letter, and its visited is set to true 3. if a query was for which square to take, we would look at neighbors of player's current spot, and ask(i,j) could be made to return whether to take the square, not, or unsure based on the knowledge we know about square i,j.
[ Next ]
X