NEURON interface to GAUL (Neymotin and Lytton)

Accession:102464
This interface allows the use of genetic algorithms for optimization and search in high-dimensional spaces from within the NEURON environment. It includes converted .c,.h files from GAUL wrapped in proper MOD file syntax as well as MOD code interfacing to the library. It also comes with hoc utilitiy functions to make it easier to use the GA.
Tool Information (Click on a link to find other Tools with that property)
Tool Type: Control Simulations;
Simulation Environment: NEURON;
\
neuron_gaul_2
gaul
readme.txt
compatibility.mod
ga_bitstring.mod
ga_chromo.mod
ga_climbing.mod
ga_compare.mod
ga_core.mod
ga_crossover.mod
ga_de.mod
ga_deterministiccrowding.mod
ga_gradient.mod
ga_hoc.mod
ga_intrinsics.mod
ga_io.mod
ga_mutate.mod
ga_optim.mod
ga_qsort.mod
ga_randomsearch.mod
ga_rank.mod
ga_replace.mod
ga_sa.mod
ga_seed.mod
ga_select.mod
ga_similarity.mod
ga_simplex.mod
ga_stats.mod
ga_systematicsearch.mod
ga_tabu.mod
ga_utility.mod
linkedlist.mod
log_util.mod
memory_chunks.mod
memory_util.mod
nn_util.mod
random_util.mod
avltree.mod
table_util.mod
timer_util.mod
vecst.mod
mosinit.hoc
ga_utils.hoc
init.hoc
declist.hoc
setup.hoc
decvec.hoc
ga_test.hoc
gaul.h
xtmp
                            
// $Id: ga_test.hoc,v 1.2 2007/12/05 23:39:53 samn Exp $ 

////////////////////////////////////////////////////////////
//Synopsis: An example program for NEURON demonstrating use
//	    of the genetic algorithm in GAUL.
//
//This program aims to solve a function of the form
//(0.75-A)+(0.95-B)^2+(0.23-C)^3+(0.71-D)^4 = 0
////////////////////////////////////////////////////////////

verbose_GA = 0 //don't print out everything

//set some GA params
Mutate = 0.5
Crossover = 0.3
NumParams = 4
NumIslands = 1
PopSize = 100
MaxGen = 400

//initialize range of values for param search
proc InitAlleleRange(){ local idx
  for idx=0,NumParams-1 {
    vallele_mins.x(idx)=-200
    vallele_maxs.x(idx)=200
  }
}

InitAlleleRange()

plot_fitness = 0 //dont plot fitness

//fitness score , max is 0, min is negative infiniti
func polynomial_score(){ local fitness,A,B,C,D
  A=$1 B=$2 C=$3 D=$4
  return -(abs(0.75-A)+(0.95-B)^2+abs((0.23-C)^3)+(0.71-D)^4)
}

//fitness function 
func GetFitness(){ local fitness

  //read params
  vparams.get_alleles()

  //get fitness score
  fitness = polynomial_score(vparams.x(0),vparams.x(1),vparams.x(2),vparams.x(3))

  //store fitness for GA
  SetFitness_GA(fitness)

  //return
  return fitness
}

//perform evolution
Evolution()

//display best results
BestIsland()

printf("Best possible params = 0.75 0.95 0.23 0.71\n")