[Avida-cvs] [Avida2-svn] r318 - trunk/source/main

brysonda@myxo.css.msu.edu brysonda at myxo.css.msu.edu
Fri Sep 16 15:20:20 PDT 2005


Author: brysonda
Date: 2005-09-16 18:20:20 -0400 (Fri, 16 Sep 2005)
New Revision: 318

Added:
   trunk/source/main/cGenome.h
Removed:
   trunk/source/main/cGenome.hh
Log:
Fix cGenome.h

Copied: trunk/source/main/cGenome.h (from rev 317, trunk/source/main/cGenome.hh)

Deleted: trunk/source/main/cGenome.hh
===================================================================
--- trunk/source/main/cGenome.hh	2005-09-16 22:19:23 UTC (rev 317)
+++ trunk/source/main/cGenome.hh	2005-09-16 22:20:20 UTC (rev 318)
@@ -1,60 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 California Institute of Technology             //
-//                                                                          //
-// Read the COPYING and README files, or contact 'avida at alife.org',         //
-// before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef GENOME_HH
-#define GENOME_HH
-
-#include <assert.h>
-
-#ifndef INSTRUCTION_HH
-#include "cInstruction.h"
-#endif
-#ifndef STRING_HH
-#include "string.hh"
-#endif
-#ifndef TARRAY_HH
-#include "tArray.hh"
-#endif
-
-/**
- * This class stores the genome of an Avida organism.  Note that once created,
- * a genome should not be modified; only the corresponding memory should be,
- * before creating the genome.  Keeping genome light-weight...
- **/
-
-class cGenome {
-protected:
-  tArray<cInstruction> genome;
-  int active_size;
-
-public:
-  explicit cGenome(int _size);
-  cGenome(const cGenome & in_genome);
-  cGenome(const cString & in_string);
-  virtual ~cGenome();
-
-  virtual void operator=(const cGenome & other_genome);
-  virtual bool operator==(const cGenome & other_genome) const;
-  virtual bool operator!=(const cGenome & other_genome) const
-  { return !(this->operator==(other_genome)); }
-  virtual bool operator<(const cGenome & other_genome) const
-  { return AsString() < other_genome.AsString(); }
-
-  cInstruction & operator[](int index)
-    { assert(index >= 0 && index < active_size);  return genome[index]; }
-  const cInstruction & operator[](int index) const
-    { assert(index >= 0 && index < active_size);  return genome[index]; }
-
-  virtual void Copy(int to, int from);
-
-  bool OK() const;
-   
-  int GetSize() const { return active_size; }
-  cString AsString() const;
-};
-
-#endif




More information about the Avida-cvs mailing list