Logo Search packages:      
Sourcecode: tablix2 version File versions  Download package

void population_rand ( population pop  ) 

Randomize the entire population.

All variable chromosomes in the population are filled with random values (domains of individual tuples, as specified in dat_tuplemap are respected)

Parameters:
pop Pointer to the population to be randomized.

Definition at line 1362 of file data.c.

References table_t::chr, tupleinfo_t::dom, domain_rand(), table_t::fitness, chromo_t::gen, chromo_t::gennum, chromo_t::restype, population_t::size, population_t::tables, table_t::typenum, and resourcetype_t::var.

{
      int n,m,o;
      table *tab;
      domain *dom;

      assert(pop!=NULL);

      for(n=0;n<pop->size;n++) {
            tab=pop->tables[n];
            for(m=0;m<tab->typenum;m++) if(tab->chr[m].restype->var) {
                  for(o=0;o<tab->chr[m].gennum;o++) {
                        dom=dat_tuplemap[o].dom[m];
                        tab->chr[m].gen[o]=domain_rand(dom);
                  }
            }
            tab->fitness=-1;
      }
}


Generated by  Doxygen 1.6.0   Back to index