Closed AnimeshSinha1309 closed 5 years ago
This is an implementation of the probability agent idea in the UC Berkeley Course. The Outer Rim (Used Here) can be used to show what the measurement was, Stinch(w), Breeze(p), Both (wp) or Safe (), and the Inner portion of the square can be used to signal our inferences. i.e. Wumpus (W), Pit (P), Both (WP), or Nothing ().
We can choose to represent these as:
The good thing about the color and rim arrangement is that it makes it easier to see that the measurements affect the square next to it. But the label and halves arrangement make it easier to read the labels and see the propositional logic.
I was thinking of the following:
Also, as you said, when I implement the grid I should have to expose some methods for you to use. Can you elaborate what would those methods be? Afaict, there are two buttons in the UCB dialog you've shown above, and also some information top-right. What do those do and are those the only API methods you would need, or are more required?
No no, We need very different API. Each Grid must be an object. And That grid object must have as one of its instance variables an array of small block objects. Each of the small block objects must provide setMeasurement(measurement)
and setInference(inference)
. Also, we must have a marker showing where we are, like the green dot in the current game and a way to move it, but that maybe later. Finally we need a Click Event Listener, onclick(function callback(x : int, y : int))
We will need to scale this as we go along. On the probability chapter, we will need to change our inferences with are W or no W, to 0.86 W form, color the background to give a feel of what the gradient is like, and maybe even make our grid bigger. So, 4 x 4 may not suffice. Let's try to be as flexible as can be, cause this model of the world spans many chapters and gives us great power, even if we don't implement those chapters.
Thanks for the additional information, that will certainly help me build a better API. On it.
This is what my SVG outline looks like. See if you can use the SVG library to improve it. The DOM thing works, and my implementation is similar, but SVG-TypeScript combo seem to give more flexibility. Having Labels inside is the goal now. Then we can start thinking of a propositional logic agent. For Documentation on the SVG Manipulation, check: SVGjs
I need to know what exactly were the flexibility issues in the previous files to be sure I won't reintroduce the same issue again.
class
syntax because of lack of support of private variables.And that's probably because I haven't played the game yet. Please give me a link to whichever implementation on the internet is closest to your thoughts and I'll play it first.
I have implemented the full version, please take a look at the demo here. Closing out this issue.
Contribution to Chapter 7 and 13
This is a visualisation of the Wumpus World needed for the Logic agent in Chapter 7 and the Probability Inferences in Chapter 13.
Current State
The Present version of this is extremely rudimentary and implemented in Chapter 7 on the Website
Plans
This is Just for the Logic Agent Segment in Chapter 7