Giter Club home page Giter Club logo

aima-python's Introduction



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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.