aimacode / aima-python

Python implementation of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"
MIT License
7.79k stars 3.65k forks source link

Information-Gathering Agent. #555

Open tryouge opened 7 years ago

tryouge commented 7 years ago

I was going through the list of algorithms that have been implemented and found out that the Information-Gathering Agent hadn't been implemented. (Also, this is my first issue so please don't mind if my doubts are silly)

Hence, I would like to contribute by implementing this algorithm. However I have 2 doubts:

1)Which file would I have to edit to add this algorithm (I'm assuming mdp.py) but just confirming as this algorithm is prior to the introduction of MDP's.

2)Would I have to design a sample decision network or would it be sufficient just to make some sample evidences(with their values of information and costs hardcoded), and highlight which evidences would be requested by the information gathering agent.

Thanks.

antmarakis commented 7 years ago

Thank you for your interest in helping out. We welcome any questions, don't worry about it.

1) I believe the algorithm belongs to probability.py, since it is best on Decision Theory. I'm not familiar with the algorithm though, so I can't be sure. If it doesn't use a Markov model/sequence, I would put it into the probability module, otherwise it goes to mdp.

2) The purpose of the code is for students to run it on their own, possibly giving their own examples. So it would be best if you didn't hardcode values in but instead did something that could be used (more) easily by students (maybe a decision network class). Having said that, you can if you don't have the time, hardcode the values in so that others (or you) can later extend the functionality.

Hope this helped.

tryouge commented 7 years ago

Thank you for replying to my issue.

I think the essence of the information-gathering agent is to highlight the order in which the evidences are selected. I don't think implementing a decision network class would be that necessary as of now as:

The algorithm doesn't really depend much on the decision network (from an 'understanding the algorithm' point of view). A student would get an intuitive idea if he just inputs the VPI's and Costs of the evidences and the program returned the order in which the evidences would be requested.

Your comment did help and I will start working on it right away. :+1:

antmarakis commented 7 years ago

In that case go right ahead. If you have any further questions, feel free to reach out. Even though I'm not familiar with the algorithm, I will do my best to help.

nvinayvarma189 commented 6 years ago

Hey @MrDupin . I think this algorithm is not implemented yet. I want to work on this issue. I'm stuck at point on how to fit this algorithm in the probability.py module. So can you please help me out?

antmarakis commented 6 years ago

@nvinayvarma189: What is the issue you are having? I am not familiar with the algorithm, but I assume it can be created as a function in the file. There are also quite a lot of probability functions already implemented in utils and probability, so I suggest you check those any time you need to implement something new. You might find something useful this way.

nvinayvarma189 commented 6 years ago

@MrDupin Do I have to implement a separate decision network class and then implement information gathering agent as a function?

antmarakis commented 6 years ago

@nvinayvarma189 : I am afraid I don't know enough about the particular agent to give you a specific answer. I would say though that it depends. If you want to use the agent as an object (Create agent given parameters, Give input to agent, Get output) a class is more fitting. If you want to directly get the results (Run agent-function given parameters and input and return results), a function will do.

Since this project is for educational purposes, it is best to write in a way to make studying easier. I would pick the one that is more readable and makes running examples easier.

gideondr commented 5 years ago

Is it possible to show an example implementing a simple decision network ? e.g. "airport" or "umbrella"...