gpcpp4
所属分类:人工智能/神经网络/深度学习
开发工具:C++
文件大小:78KB
下载次数:92
上传日期:2005-11-19 16:25:18
上 传 者:
zjw4034
说明: genetic programming in C++
Adam Fraser
University Of Salford, Salford, M5 4WT,
United Kingdom
(genetic programming in C++ Adam Fraser University Of Salford, Salford, M5 4WT, United Kingdom)
文件列表:
gpcpp4\GPCPP4\ADVERT.TXT (2524, 1994-06-14)
gpcpp4\GPCPP4\ALLELEM.CC (4385, 1994-06-14)
gpcpp4\GPCPP4\ANT\ANT.CC (6775, 1994-06-14)
gpcpp4\GPCPP4\ANT\ANT.HPP (1337, 1994-06-14)
gpcpp4\GPCPP4\ANT\ANT.INI (181, 1994-06-14)
gpcpp4\GPCPP4\ANT\GPANT.CC (4430, 1994-06-14)
gpcpp4\GPCPP4\ANT\SANTAFE.TRL (1243, 1994-06-12)
gpcpp4\GPCPP4\ANT\TRAIL.CC (2262, 1994-06-14)
gpcpp4\GPCPP4\ANT\TRAIL.HPP (938, 1994-06-14)
gpcpp4\GPCPP4\ANT (0, 1994-06-12)
gpcpp4\GPCPP4\COMPARE.CC (3536, 1994-06-14)
gpcpp4\GPCPP4\CREATE.CC (7750, 1994-06-14)
gpcpp4\GPCPP4\CROSS.CC (3179, 1994-06-14)
gpcpp4\GPCPP4\DEME.CC (7107, 1994-06-14)
gpcpp4\GPCPP4\EVAL.CC (2263, 1994-06-14)
gpcpp4\GPCPP4\EXIT.CC (1069, 1994-06-14)
gpcpp4\GPCPP4\FUNCTION.CC (5430, 1994-06-14)
gpcpp4\GPCPP4\FUNCTION.HPP (2523, 1994-06-14)
gpcpp4\GPCPP4\GENE.CC (7556, 1994-06-14)
gpcpp4\GPCPP4\GENE.HPP (3390, 1994-06-14)
gpcpp4\GPCPP4\GENERATE.CC (4097, 1994-06-14)
gpcpp4\GPCPP4\GP.CC (6017, 1994-06-14)
gpcpp4\GPCPP4\GP.DEF (280, 1994-05-23)
gpcpp4\GPCPP4\GP.DSK (3122, 1994-06-12)
gpcpp4\GPCPP4\GP.HPP (3553, 1994-06-14)
gpcpp4\GPCPP4\GP.PRJ (9286, 1994-06-12)
gpcpp4\GPCPP4\GPMAIN.CC (2354, 1994-06-14)
gpcpp4\GPCPP4\GPMAIN.HPP (909, 1994-06-14)
gpcpp4\GPCPP4\GPRAND.CC (2860, 1994-06-14)
gpcpp4\GPCPP4\GPRAND.HPP (922, 1994-06-14)
gpcpp4\GPCPP4\GPV.CC (5152, 1994-06-14)
gpcpp4\GPCPP4\GPV.HPP (1214, 1994-06-14)
gpcpp4\GPCPP4\LAWN\GPLAWN.CC (9423, 1994-06-14)
gpcpp4\GPCPP4\LAWN\LAWN.CC (1436, 1994-06-14)
gpcpp4\GPCPP4\LAWN\LAWN.HPP (908, 1994-06-14)
gpcpp4\GPCPP4\LAWN\LAWN.INI (188, 1994-06-14)
gpcpp4\GPCPP4\LAWN\MOWER.CC (3579, 1994-06-14)
gpcpp4\GPCPP4\LAWN\MOWER.HPP (1293, 1994-06-14)
... ...
Genetic Programming in C++ (Version 0.40)
Copyright Adam P. Fraser, 1993,1994
This code is released for non-commercial use only.
For comments, improvements (or even money !?) contact:
Adam Fraser,
Postgraduate Section,
Dept of Elec & Elec Eng,
Maxwell Building,
University Of Salford,
Salford,
M5 4WT,
United Kingdom.
Internet: a.fraser@eee.salford.ac.uk
Tel: (UK) 061 745 5000 x3633
Fax: (UK) 061 745 5999
---------------------------------------------------------
Uncompressing the archive file should have created a
number of directories (using pkunzip -d in DOS, for
instance)
This release should contain the files
Source code:
function.cc, function.hpp terminal.cc, terminal.hpp
gene.cc, gene.hpp gp.cc, gp.hpp, gpv.cc, gpv.hpp,
pop.cc,pop.hpp, allelem.cc, gprand.cc, gprand.hpp,
create.cc, compare.cc, eval.cc, exit.cc, generate.cc,
cross.cc, gpmain.cc, rungps.cc, select.cc, loadsave.cc,
tourn.cc, deme.cc. probable.cc, symbreg.cc
ant directory: ant.cc, ant.hpp, gpant.cc, trail.hpp,
trail.cc, ant.ini
lawn directory: gplawn.cc lawn.hpp, lawn.cc, mower.cc,
mower.hpp, lawn.ini
symbreg directory: symbreg.cc , symbreg2.cc, symbreg.ini
Documentation: Readme.gp (this file),
advert.txt (an advert style of document telling you what
this package can do, I am not trying to sell you anything)
---------------------
Compile-and-go
---------------------
With most genetic programming systems the documentation
is the last thought (apart from John Koza's 'Genetic
Programming' book, of course, which many would consider
overkill on a documentation front). Here then is the
compile and go painless method of getting gpc++ up and
evolving something.
The files: function.cc, terminal.cc, gene.cc, gp.cc,
gpv.cc, pop.cc, allelem.cc create.cc, compare.cc,
eval.cc, exit.cc, generate.cc, cross.cc, gpmain.cc,
rungps.cc, select.cc, loadsave.cc and tourn.cc must all
be compiled together in the same directory. These
components make up the basic kernel of gpc++, the last
and most important component of which is the problem to
be evolved. For this example you will find enclosed in
the package a symbolic regression problem found in Koza
GP I called symbreg.cc. If you are using the MS-DOS
version you will find a file called gp.prj and gp.dsk
(for Borland C/C++) this includes all the information for
compiling and linking the system. [Also DOS users see DOS
bit at the end of this document.]
Windows Borland C/C++ users will also find a gp.def
which defines the memory model of the system and further
parameters, this must also be included. The conversion
between DOS and Windows project files should be
automatic.
If you are using GNU C/C++ in UNIX you will find a
makefile within the package with the correct modules to
be called.
If neither option is being used then simply include
the file symbreg.cc
into the above list using whatever method you choose. If
on compilation this block of code you recieve any errors
check all the files have been included and that the
correct directories are being searched for the appropiate
standard header files in the compiler. If it still will
not work please mail the author who would also like to
hear about successful compilation on Windows NT and
PowerMACs.
The second step is to alter the gp.ini file included in
the package. Once gpc++ starts to run it reads in the
values from this file and sets the respective variables
within genetic programming system. The gp.ini file for
the symbolic regression problem is called symbreg.ini,
just rename this file. If for some reason this file
cannot be found it can be created by running gpc++
without any gp.ini files in the directory in which you
run the program. This will cause a default gp.ini to be
produced, change this with a standard text editor. In
the case of the symbolic regression this file should
read.
// gp.ini for the symbolic regression problem <--- this
line is not important
CreationType : 0
Evaluations : 1
MaxFitness : 1000
MaxCreation : 6
MaxCrossover : 17
ADFs : 0
Mutation : 0
While altering the values make sure that the names of the
variables and their position within the gp.ini file (the
colons are an important component of the system) are not
altered. Again, a further explanation of this file and
its attributes will be made later in the document.
Once you have compiled the code above you are ready to
go. Gpc++ is run from the command line with the
population size, number of generations and output file
needed by the system. If you wish to produce a run with
a population of 100 and the number of generations equal
to 50 with all the results going into gp.dat the command
is:
gp 100 50 gp
There are two output files produced the file gp.dat
contains the English version of the outputted program
while gpb.dat contains the structure which the gpc++
system can understand. When choosing a file name for
output files in DOS only seven letters can be used as the
system adds a further 'b' to the file name.
The problem you have just tried to evolve is a mathematical
function which produces a graph similar (nay identical) to
X**4 + X**3 + X**2 + X described in Koza's book. For more
information either see the source code or see the 'and
there is more...' section near the end.
For the other problems in the package ( Artificial Ant
and the LawnMower Problem) copy all files into the main
directory and include the *.cc files instead of
symbreg.cc alter the ini file to the correct values. (
AA: Evals = 600, Max Fitness = 91 ...... LP: Evals =
100, MaxFitness = *** ).
--------------------
and there is more...
--------------------
This is just a little document explaining how to get
things going. The full documentation is a postscript file
which you can get from ftp.cc.utexas.edu in
/pub/genetic/programming/papers as gpc****.ps depending
on your computer OS.
---------------------
Adding chunks of code
---------------------
This system is intended as a basic kernel to drape your
ideas of how to do GP onto. As you may have noticed it
is the work of one man, who is feeling his age (23) and
wants a lie down. If you add a component, write a new
problem or just have a feeling of goodwill towards me
then please send a message and I will reply with warmth,
compassion and citations. I thank you -- apf 15 June 1994
-----------------------------
Useless DOS memory allocation
-----------------------------
gpc++ is memory hungry and is designed nowadays for
machines which can access their memory. The DOS os is
a pain for this and I did not want to reduce the portability
of my code. If you try and use over ***0k of memory ( that
includes the program and whatever other garbage you have )
the system will not crash but quietly complain and halt. To
get over this you can;
a) Use UNIX.
b) Use Windows.
c) Give up and use small populations.
If you are not keen on any of these options you could buy
the Watcom C/C++ compiler which produces the 32-bit code to
counter DOS's inadequacies. If you are poor, like me, but
have internet access you may wish to look at djgpp the DOS
port of the GNU compiler. It can be found in the wsmr.simtel.
navy.mil archive or a good mirror of this site. It isn't the
most documented of systems and also doesn't have a nice front
end but it does work which is always nice. Just thought you
would like to know.
-------------------------------------
Disclaimer (for my own piece of mind)
-------------------------------------
Disclaimer: This software is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
-----------------------
... if any one has got to here and is still reading you may
be interested in knowing that I am going for a bit of a rest..
apf 94 - a man in shades
_______________________________
近期下载者:
相关文件:
收藏者: