Artificial Intelligence: Expert Systems
with CLIPS and Free Software
LIU/Brooklyn Artificial Intelligence
Full Overview - how is the weather and can we make a few bucks.
With a basic understanding, we can now look at the full code. There are a few things
that the novice CLIPS programmer (such as myself) needs to understand.
At its heart and soul, CLIPS is a huge regular expression engine. In many regards, using it
reminds me Unix power tools like GAWK and even Perl. The top of every rule, CLIPS defrules
has a pattern that has to be matched according to a specific set of, not nearly obvious, rules.
On the other hand, CLIP leans heavily on the functional language paradigm. I think that the
authors of CLIP view its shell like many LISP coders view EMACS, but EMACS is a better editor.
Getting started with CLIPS is easy. Learning it well, that can take a long time. It is a
fickle programming language and having a good programming text editor is vital to spotting the
inevitable lost parenthesis.
Good programming languages shape the way that you thing. CLIPS does this. After knocking your
head around with it for a while, you begin to see its roots in the Artificial Intelligence area.
Standard textbooks become easier to read and understand. And new possible solutions to problems arise
as you develop a sense of what it does.
Every TIME you assert a fact into a scope, the entire scope is reevaluated in full. You
can't say this enough.
Every TIME you assert a fact into a scope, the entire scope is reevaluated in full. You
can't say this enough.
Every TIME you assert a fact into a scope, the entire scope is reevaluated in full. You
can't say this enough.
Every TIME you assert a fact into a scope, the entire scope is reevaluated in full. You
can't say this enough. Learning CLIPS means learning how its engine works.
CLIPS has the ability to create modules that allow for results to be passed from one scope
to another. I leveraged this ability. Without that ability, I would have fallen back on
procedural programming techniques that for the purposes of this project, was not my goal. We have
four modules: FISH, WEATHER, TRIP, and REPORT
Source Code Links:
fish2.clp : The main program that loads everything else and runs. You can run it in GNU/Linux with the command
clips -f2 ./fish2.dat
The fishing program uses a scoring system to evaluate which would be the best trip
to take on a given day under a give set of weather conditions. Each species has a
point assigned from 1-5 of desirability. If a trip can target more than one species,
good! Then the scores for each species is added up. The best trip is notated and all
alternatives are also listed.
The program is built with expansion in mind, so those extra facts you see are not useless. They
just represent features not implemented.
Bonus seasons are implemented. So striped bass get a bump during the likely times of the fall
and spring runs. the code works, but I would like to make it work a little better.
Areas of expansion would include a module for bonus points for hot news. We should have bonus points
for point good reports on the internet which will drive sales. One might add daily results and crew
reports to make bonus points for different captains. Not all captains are the same. GIS and mapping
information, which is currently built into postgres, is also possible with some work. We can also
include a section for bait, what are the fish biting today? Weather can be expaned. Porgies don't
bite when it rains more than 4 inches. Tautog don't bite until water temperature drops below 56 F.
So this topic can include a lot more work.