71 lines
1.8 KiB
C
71 lines
1.8 KiB
C
|
/* lil-gp Genetic Programming System, version 1.0, 11 July 1995
|
||
|
* Copyright (C) 1995 Michigan State University
|
||
|
*
|
||
|
* This program is free software; you can redistribute it and/or modify
|
||
|
* it under the terms of version 2 of the GNU General Public License as
|
||
|
* published by the Free Software Foundation.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program; if not, write to the Free Software
|
||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||
|
*
|
||
|
* Douglas Zongker (zongker@isl.cps.msu.edu)
|
||
|
* Dr. Bill Punch (punch@isl.cps.msu.edu)
|
||
|
*
|
||
|
* Computer Science Department
|
||
|
* A-714 Wells Hall
|
||
|
* Michigan State University
|
||
|
* East Lansing, Michigan 48824
|
||
|
* USA
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#include <lilgp.h>
|
||
|
|
||
|
/*
|
||
|
DATATYPE f_terminal (int tree, farg* args)
|
||
|
{
|
||
|
globaldata* g = get_globaldata();
|
||
|
DATATYPE retval;
|
||
|
|
||
|
// calculations need to generate terminal value,
|
||
|
// place value inside retval in proper type container
|
||
|
|
||
|
// To generate a random integer [0..y)
|
||
|
// x = random_int ( &g->myrand, y );
|
||
|
// To generate a random double [0..1)
|
||
|
// x = random_double ( &g->myrand );
|
||
|
|
||
|
|
||
|
return retval;
|
||
|
}
|
||
|
|
||
|
|
||
|
DATATYPE f_func_data (int tree, farg *args)
|
||
|
{
|
||
|
DATATYPE retval;
|
||
|
|
||
|
// calculations using parameters args[i],
|
||
|
// place value inside retval in proper type container
|
||
|
|
||
|
return retval;
|
||
|
}
|
||
|
|
||
|
|
||
|
DATATYPE f_func_expr ( int tree, farg *args )
|
||
|
{
|
||
|
globaldata* g = get_globaldata();
|
||
|
DATATYPE retval;
|
||
|
|
||
|
// evaluate subtrees using ...
|
||
|
retval = evaluate_tree (args[i].t, tree);
|
||
|
|
||
|
return retval;
|
||
|
}
|
||
|
*/
|