Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    simpleai 0.5.9

    Download button

    No screenshots available
    Downloads: 77  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Juan Pedro Fisanotti | More programs
    MIT/X Consortium Lic... / FREE
    September 14th, 2012, 19:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    simpleai description

    An implementation of AI algorithms based on aima-python

    simpleai is a Python module based and inspired in aima-python: https://code.google.com/p/aima-python/.

    We implement most of the searches in aima-python plus some extra options. Besides, we make some improvements in terms of code readability, installation, testing, and others.

    Installation

    Just get it:

        pip install simpleai

    Examples

    Simple AI allows you to define problems and look for the solution with different strategies. Another samples are in the *samples* directory, but here is an easy one.

    This problem tries to create the string "HELLO WORLD" using the A* algorithm:

        from simpleai.models import Problem
        from simpleai.methods import astar_search

        GOAL = 'HELLO WORLD'

        class HelloProblem(Problem):
            def actions(self, state):
                if len(state) < len(GOAL):
                    return [c for c in ' ABCDEFGHIJKLMNOPQRSTUVWXYZ']
                else:
                    return []

            def result(self, state, action):
                return state + action

            def is_goal(self, state):
                return state == GOAL

            def heuristic(self, state):
                # how far are we from the goal?
                wrong = sum([1 if state[i] != GOAL[i] else 0
                            for i in range(len(state))])
                missing = len(GOAL) - len(state)
                return wrong + missing

        problem = HelloProblem(initial_state='')
        result = astar_search(problem)

        print result
        print result.path()



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    AI algorithms | Python library | Python | AI | algorithms

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM