/****************************************************************** * * * Nest version 2 - 3D Wasp Nest Simulator * * Copyright (C) 1997 Sylvain GUERIN * * LIASC, ENST Bretagne & Santa Fe Institute * * * ****************************************************************** E-mail: Sylvain.Guerin@enst-bretagne.fr or: Sylvain Guerin 13 rue des Monts Lorgeaux, 51460 L'EPINE, FRANCE ****************************************************************** This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ****************************************************************** Name : GenInt.h Component : genetic interface Fonctionality : contains specifications refering to the genetic interface ******************************************************************/ #ifndef __GenInt_H #define __GenInt_H #include "graphical.h" #include "algo.h" #include "genetic.h" #include "NetInt.h" #include "MainInt.h" #define dialogPanelLinesNumber 15 class SimulationParameters; class GeneticInterface; class GeneticSimulation; class HistoryInterface; class DeferedSimulation; class DeferedSimuInterface : public Interface { public: DeferedSimuInterface (int x0, int y0, Display* aDisplay, DeferedSimuList* aDeferedSimuList); virtual ~DeferedSimuInterface (); actionType manageInterface (XEvent report); void refresh (); ArrayWindow* deferedSimuArray; /* on le met en public pour pouvoir s'en servir a partir de main Inter. */ protected: Button* closeButton; }; class GeneticInterface : public Interface { public: GeneticInterface (int x0, int y0, char* windowLabel, char* iconLabel, Display* aDisplay, MainInterface* aMainInterface); virtual ~GeneticInterface (); actionType manageInterface (XEvent report); void refresh (); void displayNewText (char* aText); void displayGraph (); void incStatWindow (); void resetStatWindow (unsigned int max); void refreshStatWindow (); void resetEditedValues (); void displayNewLabels (); void testAndManageDeferedSimulations (); void launchDeferedSimulation (DeferedSimulation* aDeferedSimulation); int deferedSimulationRunning; int deferedSimulationIndex; /* utile pour clore une simulation en differe */ DeferedSimuInterface* deferedSimuInterface; int deferedSimuInterfaceDisplayed; /* pour savoir si la fenetre de visualisation des simul est affichee */ protected: Enumeration fitnessTypeEnum; Enumeration simulationTypeEnum; Enumeration randomGenerationTypeEnum; Enumeration crossoverTypeEnum; MainInterface* mainInterface; Button* closeButton; Button* loadButton; Button* newButton; Button* saveButton; Button* simuButton; Button* historyButton; Button* initButton; Button* runButton; Button* deferedButton; Button* stopButton; Button* goStepButton; Button* nextStepButton; Button* previousStepButton; HorizontalBar* bar1; TextWidget* simuTitle; HorizontalBar* bar2; TextInput* nameInput; TextInput* dirNameInput; TextInput* pathInput; TextWidget* currentStepText; TextWidget* totalStepsText; HorizontalBar* bar3; TextWidget* resultsTitle; HorizontalBar* bar4; TextWidget* bestMarkText; TextWidget* averageMarkText; TextWidget* worstMarkText; HorizontalBar* bar5; TextWidget* parametersTitle; HorizontalBar* bar6; TextInput* coloniesNumberInput; TextInput* simuTypeInput; VerticalBar* bar7; TextWidget* initLabel; Button* initSetButton; TextWidget* selectionLabel; TextWidget* crossOverLabel; Button* crossOverSetButton; TextWidget* mutationLabel; Button* mutationSetButton; TextWidget* swapLabel; Button* swapSetButton; TextWidget* simulationLabel; Button* simulationSetButton; TextWidget* evaluationLabel; Button* evaluationSetButton; GraphicWindow* graphWindow; GraphicWindow* statWindow; TextWidget* runningGenerationText; RoundPanel* dialogPanel; TextWidget* dialogText[dialogPanelLinesNumber]; char* scrollText[dialogPanelLinesNumber]; HistoryInterface* historyInterface; int historyDisplayed; unsigned int currentStat; unsigned int maxStat; /* variables used for statWindow displaying */ GeneticSimulation* geneticSimulation; /* declared in mainInterface */ int geneticSimulationSet; /* copy of geneticSimulationSet in main interface */ char editedDirName[256]; char editedPath[256]; char editedName[256]; SimulationParameters* editedSimuParams; void displayTexts (); void manageLoad (); void manageNew (); void manageSave (); void manageSimu (); void manageHistory (); void manageRun (); void manageStop (); void manageDefered (); void manageGoStep (); void managePrevious (); void manageNext (); void manageInitialize (); void setParameters (); void setInitialisation (); void setCrossOver (); void setMutation (); void setSwap (); void setSimulation (); void setEvaluation (); void enableEdition (); void disableEdition (); }; class HistoryInterface : public Interface { public: HistoryInterface (int x0, int y0, Display* aDisplay, char* pathName, char* fileName); virtual ~HistoryInterface (); actionType manageInterface (XEvent report); void refresh (); protected: Button* closeButton; FileViewer* fileViewer; }; #endif