In eoVector, changed printOn and readFrom to virtual
This commit is contained in:
parent
195ad72838
commit
d634d95838
10 changed files with 54 additions and 52 deletions
|
|
@ -250,7 +250,6 @@ class eoPop: public vector<EOT>, public eoObject, public eoPersistent
|
|||
* Read object. The EOT class must have a ctor from a stream;
|
||||
in this case, a strstream is used.
|
||||
* @param _is A istream.
|
||||
|
||||
*/
|
||||
virtual void readFrom(istream& _is)
|
||||
{
|
||||
|
|
@ -259,8 +258,7 @@ class eoPop: public vector<EOT>, public eoObject, public eoPersistent
|
|||
|
||||
resize(sz);
|
||||
|
||||
for (size_t i = 0; i < sz; ++i)
|
||||
{
|
||||
for (size_t i = 0; i < sz; ++i) {
|
||||
operator[](i).readFrom( _is );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
Marc.Schoenauer@polytechnique.fr
|
||||
mak@dhi.dk
|
||||
|
||||
CVS Info: $Date: 2001-03-21 12:10:13 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/src/eoVector.h,v 1.9 2001-03-21 12:10:13 jmerelo Exp $ $Author: jmerelo $
|
||||
CVS Info: $Date: 2001-04-03 10:08:06 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/src/eoVector.h,v 1.10 2001-04-03 10:08:06 jmerelo Exp $ $Author: jmerelo $
|
||||
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -74,7 +74,7 @@ class eoVector : public EO<FitT>, public std::vector<GeneType>
|
|||
}
|
||||
|
||||
/// printing...
|
||||
void printOn(ostream& os) const
|
||||
virtual void printOn(ostream& os) const
|
||||
{
|
||||
EO<FitT>::printOn(os);
|
||||
os << ' ';
|
||||
|
|
@ -85,7 +85,7 @@ class eoVector : public EO<FitT>, public std::vector<GeneType>
|
|||
}
|
||||
|
||||
/// reading...
|
||||
void readFrom(istream& is)
|
||||
virtual void readFrom(istream& is)
|
||||
{
|
||||
EO<FitT>::readFrom(is);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@
|
|||
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
|
||||
Marc.Schoenauer@polytechnique.fr
|
||||
mkeijzer@dhi.dk
|
||||
CVS Info: $Date: 2001-04-03 10:08:07 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/src/utils/eoFileMonitor.h,v 1.9 2001-04-03 10:08:07 jmerelo Exp $ $Author: jmerelo $
|
||||
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Modified the default behavior, so that it erases existing files.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// eoParam.h
|
||||
// eoMonitor.h
|
||||
// (c) Marc Schoenauer, Maarten Keijzer and GeNeura Team, 2000
|
||||
/*
|
||||
This library is free software; you can redistribute it and/or
|
||||
|
|
@ -21,6 +21,8 @@
|
|||
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
|
||||
Marc.Schoenauer@polytechnique.fr
|
||||
mak@dhi.dk
|
||||
CVS Info: $Date: 2001-04-03 10:08:07 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/src/utils/eoMonitor.h,v 1.9 2001-04-03 10:08:07 jmerelo Exp $ $Author: jmerelo $
|
||||
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// eoFileMonitor.h
|
||||
// eoStdoutMonitor.h
|
||||
// (c) Marc Schoenauer, Maarten Keijzer and GeNeura Team, 2000
|
||||
/*
|
||||
This library is free software; you can redistribute it and/or
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ void main_function(int argc, char **argv)
|
|||
// all parameters are hard-coded!
|
||||
const unsigned int SEED = 42; // seed for random number generator
|
||||
const unsigned int T_SIZE = 3; // size for tournament selection
|
||||
const unsigned int VEC_SIZE = 8; // Number of bits in genotypes
|
||||
const unsigned int POP_SIZE = 20; // Size of population
|
||||
const unsigned int MAX_GEN = 100; // Maximum number of generation before STOP
|
||||
const unsigned int VEC_SIZE = 16; // Number of bits in genotypes
|
||||
const unsigned int POP_SIZE = 100; // Size of population
|
||||
const unsigned int MAX_GEN = 400; // Maximum number of generation before STOP
|
||||
const float CROSS_RATE = 0.8; // Crossover rate
|
||||
const double P_MUT_PER_BIT = 0.01; // probability of bit-flip mutation
|
||||
const float MUT_RATE = 1.0; // mutation rate
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
.cpp: ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" -I. -I../../src -Wall -g -o $@ $*.cpp ../../src/libeo.a ../../src/utils/libeoutils.a
|
||||
.cpp: ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" -I. -I../../src -Wall -g -pg -o $@ $*.cpp ../../src/libeo.a ../../src/utils/libeoutils.a
|
||||
|
||||
.cpp.o: ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" -I. -I../../src -Wall -g -c $*.cpp
|
||||
.cpp.o: ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" -I. -I../../src -Wall -g -c -pg $*.cpp
|
||||
|
||||
firstGA = FirstRealGA FirstBitGA
|
||||
|
||||
|
|
|
|||
Reference in a new issue