Small modifications here and there to be MSVC++ compatible

Mainly, time.h -> ctime
        definition of loop index out of loops when multiply used
        no typename in declaration using template typename
This commit is contained in:
evomarc 2001-11-10 09:02:17 +00:00
commit d7c3d973c7
14 changed files with 56 additions and 27 deletions

View file

@ -1,7 +1,7 @@
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
//-----------------------------------------------------------------------------
// eoPBILDistrib.h
// eoPBILAdditive.h
// (c) Marc Schoenauer, Maarten Keijzer, 2001
/*
This library is free software; you can redistribute it and/or

View file

@ -61,9 +61,6 @@ public:
_eo.invalidate(); // DO NOT FORGET!!!
}
/** update method - still PURE VIRTUAL */
// virtual void update(eoPop<EOT>&) = 0; // update from a population
/** Accessor to the genome size */
unsigned Size() {return genomeSize;}

View file

@ -1,7 +1,7 @@
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
//-----------------------------------------------------------------------------
// eoPBILDistrib.h
// eoPBILOrg.h
// (c) Marc Schoenauer, Maarten Keijzer, 2001
/*
This library is free software; you can redistribute it and/or
@ -31,7 +31,7 @@
/**
* Distribution Class for PBIL algorithm
* (Population-Based Incremental Learning, Baluja and Caruana 96)
* (Population-Based Incremental Learning, Baluja and Caruana 95)
*
* This class implements the update rule from the original paper:
*

View file

@ -53,10 +53,22 @@ eoPBILDistrib<EOT> & do_make_PBILdistrib(eoParser & _parser, eoState& _state, E
if (seedParam.value() == 0)
seedParam.value() = time(0);
// the representation dependent stuff
unsigned chromSize = _parser.createParam(unsigned(10), "chromSize", "The length of the bitstrings", 'n',"Algorithm").value();
eoPBILDistrib<EOT> * ptDistrib = new eoPBILDistrib<EOT>(chromSize);
// chromosome size:
unsigned theSize;
// but it might have been already read in the definition fo the performance
eoParam* ptParam = _parser.getParamWithLongName(string("chromSize"));
if (!ptParam) // not already defined: read it here
{
theSize = _parser.createParam(unsigned(10), "chromSize", "The length of the bitstrings", 'n',"Problem").value();
}
else // it was read before, get its value
{
eoValueParam<unsigned>* ptChromSize = dynamic_cast<eoValueParam<unsigned>*>(ptParam);
theSize = ptChromSize->value();
}
eoPBILDistrib<EOT> * ptDistrib = new eoPBILDistrib<EOT>(theSize);
_state.storeFunctor(ptDistrib);
// now the initialization: read a previously saved distribution, or random

View file

@ -63,11 +63,11 @@ eoInit<EOT> & do_make_genotype(eoParser& _parser, eoState& _state, EOT)
// for bitstring, only thing needed is the size
unsigned theSize;
// but it might have been already read in the definition fo the performance
eoParam* ptParam = _parser.getParamWithLongName(string("ChromSize"));
eoParam* ptParam = _parser.getParamWithLongName(string("chromSize"));
if (!ptParam) // not already defined: read it here
{
theSize = _parser.createParam(unsigned(10), "ChromSize", "The length of the bitstrings", 'n',"Problem").value();
theSize = _parser.createParam(unsigned(10), "chromSize", "The length of the bitstrings", 'n',"Problem").value();
}
else // it was read before, get its value
{