3 #include <boost/numeric/conversion/cast.hpp>
19 unsigned int currentindex = 0;
20 unsigned int currentmaxindex = 0;
26 for (
unsigned int i = 0; i <
genesizes.size(); ++i)
30 currentmaxindex = currentindex +
genesizes(i);
31 for (
unsigned int j = currentindex; j < currentmaxindex; ++j)
34 for (
unsigned int k = j; k < currentmaxindex; ++k)
36 exponent += member(k);
38 currentvalue += -1.0 * member(j) * std::pow(-1.0, exponent) * (std::pow(
39 2.0, boost::numeric_cast<int>(j - currentindex + 1)) - 1.0);
44 ReturnValues(i) = currentvalue;
46 return (ReturnValues);
BinaryTranscibe implements transcription for standard binary populations.
ublas::vector< double > ttranscribed
GrayTranscribe(const ttranscribed &base, const ttranscribed &step, const tsizev &gene)
virtual ttranscribed GetValues(const tpopmember &member)
Re-Implements the function from BinaryTranscribe.
const ttranscribed stepsizes
The stepsize associated to a bit change for each parameter.
ublas::vector< bool > tpopmember
const tsizev genesizes
The number of bits for each parameter.
virtual ~GrayTranscribe()
ublas::vector< int > tsizev
const ttranscribed basevalues
The minimum value for each parameter.