Function PGASetCharacterAllele
Defined in File char.c
Function Documentation
-
void PGASetCharacterAllele(PGAContext *ctx, int p, int pop, int i, char val)
Sets the value of an allele in a string of the character data type.
Example
Copies the alleles from member
p
inPGA_OLDPOP
to memberq
inPGA_NEWPOP
. Assumes the strings are of the same length.PGAContext *ctx; int p, q, i; int l; ... l = PGAGetStringLength (ctx); for (i=0; i<l; i++) { char a = PGAGetCharacterAllele (ctx, p, PGA_OLDPOP, i); PGASetCharacterAllele (ctx, q, PGA_NEWPOP, i, a); }
- Parameters:
ctx – context variable
p – string index
pop – symbolic constant of the population the string is in
i – allele index
val – character value to set the allele to
- Returns:
The allele is changed by side-effect.