t-eoAtomOps.cpp

00001 /* -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
00002 
00003     t-eoAtomOps.cpp
00004       Program that tests the atomic operator classes
00005 
00006     (c) GeNeura Team, 1999 
00007  
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  
00022     Contact: todos@geneura.ugr.es, http://geneura.ugr.es
00023             
00024 */
00025 
00026 //-----------------------------------------------------------------------------// 
00027 
00028 #ifdef _MSC_VER
00029 #pragma warning(disable:4786)
00030 #endif 
00031 
00032 #include <string>
00033 #include <iostream>
00034 #include <iterator>
00035 
00036 using namespace std;
00037 
00038 // Operators we are going to test
00039 #include <eoAtomCreep.h>
00040 #include <eoAtomBitFlip.h>
00041 #include <eoAtomRandom.h>
00042 #include <eoAtomMutation.h>
00043 
00044 // Several EOs
00045 #include <other/eoString.h>
00046 
00047 // RNGs
00048 #include <eoNegExp.h>
00049 
00050 main(int argc, char *argv[]) {
00051   eoString<float> aString("123456");
00052   eoAtomCreep<char> creeper;
00053   eoAtomMutation< eoString<float> > mutator( creeper, 0.5 );
00054 
00055   eoNegExp<char> charNE( 2 );
00056   eoAtomRandom<char> randomer( charNE );
00057   eoAtomMutation<  eoString<float> > mutator2 ( randomer, 0.5 );
00058 
00059   std::cout << "Before aString " << aString << std::endl;
00060   mutator( aString);
00061   std::cout << " after mutator " << aString << std::endl;
00062   mutator2( aString);
00063   std::cout << " after mutator2 " << aString << std::endl;;
00064   return 0; // to avoid VC++ complaints
00065 }
00066 

Generated on Thu Oct 19 05:06:43 2006 for EO by  doxygen 1.3.9.1