Start using atomic counters and set a CMake policy to the new (2.6) type.
[PaGMO.git] / SolversThreads / SolversThreads.h
blob76207ef4d3123405170a1f222d999f334265f63c
1 /*
2 * SolverThreads.h
3 * PaGMO
5 * Created by Dario Izzo on 9/21/08.
6 * Copyright 2008 __MyCompanyName__. All rights reserved.
8 */
11 #ifndef SOLVERSTHREADS_H
12 #define SOLVERSTHREADS_H
14 #include <boost/thread/condition_variable.hpp>
15 #include <boost/thread/mutex.hpp>
17 #include "../atomic_counters/atomic_counters.h"
18 #include "GOproblem.h"
19 #include "population.h"
21 //Here we define the parameters needed to instanciate a thread. These contain
22 //datas that are algorithm specific, but also data that are needed for all aglorithms (LB,UB,objfun,mutex etc.)
24 struct threadParam{
25 //Thread unique ID
26 unsigned int threadID;
28 //Solvers Data
29 int NP;
30 int generations;
31 //DE
32 int strategy;
33 double F,CR;
34 //PSO
35 double omega,eta1,eta2,vcoeff;
36 int nswarms;
37 //GA
38 double M,CRsga;
39 int insert_best;
40 //SA-AN
41 double Ts,Tf;
42 //pointers giving access to global resources
43 GOProblem* problem;
45 PaGMO::atomic_counter_int *isActive;
46 boost::mutex *TPmutex;
47 boost::condition_variable *exit;
48 Population *Ptr_pop;
49 std::ofstream *Ptr_log;
50 uint32_t randomSeed;
53 //Here we define the protoypes for each type of thread we may want to open
54 void *DEthread(void *data);
55 void *PSOthread(void *data);
56 void *MPSOthread(void *data);
57 void *SGAthread(void *data);
58 void *ASAthread(void *data);
59 #endif