c******************************************************************************
c     FILE: pgapackf.h
c
c     Authors: David M. Levine, Philip L. Hallstrom, David M. Noelle
c*****************************************************************************/
c *** I/O FLAGS
CBARF !! is NULL ok?
      integer STDIN, STDOUT, STDERR, NULL
      parameter(STDIN=5, STDOUT=6, STDERR=6, NULL=0)


c *** ABSTRACT DATA TYPES
      integer PGA_DATATYPE_BINARY
      parameter( PGA_DATATYPE_BINARY =      1)
      integer PGA_DATATYPE_INTEGER
      parameter( PGA_DATATYPE_INTEGER =     2)
      integer PGA_DATATYPE_REAL
      parameter( PGA_DATATYPE_REAL =        3)
      integer PGA_DATATYPE_USER
      parameter( PGA_DATATYPE_USER =        4)

      integer PGA_INT
      parameter( PGA_INT =                   1)
      integer PGA_DOUBLE
      parameter( PGA_DOUBLE =                2)
      integer PGA_CHAR
      parameter( PGA_CHAR =                  3)
      integer PGA_VOID
      parameter( PGA_VOID =                  4)

    
c *** BOOLEANS &  FLAGS
      integer PGATRUE
      parameter ( PGATRUE =                   1)
      integer PGAFALSE
      parameter ( PGAFALSE =                  0)
      integer PGAERROR
      parameter ( PGAERROR =                 -1)

      integer PGA_FATAL
      parameter ( PGA_FATAL =                 1)
      integer PGA_WARNING
      parameter ( PGA_WARNING =               2)


      integer PGA_UNINITIALIZED_INT
      parameter ( PGA_UNINITIALIZED_INT =    -3827)
      double precision PGA_UNINITIALIZED_DOUBLE
      parameter ( PGA_UNINITIALIZED_DOUBLE = -968.3827)

c *** TEMP & POP REFERENT CONSTANTS
      integer PGA_TEMP1
      parameter ( PGA_TEMP1 =                -1138)
      integer PGA_TEMP2
      parameter ( PGA_TEMP2 =                -4239)

      integer PGA_OLDPOP
      parameter ( PGA_OLDPOP =               -6728)
      integer PGA_NEWPOP
      parameter ( PGA_NEWPOP =               -8376)

c *** DEBUG LEVELS
      integer PGADEBUG_ENTERED
      parameter ( PGADEBUG_ENTERED =          11)
      integer PGADEBUG_EXIT
      parameter ( PGADEBUG_EXIT =             12)
      integer PGADEBUG_MALLOC
      parameter ( PGADEBUG_MALLOC =           24)
      integer PGADEBUG_PRINTVAR
      parameter ( PGADEBUG_PRINTVAR =         20)
      integer PGADEBUG_ENTEREDHIGH
      parameter ( PGADEBUG_ENTEREDHIGH =      31)
      integer PGADEBUG_EXITHIGH
      parameter ( PGADEBUG_EXITHIGH =         32)

c *** DIRECTION
      integer PGA_MAXIMIZE
      parameter ( PGA_MAXIMIZE =            1)
      integer PGA_MINIMIZE
      parameter ( PGA_MINIMIZE =            2)
    
c *** STOPPING CRITERIA
      integer PGA_STOP_MAXITER
      parameter ( PGA_STOP_MAXITER =        1)
      integer PGA_STOP_NOCHANGE
      parameter ( PGA_STOP_NOCHANGE =       2)
      integer PGA_STOP_TOOSIMILAR
      parameter ( PGA_STOP_TOOSIMILAR =     4)

c *** CROSSOVER
      integer PGA_CROSSOVER_ONEPT
      parameter ( PGA_CROSSOVER_ONEPT =     1)
      integer PGA_CROSSOVER_TWOPT
      parameter ( PGA_CROSSOVER_TWOPT =     2)
      integer PGA_CROSSOVER_UNIFORM
      parameter ( PGA_CROSSOVER_UNIFORM =   3)

c *** SELECTION
      integer PGA_SELECT_PROPORTIONAL
      parameter ( PGA_SELECT_PROPORTIONAL = 1)
      integer PGA_SELECT_SUS
      parameter ( PGA_SELECT_SUS =          2)
      integer PGA_SELECT_TOURNAMENT
      parameter ( PGA_SELECT_TOURNAMENT =   3)
      integer PGA_SELECT_PTOURNAMENT
      parameter ( PGA_SELECT_PTOURNAMENT =  4)

c *** FITNESS
      integer PGA_FITNESS_RAW
      parameter ( PGA_FITNESS_RAW =         1)
      integer PGA_FITNESS_NORMAL
      parameter ( PGA_FITNESS_NORMAL =      2)
      integer PGA_FITNESS_RANKING
      parameter ( PGA_FITNESS_RANKING =     3)

c *** FITNESS (MINIMIZATION)
      integer PGA_FITNESSMIN_RECIPROCAL
      parameter ( PGA_FITNESSMIN_RECIPROCAL =  1)
      integer PGA_FITNESSMIN_CMAX
      parameter ( PGA_FITNESSMIN_CMAX =        2)

c *** MUTATION
      integer PGA_MUTATION_FIXED
      parameter ( PGA_MUTATION_FIXED =      1)
      integer PGA_MUTATION_STRINGLEN
      parameter ( PGA_MUTATION_STRINGLEN =  2)
      integer PGA_MUTATION_HAMMING
      parameter ( PGA_MUTATION_HAMMING =    3)
      integer PGA_MUTATION_UNIFORM
      parameter ( PGA_MUTATION_UNIFORM =    4)
      integer PGA_MUTATION_GAUSSIAN
      parameter ( PGA_MUTATION_GAUSSIAN =   5)
    
c *** POPULATION REPLACEMENT
      integer PGA_POPREPL_BEST
      parameter ( PGA_POPREPL_BEST =         1)
      integer PGA_POPREPL_RANDOM_NOREP
      parameter ( PGA_POPREPL_RANDOM_NOREP = 2)
      integer PGA_POPREPL_RANDOM_REP
      parameter ( PGA_POPREPL_RANDOM_REP =   3)

c *** REPORT OPTIONS
      integer PGA_ONLINE
      parameter ( PGA_ONLINE =   1 )
      integer PGA_OFFLINE
      parameter ( PGA_OFFLINE =  2 )
      integer PGA_HAMMING
      parameter ( PGA_HAMMING =  4 )
      integer PGA_STRING
      parameter ( PGA_STRING =   8 )
      integer PGA_WORST
      parameter ( PGA_WORST =   16 )

c *** RANDOMIZER
      integer PGA_PERMUTE
      parameter ( PGA_PERMUTE =             1)
      integer PGA_RANGE
      parameter ( PGA_RANGE =               2)

c *** SET USER FUNCTION
      integer PGA_USERFUNCTION_CREATESTRING
      parameter ( PGA_USERFUNCTION_CREATESTRING = 0)
      integer PGA_USERFUNCTION_MUTATION
      parameter ( PGA_USERFUNCTION_MUTATION =     1)
      integer PGA_USERFUNCTION_CROSSOVER
      parameter ( PGA_USERFUNCTION_CROSSOVER =    2)
      integer PGA_USERFUNCTION_WRITESTRING
      parameter ( PGA_USERFUNCTION_WRITESTRING  = 3)
      integer PGA_USERFUNCTION_COPYSTRING
      parameter ( PGA_USERFUNCTION_COPYSTRING =   4)
      integer PGA_USERFUNCTION_DUPLICATE
      parameter ( PGA_USERFUNCTION_DUPLICATE =    5)
      integer PGA_USERFUNCTION_RANDOMIZE
      parameter ( PGA_USERFUNCTION_RANDOMIZE =    6)

      integer pgagetbinaryallele
      double  precision pgagetrealfrombinary
      double  precision pgagetrealfromgraycode
      integer pgagetintegerfrombinary
      integer pgagetintegerfromgraycode
      integer pgaduplicate
      double  precision pgamean
      double  precision pgastddev
      integer pgarank
      integer pgagetdatatype
      integer pgagetoptdir
      integer pgagetpopsize
      integer pgagetstringlen
      integer pgagetstoppingrule
      integer pgagetmaxiter
      integer pgagetnumreplace
      integer pgagetcrossovertype
      integer pgagetselecttype
      integer pgagetfitnesstype
      integer pgagetfitnessmintype
      integer pgagetmutationtype
      integer pgagetmutateonlynocross
      double  precision pgagetmutaterealval
      integer pgagetmutateintegerval
      integer pgagetnoduplicates
      double  precision pgagetmutationprob
      double  precision pgagetcrossoverprob
      double  precision pgagetuniformcrossprob
      double  precision pgagetfitnessrankmax
      integer pgagetpopreplace
      integer pgagetiter
      integer pgagetmaxint
      integer pgagetminint
      double  precision pgagetmaxdouble
      double  precision pgagetmindouble
      integer pgagetprintfreq
      integer pgagetrandominit
      double  precision pgagetbinaryinitprob
      integer pgagetintegertype
      integer pgagetinitintegermin
      integer pgagetinitintegermax
      double  precision pgagetinitrealmin
      double  precision pgagetinitrealmax
      integer pgagetrandomseed
      double  precision pgagetevaluate
      double  precision pgagetfitness
      integer pgagetevaluptodate
      integer pgagetworst
      integer pgagetbest
      double  precision pgagetptournamentprob
      double  precision pgahammingdistance
      integer pgagetsortpop
      integer pgagetintegerallele
      integer pgamutate
      integer pgadone
      integer pgacreate
      double  precision pgagetrealallele
      integer pgaselectnext
      integer pgarandomflip
      integer pgarandominterval
      double  precision pgarandom01
      double  precision pgarandomuniform
      double  precision pgarandomgaussian
      integer pgaround

      external pgagetbinaryallele
      external pgagetrealfrombinary
      external pgagetrealfromgraycode
      external pgagetintegerfrombinary
      external pgagetintegerfromgraycode
      external pgaduplicate
      external pgamean
      external pgastddev
      external pgarank
      external pgagetdatatype
      external pgagetoptdir
      external pgagetpopsize
      external pgagetstringlen
      external pgagetstoppingrule
      external pgagetmaxiter
      external pgagetnumreplace
      external pgagetcrossovertype
      external pgagetselecttype
      external pgagetfitnesstype
      external pgagetfitnessmintype
      external pgagetmutationtype
      external pgagetmutateonlynocross
      external pgagetmutaterealval
      external pgagetmutateintegerval
      external pgagetnoduplicates
      external pgagetmutationprob
      external pgagetcrossoverprob
      external pgagetuniformcrossprob
      external pgagetfitnessrankmax
      external pgagetpopreplace
      external pgagetiter
      external pgagetmaxint
      external pgagetminint
      external pgagetmaxdouble
      external pgagetmindouble
      external pgagetprintfreq
      external pgagetrandominit
      external pgagetbinaryinitprob
      external pgagetintegertype
      external pgagetinitintegermin
      external pgagetinitintegermax
      external pgagetinitrealmin
      external pgagetinitrealmax
      external pgagetrandomseed
      external pgagetevaluate
      external pgagetfitness
      external pgagetevaluptodate
      external pgagetworst
      external pgagetbest
      external pgagetptournamentprob
      external pgahammingdistance
      external pgagetsortpop
      external pgagetintegerallele
      external pgamutate
      external pgadone
      external pgacreate
      external pgagetrealallele
      external pgaselectnext
      external pgarandomflip
      external pgarandominterval
      external pgarandom01
      external pgarandomuniform
      external pgarandomgaussian
      external pgaround

