Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

gamanager.h

00001 /***************************************************************************
00002                           gamanager.h  -  description
00003                              -------------------
00004     begin                : Sat Feb 16 2002
00005     copyright            : (C) 2002 by Rüdiger Koch
00006     email                : rkoch@rkoch.org
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef GAMANAGER_H
00019 #define GAMANAGER_H
00020 
00021 using namespace std;
00022 #include <amygdala/network.h>
00023 #include <amygdala/genome.h>
00024 
00025 #include <string>
00026 
00032 class GAManager {
00033 public: 
00034     GAManager();
00035     virtual ~GAManager();
00036 
00037     void Run(AmTimeInt maxSimTime, AmTimeInt maxRunTime);
00038 
00041     virtual unsigned int GetScore() = 0;
00042 
00045     virtual void Setup(string uri) = 0;
00046 
00050     int Loop(string uri, AmTimeInt maxSimTime, AmTimeInt maxRunTime);
00051 
00053     Network* getNetwork();
00054 
00057     void GenomeFormat( string format);
00058 
00059 protected: // Protected attributes
00061     Network* NN;
00062     Genome *genome;
00063     static bool run;
00064     static bool isManager;
00065     static GAManager *theGAManager;
00066 
00067 protected: // Protected methods
00069     void finalize();
00070 
00071 
00072 private: // Private methods
00074     static void timeout(int signum);
00075 
00077     static void simStop(int signum);
00078 };
00079 
00080 #endif

Generated on Wed Sep 4 02:30:35 2002 for Amygdala by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002