GNU.WIKI: The GNU/Linux Knowledge Base

  [HOME] [PHP Manual] [HowTo] [ABS] [MAN1] [MAN2] [MAN3] [MAN4] [MAN5] [MAN6] [MAN7] [MAN8] [MAN9]

  [0-9] [Aa] [Bb] [Cc] [Dd] [Ee] [Ff] [Gg] [Hh] [Ii] [Jj] [Kk] [Ll] [Mm] [Nn] [Oo] [Pp] [Qq] [Rr] [Ss] [Tt] [Uu] [Vv] [Ww] [Xx] [Yy] [Zz]


NAME

       PGASetRealInitPercent  -  sets  the upper and lower bounds for randomly
       initializing real-valued genes.

DESCRIPTION

       For each gene these bounds define an interval from  which  the  initial
       allele  value  is  selected  uniformly randomly.  With this routine the
       user specifies a median value and a percent offset for each allele.

INPUT PARAMETERS

       ctx    - context variable
       median - an array containing the mean value of the interval
       percent
              - an array containing the percent offset to add and subtract  to
              the median to define the interval

OUTPUT PARAMETERS

       none

SYNOPSIS

       #include "pgapack.h"
       void  PGASetRealInitPercent(ctx, median, percent)
       PGAContext *ctx
       double *median
       double *percent

LOCATION

       real.c

EXAMPLE

       Set the initialization routines to select a value for each real-valued
       gene i uniformly randomly from the interval [i-v,i+v], where $v = i/2$.
       Assumes all strings are the same length.

       PGAContext *ctx;
       double *median, *percent;
       int i, stringlen;
       :
       stringlen = PGAGetStringLength(ctx);
       median  = (double *) malloc(stringlen*sizeof(double));
       percent = (double *) malloc(stringlen*sizeof(double));
       for(i=0;i<stringlen;i++) {
       median[i]  = (double) i;
       percent[i] = 0.5;
       }
       PGASetRealInitPercent(ctx, median, percent);

                                   05/01/95           PGASetRealInitPercent(2)



  All copyrights belong to their respective owners. Other content (c) 2014-2018, GNU.WIKI. Please report site errors to webmaster@gnu.wiki.
Page load time: 0.086 seconds. Last modified: November 04 2018 12:49:43.