PaGMO  1.1.5
race_algo.h
1 /*****************************************************************************
2  * Copyright (C) 2004-2015 The PaGMO development team, *
3  * Advanced Concepts Team (ACT), European Space Agency (ESA) *
4  * *
5  * https://github.com/esa/pagmo *
6  * *
7  * act@esa.int *
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17  * GNU General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU General Public License *
20  * along with this program; if not, write to the *
21  * Free Software Foundation, Inc., *
22  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
23  *****************************************************************************/
24 
25 #ifndef PAGMO_UTIL_RACE_ALGO_H
26 #define PAGMO_UTIL_RACE_ALGO_H
27 
28 #include <iostream>
29 #include <string>
30 #include <vector>
31 
32 #include "../config.h"
33 #include "../serialization.h"
34 #include "../problem/base.h"
35 #include "../problem/ackley.h"
36 #include "../algorithm/base.h"
37 
38 namespace pagmo { namespace util { namespace racing {
39 
41 
46 class __PAGMO_VISIBLE race_algo
47 {
48  public:
49  race_algo(const std::vector<algorithm::base_ptr> &algos = std::vector<algorithm::base_ptr>(), const problem::base &prob = problem::ackley(), unsigned int pop_size = 100, unsigned int seed = 0);
50  race_algo(const std::vector<algorithm::base_ptr> &algos, const std::vector<problem::base_ptr> &prob, unsigned int pop_size = 100, unsigned int seed = 0);
51 
52  // Main method containing all the juice
53  std::pair<std::vector<unsigned int>, unsigned int> run(
54  const unsigned int n_final,
55  const unsigned int min_trials,
56  const unsigned int max_count,
57  double delta,
58  const std::vector<unsigned int> &,
59  const bool race_best,
60  const bool screen_output
61  );
62 
63  private:
64 
65  std::vector<algorithm::base_ptr> m_algos;
66  std::vector<problem::base_ptr> m_probs;
67  unsigned int m_pop_size;
68  unsigned int m_seed;
69 };
70 
71 }}}
72 
73 #endif
Root PaGMO namespace.
Base problem class.
Definition: problem/base.h:148
Racing mechanism for algorithms.
Definition: race_algo.h:46
The Ackley problem.
Definition: ackley.h:51