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

/magnus/back_end/SessionManager/include/RandomDefinitionsGenerator.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: 
00003  */
00004  
00005 // Copyright (C) 2000 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 //
00008 // Contents: Declaration of class RandomDefinitionsGenerator
00009 //
00010 // Principal Author: Alexei Miasnikov
00011 //
00012 // Status: in progress
00013 //
00014 // Revision History:
00015 //
00016 
00017 
00018 #ifndef _RANDOM_DEFINITIONS_H_
00019 #define _RANDOM_DEFINITIONS_H_
00020 
00021 #include "RandomNumbers.h"
00022 #include "FPGroup.h"
00023 #include "Chars.h"
00024 #include "ViewContents.h"
00025 #include <iostream.h>
00026 
00027 // ------------------------------------  RandomDefinitionGenerate -----------------------------------
00028 class RandomDefinitionGenerate
00029 {
00030 public:
00031   RandomDefinitionGenerate() : gw("Parameters") { }
00032 
00033   virtual void readParameters(istream& istr); 
00034   virtual void requireParameters() = 0; 
00035   virtual void printDefinition() = 0;
00036 protected:  
00037   GroupWindow gw;
00038 };
00039 
00040 class RandomWordGenerate : public RandomDefinitionGenerate
00041 {
00042 public:
00043   RandomWordGenerate(istream& is, const FPGroup& p, Chars id);
00044   void requireParameters(); 
00045   void printDefinition();
00046 
00047 private:
00048 
00049   RandomWordGenerate(const RandomWordGenerate &);
00050   // just for safety sake
00051 
00052   Chars generateWord( );
00053 
00054   istream& istr; 
00055   FPGroup parent; 
00056   Chars theID;
00057   UniformRandom ur;
00058   int averagelength;
00059 };
00060 
00061 // ------------------------------------  RandomCollectionOfWordsGenerate -----------------------------------
00062 
00063 class RandomCollectionOfWordsGenerate : public RandomDefinitionGenerate
00064 {
00065 public:
00066   RandomCollectionOfWordsGenerate(istream& is, const FPGroup& p, Chars id, bool isS = false);
00067   void requireParameters(); 
00068   void printDefinition();
00069 
00070 private:
00071 
00072   RandomCollectionOfWordsGenerate(const RandomCollectionOfWordsGenerate &);
00073   // just for safety sake
00074 
00075   Chars generateCollection( );
00076 
00077   istream& istr; 
00078   FPGroup parent; 
00079   Chars theID;
00080   UniformRandom ur;
00081   int averagelength;
00082   int numberOfWords;
00083   bool isSet;
00084 };
00085 
00086 // ------------------------------------  RandomMapGenerate -----------------------------------
00087 
00088 class RandomMapGenerate : public RandomDefinitionGenerate
00089 {
00090 public:
00091   RandomMapGenerate(istream& is, const FPGroup& p, Chars id);
00092   void requireParameters(); 
00093   void printDefinition();
00094 
00095 private:
00096 
00097   RandomMapGenerate(const RandomMapGenerate &);
00098   // just for safety sake
00099 
00100   Chars generateMap( );
00101 
00102   istream& istr; 
00103   FPGroup parent; 
00104   Chars theID;
00105   UniformRandom ur;
00106   int averagelength;
00107 
00108 };
00109 // ------------------------------------  RandomGroupGenerate -----------------------------------
00110 
00111 class RandomGroupGenerate : public RandomDefinitionGenerate
00112 {
00113 public:
00114   RandomGroupGenerate(istream& is, Chars id, bool iF = false, bool iN = false, bool iOR = false);
00115   void requireParameters(); 
00116   void printDefinition();
00117 
00118 private:
00119 
00120   RandomGroupGenerate(const RandomGroupGenerate &);
00121   // just for safety sake
00122 
00123   Chars generateGroup( );
00124 
00125   istream& istr; 
00126   Chars theID;
00127   int maxGens;
00128   int maxRels;
00129   int averageRels;
00130   int nilpClass;
00131 
00132   bool isFree;
00133   bool isNilpotent;
00134   bool isOR;
00135 };
00136 
00137 // ------------------------------------  RandomSCGroupGenerate -----------------------------------
00138 
00139 class RandomSCGroupGenerate : public RandomDefinitionGenerate
00140 {
00141 public:
00142   RandomSCGroupGenerate(istream& is, Chars id);
00143   void requireParameters(); 
00144   void printDefinition();
00145 
00146 private:
00147 
00148   RandomSCGroupGenerate(const RandomSCGroupGenerate &);
00149   // just for safety sake
00150 
00151   Chars generateSCGroup( );
00152 
00153   istream& istr; 
00154   Chars theID;
00155   int maxGens;
00156   int maxRels;
00157   int averageRels;
00158 
00159 };
00160 
00161 //---------------------------------------------------------------------------//
00162 //--------------------- RandomDefinitionsGenerator --------------------------//
00163 //---------------------------------------------------------------------------//
00164 
00165 
00166 class RandomDefinitionsGenerator
00167 
00168 {
00169   
00170  private:
00171   
00172   /////////////////////////////////////////////////////////////////////////
00173   //                                                                     //
00174   // Constructors:                                                       //
00175   //                                                                     //
00176   /////////////////////////////////////////////////////////////////////////
00177   
00178   RandomDefinitionsGenerator( );
00179   
00180   /////////////////////////////////////////////////////////////////////////
00181   //                                                                     //
00182   // Public Members Touched by Friends:                                  //
00183   //                                                                     //
00184   /////////////////////////////////////////////////////////////////////////
00185   
00186   friend class SessionManager;
00187   
00188   static void readMessage(istream& istr);
00189   // Used by class SessionManager.
00190   // this function reads message from the front end which is request for 
00191   // a definition of an algebraic object. Format of the message is following:
00192   //   "object_type  window_name", here object type is a string identifying the 
00193   // object to be defined and window_name - is a  name for a text window where
00194   // definition will be displayed.
00195   
00196   static Chars generateFPGroupPresentation();
00197     
00198   /////////////////////////////////////////////////////////////////////////
00199   //                                                                     //
00200   // Data Members:                                                       //
00201   //                                                                     //
00202   /////////////////////////////////////////////////////////////////////////
00203   
00204   static RandomDefinitionGenerate* defGenerator;
00205 };
00206 
00207 #endif

Generated at Tue Jun 19 09:49:38 2001 for Magnus Classes by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001