Can anyone help to make this code run ,it is working upto create_binary and fitness. i need to link the chrom::selection with other ie i need to select a binary string based on the fitness calculated in chrom::fitness. psedo code for selection was written here,the output required is a new binary string with more fitness.
class chrom
{
private:
unsigned first;
unsigned second;
unsigned third;
fitness=(x*x)+(y*z)-(y*y);
cout << "Fitness of Chromesomes are ";
cout<<fitness<<"\n";
}
void chrom::selection()
{
int team_A,team_B,team_C,team_D;
int winner_e,winner_f;
int fitness;
unsigned int iseed;
iseed=time(NULL);
srand(iseed);
team_A=(int)(100.0*rand()/RAND_MAX+1);
team_B=(int)(100.0*rand()/RAND_MAX+1);
cout<<"Team A is = "<<team_A<< "\n";
cout<<"Team B is = "<<team_B<< "\n";
cout<<"The winner of first group: "<<winner_e<<"\n";
team_C=(int)(100.0*rand()/RAND_MAX+1);
team_D=(int)(100.0*rand()/RAND_MAX+1);
cout<<"Team C is = "<<team_C<< "\n";
cout<<"Team D is = "<<team_D<< "\n";