⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.gp

📁 genetic programming in C++ Adam Fraser University Of Salford, Salford, M5 4WT, United Kingdom
💻 GP
字号:
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 = 64 ).

--------------------
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 640k 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
_______________________________

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -