#ifndef lint static char *rcsid = "$Header: /tmp_mnt/vida/disks/disk5/Users/terry/r/gassy/RCS/survivors.c,v 1.2 1992/10/09 06:43:50 terry Exp terry $"; #endif #include "types.h" #include "utility.h" VOID * random_survivors(selections, nsurvivors, context) INT *selections; INT nsurvivors; CONTEXT *context; { register INT i; register INT pop_size = context->population_size; for (i = 0; i < nsurvivors; i++){ selections[i] = uniform(pop_size); } return 0; } VOID * best_survivors(selections, nsurvivors, context) INT *selections; INT nsurvivors; CONTEXT *context; { register INT i; sort_population(BY_FITNESS, context); for (i = 0; i < nsurvivors; i++){ selections[i] = i; } return 0; }