COSC_4P82_Assignment_1/lib/beagle-3.0.3/tests/Common/InitializationStringOp.cpp

18 lines
477 B
C++
Raw Normal View History

2024-02-13 21:21:51 -05:00
#include "Test.hpp"
#include <sstream>
using namespace Beagle;
using namespace Test;
using namespace std;
void
InitializationStringOp::initIndividual(Individual& outIndividual, Context& ioContext)
{
std::ostringstream lOSS;
lOSS << "Individual#" << ioContext.getDemeIndex() << "-" << ioContext.getIndividualIndex();
outIndividual.resize(1);
GenotypeString& lGenotype = castObjectT<GenotypeString&>(*(outIndividual[0]));
lGenotype.setData( lOSS.str().c_str() );
}