1 /********************************************************************** 2 ga_optim.h 3 ********************************************************************** 4 5 ga_optim - Gene-based optimisation routines. 6 Copyright ©2000-2005, Stewart Adcock <stewart@linux-domain.com> 7 All rights reserved. 8 9 The latest version of this program should be available at: 10 http://gaul.sourceforge.net/ 11 12 This program is free software; you can redistribute it and/or modify 13 it under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2 of the License, or 15 (at your option) any later version. Alternatively, if your project 16 is incompatible with the GPL, I will probably agree to requests 17 for permission to use the terms of any other license. 18 19 This program is distributed in the hope that it will be useful, but 20 WITHOUT ANY WARRANTY WHATSOEVER. 21 22 A full copy of the GNU General Public License should be in the file 23 "COPYING" provided with this distribution; if not, see: 24 http://www.gnu.org/ 25 26 ********************************************************************** 27 28 Synopsis: Routines for handling populations and performing GA 29 operations. 30 31 **********************************************************************/ 32 33 #ifndef GA_OPTIM_H_INCLUDED 34 #define GA_OPTIM_H_INCLUDED 35 36 /* 37 * Includes 38 */ 39 #include "gaul.h" 40 41 #if HAVE_MPI==1 42 #include <mpi.h> 43 #endif 44 45 /* 46 * Callback function prototype. 47 */ 48 typedef void (*GAspecificmutate)(int chromo, int point, int *data); 49 50 /* 51 * Prototypes 52 */ 53 FUNCPROTO void ga_attach_mpi_slave( population *pop ); 54 FUNCPROTO void ga_detach_mpi_slaves(void); 55 56 FUNCPROTO int ga_evolution( population *pop, 57 const int max_generations ); 58 FUNCPROTO int ga_evolution_mp( population *pop, 59 const int max_generations ); 60 FUNCPROTO int ga_evolution_mpi( population *pop, 61 const int max_generations ); 62 FUNCPROTO int ga_evolution_forked( population *pop, 63 const int max_generations ); 64 FUNCPROTO int ga_evolution_threaded( population *pop, 65 const int max_generations ); 66 FUNCPROTO int ga_evolution_steady_state( population *pop, 67 const int max_iterations ); 68 FUNCPROTO int ga_evolution_archipelago( const int num_pops, 69 population **pops, 70 const int max_generations ); 71 FUNCPROTO int ga_evolution_archipelago_forked( const int num_pops, 72 population **pops, 73 const int max_generations ); 74 FUNCPROTO int ga_evolution_archipelago_threaded( const int num_pops, 75 population **pops, 76 const int max_generations ); 77 FUNCPROTO int ga_evolution_archipelago_mp( const int num_pops, 78 population **pops, 79 const int max_generations ); 80 FUNCPROTO int ga_evolution_archipelago_mpi( const int num_pops, 81 population **pops, 82 const int max_generations ); 83 84 #endif /* GA_OPTIM_H */ 85