home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / PROGRAM / APR94_1.ZIP / GA.ZIP / SOURCE.ZIP / GRPHPHEN.H < prev    next >
C/C++ Source or Header  |  1994-01-10  |  1KB  |  46 lines

  1. //Copyright (C) Man Machine Interfaces 1994. All rights reserved.
  2.  
  3. //grphphen.h
  4.  
  5. #ifndef __GRPHPHEN_H
  6. #define __GRPHPHEN_H
  7.  
  8. //Header for EOS class representing a phenotype
  9. //You need EOS v1.1 to compile this code
  10. #ifndef __PHENO_H
  11. #include "pheno.h"
  12. #endif //__PHENO_H
  13.                                                         
  14.  
  15. class CGraphDrawingPheno : public TPhenotype
  16. {
  17.  
  18.  public:         
  19.  
  20.     CGraphDrawingPheno(CGAGraphDriver &driver,int width, int height) ;
  21.     ~CGraphDrawingPheno() ;
  22.     
  23.     double CalcFitness() ;
  24.     void Decode(PTGenotype geno) ;
  25.     PTPhenotype Copy()  ;
  26.     void GetPhenoInfo(void *pInfoStruct)  ;
  27.  
  28.     
  29.     void GetNearestEmptyCell(const int row, const int col, int &actualRow,int &actualCol) ;
  30.     BOOL Adjacent(WORD node1, WORD node2) ;
  31.     BOOL Diagonal(WORD node1, WORD node2) ;
  32.     BOOL FindNode(const WORD node, int &row, int &col) ;
  33.     double Distance(WORD node1, WORD node2) ;
  34.     double RectDistance(WORD node1, WORD node2) ;
  35.     
  36. private:
  37.  
  38.     int m_Width  ;
  39.     int m_Height ;
  40.     CWordMatrix *m_pGrid ;        //grid where each entry is a node number or EMPTY_CELL
  41.     CGAGraphDriver &m_Driver ;  //interface to the graph driver class
  42.     int * m_GridIndex[2] ;      //index into grid to quickly locate nodes
  43. };
  44.  
  45. #endif //__GRPHPHEN_H
  46.