Home Page Downloads Contact Us

Free Open Source Artificial Intelligence C++ Parts

aiParts Open Source Project  

Home Page
Open Source
Contact
Free Downloads
Releases and Credits
Software Status
License
v0.9.3 README File
About rrproj
assigning people and/or equipment to projects
High-Hope Technique
History of the AI
View Source Files
and how they are organized
Making Programs
Development Notes
Using aiParts
Your Application
Support and Services

README.txt file that comes with aiParts v0.9.3


aiParts README 0.9.3

Website:     http://www.aiparts.org

Everything in this file is on the website.

Release and Credit details are in: RELEASE.txt

This is Open Source software. Download it free of charge. Do whatever you want with it. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the file LICENSE.txt.

Contact: Brian Marshall at bmarshal@agt.net or +1-403-651-0584


Table of Contents
About aiParts
About rrproj
Status of the Software
Making the Sample Programs
Using aiParts
Support and Services
The High-Hope AI Technique
aiParts Source Files
The aiParts Open Source Project
Future Development Notes


About aiParts

aiParts is a set of C++ classes that can be used to develop artificial intelligence for multi-decision problems. It includes classes that implement the High-Hope technique and some sample programs.

Release and Credit details are in the RELEASE.txt file.


Using the High-Hope Classes

An application can assemble a problem from subclasses of the High-Hope classes. The High-Hope problem class has a solve() function that will search for a good solution.

The High-Hope technique is a type of machine-learning. Options have models of emotions. The software learns about the solution space by repeatedly trying to find a good solution. Emotions affect tries which affect emotions. Emotions control the balance between exploring the unknown and taking advantage of what has been learned.

The technique is an application of aiPatterns - see: http://www.agt.net/public/bmarshal/aipatterns


Applications for aiParts

aiParts can be used:
  • in applications, to make decisions or solve problems
  • as a framework for AI research and development

Two of the sample programs use the High-Hope classes. They can be used to solve a variety of problems, or as a starting point in custom development.

td width=5%">  

Examples of multi-decision problems:

  • navigating through streets, pipelines or networks
  • assigning packages to couriers
  • assigning people and equipment to projects
  • staff scheduling
  • scheduling steam-injection in a heavy-oil field
  • exploring a decision-tree too large too search

The aipPandemonium class is used as a container-class for:

  • sets, lists
  • structure in one-to-many relationships


About rrproj

rrproj is free Open Source software that assigns people and/or equipment to projects.

rrproj is a sample program in the aiParts distribution. It uses the Requirement-Resource and High-Hope classes.

Sample scripts are provided for building and testing the solver program. These scripts must be run from the directory in which they reside.

A free Open Source graphical user-interface and database are being developed using Open Office 3.

Your organization can develop an applications to use the solver, or the solver can be integrated into other software.

The make script compiles and links a program that reads and writes disk files. A better call interface is planned.


Status of the Software

aiParts is available for beta testing. The AI is still experimental.

The rrproj sample program needs much more testing.

The rrproj solver is slow. This will be improved.

Any C++ compiler should be able to compile this software.

In September 2008, aiParts 0.9.0 added many new features, and the existing code was changed in many places. See RELEASES.txt for details.

Most of the code has not changed since version 0.8.5 and it has had a fair bit of testing with the sample programs.

The rrproj sample program has had a little testing, which also tested the changes in the aiParts code.

There is much to be done to improve aiParts - see the last section of this file.


Making the Sample Programs

Sample scripts are provided for building the sample programs on Windows and Linux machines. They will generally have to be modified for the particular compiler (and possibly library) that you use.

See the files:
    mk_samples_windows.bat     mk_samples_linux.sh     mk_samples_linux2.sh

For the rrproj sample program, see these files in the rrproj subdirectory:
    mk_windows_rrproj.bat     mk_linux_rrproj.sh

On Windows, the script is written to use the Borland 5.5 C++ compiler and library. They are free, high-quality and they are run from the command line.

On Unix/Linux systems, you might want to change g++ (which is good for Fedora) to gcc or cc or CC or whatever command you use to run your compiler.


Using aiParts

There are two approaches to using aiParts...

The first approach is to:

  • Identify the most abstract layer of aiParts that is appropriate for your problem and develop a set of subclasses that specialize them for your problem.
  • Write a program that assembles a problem from your new classes and call the appropriate virtual function(s) - like: yourDecision.decide() or yourProblem.solve().
The second approach is to:
  • Identify the sample program (or other software using aiParts) that is closest to your problem, and take a copy of the source files.
  • Identify the classes that specialize the aiParts software for the particular problem and incrementally modify them to address your problem.

The second approach is easier because you learn how the aiParts software works as you go, rather than having to learn about it right from the start.


Support and Services

Suggestions for enhancements and changes are always welcome.

FAQ pages will be on the website in the future.

aiParts software is Open Source - you get the source code. Anyone you want can support it, add to it, change it or use it in other software.

Services are available by independent firms and developers. These services are not endorsed by the aiParts project.

Setup, support, analysis and development services are available by Brian Marshall, the developer of aiParts and rrproj. Contact:

bmarshal@agt.net
+1 403-651-0584 (and leave a message if necessary)


The High-Hope AI Technique

The High-Hope technique is used to find solutions to problems in which a number of decisions have to be made and each decision affects subsequent decisions.

The technique can be useful for many types of problems, including arbitrarily constrained problems that have an enormous number of possible solutions.

The technique is easy to implement in software, and easy to specialize to solve a particular type of problem. Software size and complexity grow very slowly with an increase in the number of problem constraints.

For more information, see www.aiparts.org/highhope.htm


The Technique

The High-Hope Technique...
  • Given a problem, try to solve it repeatedly (physically or by consideration) and remember the best solution(s).
  • In a try, where there is a choice of which decision to address next, choose the one that is most urgent - either because it is particularly important or it is particularly safe.
  • At each decision, pick the option with the most hope for success. The hope of an option is the sum of problem-domain-specific aspects plus strategic aspects.
  • After each try, change the relevant strategic aspects to reflect the result of the try.

The technique is chaotically sensitive to initial conditions, parameters and the sequence of random numbers used for choosing equal options. A tiny change can result in a different choice in a try, which may affect subsequent choices and tries.


Hope Combines Aspects

Hope is the result of the evaluation of all aspects being considered. Option-hope is a single quantity that can be used to compare options.

The hope associated with an option combines the results of the evaluation of...

  • static aspects ("It's good for Bill to work evenings.)"
  • dynamic aspects based on decisions made up to this point ("It would be bad for Sally to work today; she has already worked five days in a row.")
  • strategic aspects based on what has been learned in previous tries ("This option worked really well last time.")
Static and dynamic aspects are particular to the problem domain. For each aspect, you write a bit of code that evaluates the aspect and assigns a goodness value.

The strategic aspects are handled by the High-Hope classes. You create subclasses for the objects in your problem. An application assembles a problem using these subclasses.


Fear, Greed and Curiosity

In the High-Hope technique, the strategic aspects are emotions. The use of the word "emotion" and the names of the emotions are misleading because the words have multiple subtle meanings.

The strategic aspects that contribute to hope are:

Fear is the feeling that something bad may happen. Fear causes you to avoid an option that has been a problem in the past. Fear starts at Neutral and becomes more negative as an option is involved in unsuccessful tries.

Greed is the feeling that you know how to make something good happen. Greed attracts you to options that have worked well in the past. Greed starts at Neutral and becomes more positive as an option is involved in successful tries.

Curiosity is the feeling that an untried option might be good. Curiosity attracts you to options that might turn out even better than any you have already tried. Curiosity about an apparently acceptable option starts fairly high and decreases as the option is tried.

Hope = Fear + Greed + Curiosity


Hope is a Sum

A hope resolves to a goodness. Aspects that contribute to a hope resolve to a goodnesses. Aspects can be combined by adding, if goodnesses are implemented like...

  A-to-B find the shortest path using only distance information, not spatial information
rrproj assign people and/or equipment to projects or events
&sbsp VeryVeryBad = -1024
&sbsp VeryBad = -512
&sbsp QuiteBad = -256
&sbsp Bad = -64
&sbsp FairlyBad = -32
&sbsp SomewhatBad = -8
&sbsp SlightlyBad = -2
&sbsp VerySlightlyBad = -1
&sbsp Neutral = 0
&sbsp VerySlightlyGood = 1
&sbsp SlightlyGood = 2
&sbsp SomewhatGood = 3
&sbsp FairlyGood = 4
&sbsp Good = 5
&sbsp QuiteGood = 6
&sbsp VeryGood = 7
&sbsp VeryVeryGood = 8

The lack of symmetry around Neutral is a reflection of the fact that the worse an aspect is, the more important it is. There may be, for example, a variety of good aspects to setting the alarm clock an hour later, but if one of them is probably getting fired, it's probably a bad option.


aiParts Source Files

Files generally depend on the files above it in this list...

Low-Level Types, Base Class and Utility Classes:
aipTime.h   Time and date
aipGood.h   Goodness
aipBase.h   base class, messages, random numbers

Classes that implement AI Patterns:
aipPandemonium.h   Pandemonium, demons
aipEmotion.h   Emotion - Fear, Greed, Curiosity, Hope

Classes for Decision-Making and Problem-Solving:
aipDecision.h &sbsp Decisions, options
aipProblem.h &sbsp Problems

Classes that implement AI techniques:
aipHighHope.h &sbsp High-Hope problem-solving

Classes that specialize AI techniques:
aipReqRes.h &sbsp Requirement-Resource frame-work

Files for Sample Programs
samp_time.cpp   Using the date and time classes
samp_good.cpp   Using the goodness class
samp_pandemonium.cpp   Using the container class
samp_decision.cpp   Making decisions using an emotion
samp_deer_fear.h    
samp_deer_fear.cpp    
samp_a_to_b.cpp   Navigating using the High-Hope classes
samp_a2b.h    
samp_a2b.cpp    

The aiParts Open Source Project

aiParts is an Open Source project that develops software parts that implement artificial intelligence.

The software distributed by this project is copyrighted by its authors and then licensed with the MIT License and as such, it is OSI Certified Open Source Software.

See the file LICENSE.txt.

This means that you can do pretty much whatever you want with aiParts software... use it, distribute it, build it into other software, whatever.

When you get aiParts software, you get the source code. You have control of your software (regardless of what this project does in the future).

Contributions are always welcome: software, documentation, testing, suggestions, bug reports, enhancement requests, comments and criticism. See the last section of this file.

aiParts is currently focused on the High-Hope technique for multi-decision problems. Anyone is welcome to contribute software parts that implement other approaches to artificial intelligence.

For more information, contact Brian Marshall at: bmarshal@agt.net

See www.opensource.org for information on the Open Source Initiative.


Future Development Notes

Make the A-to-B sample program problem bigger and harder.

Developing new AI techniques (alternatives to the High-Hope technique)

Developing abstraction-layers for an AI technique (just as the classes in aipReqRes.h/cpp specialize the High-Hope technique for Requirement-Resource problems)

Recognize and support 'trivial' decisions to provide for:

  • better performance
  • selecting a decision and choosing an option for a resource (rather than for a requirement) and the decision can be (set to be) trivial so the pre-chosen will be chosen
aipTime.h/cpp: add seconds to class aipTimeOfDay

There is much that can be done to improve the High-Hope AI:

  • improve the choice of which decision to decide next
  • improve the behavior in the exploring stage
  • maybe add an initial feeling-out stage
  • improve the refining stage
  • analyze the output for sequences and cycles
  • improve how the AI gets out of ruts
  • further improvement of the way hope works
  • and many other ways of refining the AI

Handling Failure
Maybe: If a try fails, decisions and options later in the solution get more fear than those earlier in the solution.

Good But Different
Recognize when a good result is significantly different from other good results found.

Handling Good Improvements
After a recent try that was a good-improvement, increase the curiosity of acceptable-looking options that look like they would have a significant effect on the solution. A "good-improvement" is a try that is better than the current best-so-far try or acceptably good and significantly different than the best-so-far try.

Problem-Hope
The problem itself could have a hope which affects how option hopes are determined. The idea is that if problem-curiosity is high, the aspects that control curiosity in options would be given more weight. The same principle would apply to fear and greed. This would allow for higher curiosity (and more exploration) early in the problem-solving, and lower curiosity (and more optimization) later in the problem-solving.

Finding Best Path When on New Path
If following a new path and come to the best-so-far path, keep following the bsf path. This could be done with problem-hope; when a node in the bsf solution is chosen, drop problem-curiosity to (near) aipNeurtal.

Implement Ways
A 'way' is a set of options chosen for a set of decisions. Maybe, in a try, force some ways while exploring other ways. Ways are a very rich abstraction - they can make it possible to work on parts of a problem while keeping other parts constant. Ways may be the key to recognizing similar solutions.