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

SIG_Program.h

00001 /* ----------------------------------------------------------------------- */
00002 /* CLASS:     SIG_Programm.h                                               */
00003 /* FUNCTION:  This class contains all functions that are needed to manage  */
00004 /*            program lines.                                               */
00005 /*            export member functions.                                     */
00006 /* ----------------------------------------------------------------------- */
00007 
00008 
00009 
00010 #if !defined(SIGEL_PROGRAMPACKAGE_SIG_PROGRAM_H) 
00011 #define SIGEL_PROGRAMPACKAGE_SIG_PROGRAM_H
00012 
00013 
00014 #include<qvector.h>
00015 #include<qarray.h>
00016 #include<qtextstream.h>
00017 #include<qstring.h>
00018 
00019 #include<vector>
00020 
00021 #include "SIG_ProgramLine.h"
00022 #include "SIGEL_Tools/SIG_Randomizer.h"
00023 #include "SIGEL_GP/SIG_GPParameter.h"
00024 #include "SIGEL_Robot/SIG_LanguageParameters.h"
00025 #include "SIGEL_Tools/SIG_IO.h"
00026 
00027 #include <qapplication.h>
00028 
00029 
00036 namespace SIGEL_Program
00037    {
00038 
00048 class SIG_Program
00049 {
00050 
00051  protected:
00052  vector< SIG_ProgramLine* > lines;
00053 
00058    public:
00059    SIGEL_Program::SIG_Program& operator =(SIGEL_Program::SIG_Program& prg);
00060 
00067    public:
00068    SIG_Program();
00069 
00078    public:
00079    SIG_Program(SIGEL_GP::SIG_GPParameter &param, 
00080                SIGEL_Robot::SIG_LanguageParameters &languageP, 
00081                SIGEL_Tools::SIG_Randomizer& random);
00082 
00088    public:
00089    virtual ~SIG_Program();
00090 
00091 
00096  public:
00097  vector< SIGEL_Program::SIG_ProgramLine* > &getPrgLines();
00098 
00099 
00107   public:
00108   void writeToFile(QTextStream &file);
00109 
00123    public:
00124    void readFromFile(QTextStream &file);
00125 
00132    public:
00133    void printToString(QString &str);
00134 
00140    public:
00141    void clear();
00142 
00148    public:
00149    void print();
00150 
00151 
00157    public:
00158    long getProgramLength();
00159 
00168    public:
00169    SIGEL_Program::SIG_ProgramLine *getLine(long no);
00170 
00179    public:
00180    void deleteLine(long no);
00181 
00191    public:
00192    void appendLine(SIGEL_Program::SIG_ProgramLine *l);
00193 
00202    public:
00203    void insertLine(long no, SIGEL_Program::SIG_ProgramLine *l);
00204 
00205 
00216    public:
00217    SIG_Program(int length, int nop, SIGEL_Tools::SIG_Randomizer &r);
00218 
00219 
00227    public:
00228    void generateRandomProgram(SIGEL_GP::SIG_GPParameter &param, 
00229                               SIGEL_Robot::SIG_LanguageParameters &languageP, 
00230                               SIGEL_Tools::SIG_Randomizer& random);
00231 
00236    public:
00237    void importProgram( QString& filename );
00238 
00243    public:
00244    void exportProgram( QString& filename );
00245 
00253    public:
00254    void checkLength( long minimum,
00255                      long maximum,
00256                      SIGEL_Tools::SIG_Randomizer &r, 
00257                      SIGEL_Robot::SIG_LanguageParameters &languageP,
00258                      QArray< int > &prob,
00259                      int &historyInfo );
00260    };
00261 
00262 };
00263 
00264 #endif /* SIGEL_PROGRAMPACKAGE_SIG_PROGRAM_H */

Generated at Mon Sep 3 01:32:28 2001 for PG 368 - SIGEL by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000