Displaying 2 results from an estimated 2 matches for "mutatepoint".
2010 Dec 24
0
mcga 1.1 (machine coded genetic algorithms) package released
...ilar when compared to real valued
chromosomes.
Increasing or decreasing a randomly selected byte of V3 stands for the mutation
operator. In mcga, we randomly change a byte like this:
________________________________
void GA::Mutate(Chromosome *c1){
char *cptr=(char *)c1->values;
int mutatepoint=(rand() % (this->chsize * sizeof(double)));
cptr+=mutatepoint;
if(((float)rand()/RAND_MAX)<0.5){
(*cptr)+=1;
}else{
(*cptr)-=1;
}
}
________________________________
Changing a byte of a double value can make a small or extremely high diffe...
2010 Dec 24
0
mcga 1.1 (machine coded genetic algorithms) package released
...ilar when compared to real valued
chromosomes.
Increasing or decreasing a randomly selected byte of V3 stands for the mutation
operator. In mcga, we randomly change a byte like this:
________________________________
void GA::Mutate(Chromosome *c1){
char *cptr=(char *)c1->values;
int mutatepoint=(rand() % (this->chsize * sizeof(double)));
cptr+=mutatepoint;
if(((float)rand()/RAND_MAX)<0.5){
(*cptr)+=1;
}else{
(*cptr)-=1;
}
}
________________________________
Changing a byte of a double value can make a small or extremely high diffe...