Evocosm - A C++ Framework for Evolutionary Computing

Main Index

Created by Scott Robert Ladd at Coyote Gulch Productions.


reporter.h
1 //---------------------------------------------------------------------
2 // Algorithmic Conjurings @ http://www.coyotegulch.com
3 // Evocosm -- An Object-Oriented Framework for Evolutionary Algorithms
4 //
5 // reporter.h
6 //---------------------------------------------------------------------
7 //
8 // Copyright 1996, 1999, 2002, 2003, 2004, 2005, 2007 Scott Robert Ladd
9 //
10 // This program is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation; either version 2 of the License, or
13 // (at your option) any later version.
14 //
15 // This program is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with this program; if not, write to the
22 // Free Software Foundation, Inc.
23 // 59 Temple Place - Suite 330
24 // Boston, MA 02111-1307, USA.
25 //
26 //-----------------------------------------------------------------------
27 //
28 // For more information on this software package, please visit
29 // Scott's web site, Coyote Gulch Productions, at:
30 //
31 // http://www.coyotegulch.com
32 //
33 //-----------------------------------------------------------------------
34 
35 #if !defined(LIBEVOCOSM_REPORTER_H)
36 #define LIBEVOCOSM_REPORTER_H
37 
38 // libevocosm
39 #include "organism.h"
40 
41 namespace libevocosm
42 {
44 
51  template <typename OrganismType, typename LandscapeType>
52  class reporter : protected globals
53  {
54  public:
56 
60  reporter(listener & a_listener)
61  : m_listener(a_listener)
62  {
63  // nada
64  }
65 
67  reporter(const reporter & a_source)
68  : m_listener(a_source.m_listener)
69  {
70  // nada
71  }
72 
74  reporter & operator = (const reporter & a_source)
75  {
76  m_listener = a_source.m_listener;
77  }
78 
80 
87  virtual ~reporter()
88  {
89  // nada
90  }
91 
93 
104  virtual bool report(const vector< vector<OrganismType> > & a_population, size_t a_iteration, double & a_fitness, bool a_finished = false) = 0;
105 
106  protected:
109  };
110 };
111 
112 #endif
reporter & operator=(const reporter &a_source)
Assignment operator.
Definition: reporter.h:74
Reports on a given population.
Definition: reporter.h:52
An abstract interface defining a listener.
Definition: evocommon.h:156
listener & m_listener
The listener for events.
Definition: reporter.h:108
virtual bool report(const vector< vector< OrganismType > > &a_population, size_t a_iteration, double &a_fitness, bool a_finished=false)=0
Reports on a population.
A toolkit and framework for implementing evolutionary algorithms.
Definition: evocommon.h:60
reporter(listener &a_listener)
Constructor.
Definition: reporter.h:60
Elements shared by all classes in Evocosm.
Definition: evocommon.h:115
virtual ~reporter()
Virtual destructor.
Definition: reporter.h:87
reporter(const reporter &a_source)
Copy constructor.
Definition: reporter.h:67

© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.