break; default: return FALSE; } return TRUE; } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR IpCmdLine, int nCmdShow) { return DialogBox(hInstance, MAKEINTRESOURCE(IDDMAIN), NULL, DlgProc); } ///////////////////////////LIST OF FUNCTIONS////////////// I This is the objective function. All it does is check for alternating Os and // Is. If the gene is odd and contains a 1, the fitness is incremented by 1. // If the gene is even and contains a 0, the fitness is incremented by 1. No // penalties are assigned. // We have to do the cast because a plain, generic GAGenome doesn't have // the members that a GA2DBinaryStringGenome has. And it's ok to cast it // because we know that we will only get GA2DBinaryStringGenomes and // nothing else. float Objective(GAGenome& g) { GA2DBinaryStringGenome & genome = (GA2DBinaryStringGenome &)g; float score=0.0; int count=0; int m, n ; int robot[20][2]; //Zero the robot 2d array for(m=0; m<20; m++) { for(n=0; n<2; n++)