Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Python implementation of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"

License

Notifications You must be signed in to change notification settings

Ddedalus/aima-python

Open more actions menu
 
 

Repository files navigation



Based on the book Artificial Intelligence: A Modern Approach, and python repository provided.

Structure of the Project

  • main.py - main file to be run from command prompt

  • QueensEnv(ironment):

    • Table - wrapper class to hold agent, it's board and performance measure
    • Statistics Module - gathers all statistical information about current run
    • Agents - contains definitions of generator objects. Those are function-like creatures which remember their internal state and return a new value every time .send() is called. Initialisation is done with .send(None), in this case used to print agent's name. This structure is meant to represent functional nature of agent, as proposed in the book/original repo. May be changed as desired.
    • Utility Measures - implementation of utility function used by all agents so far, i.e. the number of pairs which check each other.

Encoding system and plotting

A board with 8 queens on it is encoded by their y coordinates, assuming there is exactly one queen in each column. Simple plot utility plot_board() is provided in StatsModule.py. For example, board encoded as [0,1,2,3,4,5,7,7] will render to:

![sample_board.png][./sample_board.png]

Python 3.4 and up

This code requires Python 3.4 or later, and does not run in Python 2. You can install Python or use a browser-based Python interpreter such as repl.it. You can run the code in an IDE, or from the command line with python -i filename.py where the -i option puts you in an interactive loop where you can run Python functions. See jupyter.org for instructions on setting up your own Jupyter notebook environment, or run the notebooks online with try.jupiter.org.

About

Python implementation of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 99.2%
  • Other 0.8%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.