AnimeshSinha1309 / aima-javascript

Javascript visualization (and implementation) of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"
http://aimacode.github.io/aima-javascript/
MIT License
0 stars 0 forks source link

Creating Wumpus World #1

Closed AnimeshSinha1309 closed 5 years ago

AnimeshSinha1309 commented 5 years ago

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 wumpus

Plans

This is Just for the Logic Agent Segment in Chapter 7

AnimeshSinha1309 commented 5 years ago

screenshot from 2018-12-13 18-46-58 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.

GaurangTandon commented 5 years ago

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?

AnimeshSinha1309 commented 5 years ago

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.

GaurangTandon commented 5 years ago

Thanks for the additional information, that will certainly help me build a better API. On it.

AnimeshSinha1309 commented 5 years ago

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. wumpusworld 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

GaurangTandon commented 5 years ago

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.

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.

AnimeshSinha1309 commented 5 years ago

I have implemented the full version, please take a look at the demo here. Closing out this issue.