[Avida-SVN] r3033 - in development: Avida.xcodeproj source/cpu

brysonda at myxo.css.msu.edu brysonda at myxo.css.msu.edu
Sat Dec 13 13:20:10 PST 2008


Author: brysonda
Date: 2008-12-13 16:20:09 -0500 (Sat, 13 Dec 2008)
New Revision: 3033

Modified:
   development/Avida.xcodeproj/project.pbxproj
   development/source/cpu/cHardwareCPU.cc
   development/source/cpu/cHardwareCPU.h
   development/source/cpu/cHardwareExperimental.cc
   development/source/cpu/cHardwareExperimental.h
Log:
Some code cleanup in cHardwareExperimental.

Modified: development/Avida.xcodeproj/project.pbxproj
===================================================================
--- development/Avida.xcodeproj/project.pbxproj	2008-12-13 21:03:31 UTC (rev 3032)
+++ development/Avida.xcodeproj/project.pbxproj	2008-12-13 21:20:09 UTC (rev 3033)
@@ -750,7 +750,7 @@
 		70B08B8F08FB2E5500FC65FE /* tVector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = tVector.h; sourceTree = "<group>"; };
 		70B08B9008FB2E6B00FC65FE /* cTools.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cTools.cc; sourceTree = "<group>"; };
 		70B08B9108FB2E6B00FC65FE /* cWeightedIndex.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cWeightedIndex.cc; sourceTree = "<group>"; };
-		70B1A64F0B7E237F00067486 /* cHardwareExperimental.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cHardwareExperimental.cc; sourceTree = "<group>"; };
+		70B1A64F0B7E237F00067486 /* cHardwareExperimental.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cHardwareExperimental.cc; sourceTree = "<group>"; wrapsLines = 0; };
 		70B1A6530B7E238F00067486 /* cHardwareExperimental.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cHardwareExperimental.h; sourceTree = "<group>"; };
 		70B1A7420B7E3FFD00067486 /* instset-experimental.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "instset-experimental.cfg"; sourceTree = "<group>"; };
 		70B1A7590B7E431F00067486 /* experimental.org */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = experimental.org; sourceTree = "<group>"; };

Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc	2008-12-13 21:03:31 UTC (rev 3032)
+++ development/source/cpu/cHardwareCPU.cc	2008-12-13 21:20:09 UTC (rev 3033)
@@ -532,7 +532,7 @@
   m_no_cpu_cycle_time = m_world->GetConfig().NO_CPU_CYCLE_TIME.Get();
   
   m_promoters_enabled = m_world->GetConfig().PROMOTERS_ENABLED.Get();
-  m_constituative_regulation = m_world->GetConfig().CONSTITUTIVE_REGULATION.Get();
+  m_constitutive_regulation = m_world->GetConfig().CONSTITUTIVE_REGULATION.Get();
   
   m_slip_read_head = !m_world->GetConfig().SLIP_COPY_MODE.Get();
   
@@ -679,7 +679,7 @@
     if (m_has_any_costs) exec = SingleProcess_PayCosts(ctx, cur_inst);
 
     // Constitutive regulation applied here
-    if (m_constituative_regulation) Inst_SenseRegulate(ctx); 
+    if (m_constitutive_regulation) Inst_SenseRegulate(ctx); 
 
     // If there are no active promoters and a certain mode is set, then don't execute any further instructions
     if (m_promoters_enabled && m_world->GetConfig().NO_ACTIVE_PROMOTER_EFFECT.Get() == 2 && m_promoter_index == -1) exec = false;

Modified: development/source/cpu/cHardwareCPU.h
===================================================================
--- development/source/cpu/cHardwareCPU.h	2008-12-13 21:03:31 UTC (rev 3032)
+++ development/source/cpu/cHardwareCPU.h	2008-12-13 21:20:09 UTC (rev 3033)
@@ -148,7 +148,7 @@
     bool m_no_cpu_cycle_time:1;
     
     bool m_promoters_enabled:1;
-    bool m_constituative_regulation:1;
+    bool m_constitutive_regulation:1;
     
     bool m_slip_read_head:1;
   };

Modified: development/source/cpu/cHardwareExperimental.cc
===================================================================
--- development/source/cpu/cHardwareExperimental.cc	2008-12-13 21:03:31 UTC (rev 3032)
+++ development/source/cpu/cHardwareExperimental.cc	2008-12-13 21:20:09 UTC (rev 3033)
@@ -105,7 +105,6 @@
     tInstLibEntry<tMethod>("if-less-cons", &cHardwareExperimental::Inst_IfLessConsensus, 0, "Execute next instruction if Count(?BX?) < Count(?CX?), else skip it"),
     tInstLibEntry<tMethod>("if-less-cons-24", &cHardwareExperimental::Inst_IfLessConsensus24, 0, "Execute next instruction if Count(?BX[0:23]?) < Count(?CX[0:23]?), else skip it"),
 
-
     // Core ALU Operations
     tInstLibEntry<tMethod>("pop", &cHardwareExperimental::Inst_Pop, nInstFlag::DEFAULT, "Remove top number from stack and place into ?BX?"),
     tInstLibEntry<tMethod>("push", &cHardwareExperimental::Inst_Push, nInstFlag::DEFAULT, "Copy number from ?BX? and place it into the stack"),
@@ -214,7 +213,10 @@
   m_no_cpu_cycle_time = m_world->GetConfig().NO_CPU_CYCLE_TIME.Get();
   
   m_promoters_enabled = m_world->GetConfig().PROMOTERS_ENABLED.Get();
-  m_constituative_regulation = m_world->GetConfig().CONSTITUTIVE_REGULATION.Get();
+  if (m_promoters_enabled) {
+    m_constitutive_regulation = m_world->GetConfig().CONSTITUTIVE_REGULATION.Get();
+    m_no_active_promoter_halt = (m_world->GetConfig().NO_ACTIVE_PROMOTER_EFFECT.Get() == 2);
+  }
   
   m_slip_read_head = !m_world->GetConfig().SLIP_COPY_MODE.Get();
   
@@ -241,7 +243,7 @@
   m_executedmatchstrings = false;
   
   // Promoter model
-  if (m_world->GetConfig().PROMOTERS_ENABLED.Get()) {
+  if (m_promoters_enabled) {
     m_promoter_index = -1; // Meaning the last promoter was nothing
     m_promoter_offset = 0;
     
@@ -345,12 +347,13 @@
     bool exec = true;
     if (m_has_any_costs) exec = SingleProcess_PayCosts(ctx, cur_inst);
 
-    
-    // Constitutive regulation applied here
-    if (m_constituative_regulation) Inst_SenseRegulate(ctx); 
+    if (m_promoters_enabled) {
+      // Constitutive regulation applied here
+      if (m_constitutive_regulation) Inst_SenseRegulate(ctx); 
 
-    // If there are no active promoters and a certain mode is set, then don't execute any further instructions
-    if (m_promoters_enabled && m_world->GetConfig().NO_ACTIVE_PROMOTER_EFFECT.Get() == 2 && m_promoter_index == -1) exec = false;
+      // If there are no active promoters and a certain mode is set, then don't execute any further instructions
+      if (m_no_active_promoter_halt && m_promoter_index == -1) exec = false;
+    }
     
     // Now execute the instruction...
     if (exec == true) {
@@ -520,7 +523,7 @@
     fp << " exe_inst=" << m_threads[m_cur_thread].GetPromoterInstExecuted();
     for (int i=0; i<m_promoters.GetSize(); i++)
     {
-      fp << setfill(' ') << setbase(10) << m_promoters[i].m_pos << ":";
+      fp << setfill(' ') << setbase(10) << m_promoters[i].pos << ":";
       fp << "Ox" << setbase(16) << setfill('0') << setw(8) << (m_promoters[i].GetRegulatedBitCode()) << " "; 
     }
     fp << endl;    
@@ -1038,7 +1041,7 @@
 bool cHardwareExperimental::Inst_Pop(cAvidaContext& ctx)
 {
   const int reg_used = FindModifiedRegister(REG_BX);
-  sInternalValue pop = StackPop();
+  sInternalValue pop = stackPop();
   setInternalValue(m_threads[m_cur_thread].reg[reg_used], pop.value, pop);
   return true;
 }
@@ -1055,7 +1058,7 @@
 }
 
 
-bool cHardwareExperimental::Inst_SwitchStack(cAvidaContext& ctx) { SwitchStack(); return true;}
+bool cHardwareExperimental::Inst_SwitchStack(cAvidaContext& ctx) { switchStack(); return true;}
 
 bool cHardwareExperimental::Inst_Swap(cAvidaContext& ctx)
 {
@@ -1540,7 +1543,7 @@
   const int reg_used = FindModifiedRegister(REG_BX);
   int regulation_code = GetRegister(reg_used);
   
-  for (int i = 0; i < m_promoters.GetSize(); i++) m_promoters[i].m_regulation = regulation_code;
+  for (int i = 0; i < m_promoters.GetSize(); i++) m_promoters[i].regulation = regulation_code;
 
   return true;
 }
@@ -1559,7 +1562,7 @@
     // @DMB - should this always be using the low order bits?
     
     // Look for consensus bit matches over the length of the promoter code
-    int test_p_code = m_promoters[i].m_bit_code;    
+    int test_p_code = m_promoters[i].bit_code;    
     int test_r_code = regulation_promoter;
     int bit_count = 0;
     for (int j = 0; j < m_world->GetConfig().PROMOTER_EXE_LENGTH.Get(); j++) {      
@@ -1568,7 +1571,7 @@
       test_r_code >>= 1;
     }
     
-    if (bit_count >= m_world->GetConfig().PROMOTER_EXE_LENGTH.Get() / 2) m_promoters[i].m_regulation = regulation_code;
+    if (bit_count >= m_world->GetConfig().PROMOTER_EXE_LENGTH.Get() / 2) m_promoters[i].regulation = regulation_code;
   }
   
   return true;
@@ -1589,7 +1592,7 @@
   
   for (int i=0; i< m_promoters.GetSize();i++)
   {
-    m_promoters[i].m_regulation = bits;
+    m_promoters[i].regulation = bits;
   }
   return true;
 }
@@ -1705,11 +1708,11 @@
   } else {
     // We found an active match, offset to just after it.
     // cHeadCPU will do the mod genome size for us
-    IP().Set(m_promoters[m_promoter_index].m_pos + 1);
+    IP().Set(m_promoters[m_promoter_index].pos + 1);
     
     // Put its bit code in BX for the organism to have if option is set
     if (m_world->GetConfig().PROMOTER_TO_REGISTER.Get())
-      setInternalValue(m_threads[m_cur_thread].reg[promoter_reg_used], m_promoters[m_promoter_index].m_bit_code);
+      setInternalValue(m_threads[m_cur_thread].reg[promoter_reg_used], m_promoters[m_promoter_index].bit_code);
   }  
 }
 

Modified: development/source/cpu/cHardwareExperimental.h
===================================================================
--- development/source/cpu/cHardwareExperimental.h	2008-12-13 21:03:31 UTC (rev 3032)
+++ development/source/cpu/cHardwareExperimental.h	2008-12-13 21:20:09 UTC (rev 3033)
@@ -81,7 +81,7 @@
 public:
   typedef bool (cHardwareExperimental::*tMethod)(cAvidaContext& ctx);
 
-protected:
+private:
   // --------  Structure Constants  --------
   static const int NUM_REGISTERS = 4;
   static const int NUM_HEADS = nHardware::NUM_HEADS >= NUM_REGISTERS ? nHardware::NUM_HEADS : NUM_REGISTERS;
@@ -89,7 +89,12 @@
   static const int NUM_NOPS = NUM_REGISTERS;
   
   
-  // --------  Data Structures  --------
+  // --------  Static Variables  --------
+  static tInstLib<cHardwareExperimental::tMethod>* s_inst_slib;
+  static tInstLib<cHardwareExperimental::tMethod>* initInstLib(void);
+  
+  
+  // --------  Define Internal Data Structures  --------
   struct sInternalValue
   {
     int value;
@@ -97,7 +102,7 @@
     // Actual age of this value
     unsigned int originated:15;
     unsigned int from_env:1;
-
+    
     // Age of the oldest component used to create this value
     unsigned int oldest_component:15;
     unsigned int env_component:1;
@@ -106,6 +111,7 @@
     inline sInternalValue& operator=(const sInternalValue& i);
   };
   
+  
   class cLocalStack
   {
 #define SIZE nHardware::STACK_SIZE
@@ -128,7 +134,8 @@
     inline void Clear() { for (int i = 0; i < SIZE; i++) m_stack[i].Clear(); }
 #undef SIZE
   };
-    
+
+
   struct cLocalThread
   {
   private:
@@ -136,7 +143,6 @@
     int m_promoter_inst_executed;
     unsigned int m_execurate;
     
-    
   public:
     sInternalValue reg[NUM_REGISTERS];
     cHeadCPU heads[NUM_HEADS];
@@ -158,18 +164,26 @@
     
     inline unsigned int GetExecurate() const { return m_execurate; }
     inline void UpdateExecurate(int code_len, unsigned int inst_code) { m_execurate <<= code_len; m_execurate |= inst_code; }      
-
+    
     inline int GetPromoterInstExecuted() const { return m_promoter_inst_executed; }
     inline void IncPromoterInstExecuted() { m_promoter_inst_executed++; }
     inline void ResetPromoterInstExecuted() { m_promoter_inst_executed = 0; }
   };
-
+  
+  
+  struct cPromoter 
+  {
+  public:
+    int pos;        // position within genome
+    int bit_code;   // bit code of promoter
+    int regulation;
     
-  // --------  Static Variables  --------
-  static tInstLib<cHardwareExperimental::tMethod>* s_inst_slib;
-  static tInstLib<cHardwareExperimental::tMethod>* initInstLib(void);
-
-
+    inline cPromoter(int p = 0, int bc = 0, int reg = 0) : pos(p), bit_code(bc), regulation(reg) { ; }
+    inline int GetRegulatedBitCode() { return bit_code ^ regulation; }
+    inline ~cPromoter() { ; }
+  };
+  
+    
   // --------  Member Variables  --------
   const tMethod* m_functions;
 
@@ -185,7 +199,7 @@
     unsigned int m_last_output:16;
   };
 
-  // Flags...
+  // Flags
   struct {
     bool m_mal_active:1;         // Has an allocate occured since last divide?
     bool m_advance_ip:1;         // Should the IP advance after this instruction?
@@ -196,7 +210,8 @@
     bool m_no_cpu_cycle_time:1;
     
     bool m_promoters_enabled:1;
-    bool m_constituative_regulation:1;
+    bool m_constitutive_regulation:1;
+    bool m_no_active_promoter_halt:1;
     
     bool m_slip_read_head:1;
 
@@ -204,84 +219,12 @@
   };
   
 
-  
-  // <-- Promoter model
-  int m_promoter_index;       //site to begin looking for the next active promoter from
-  int m_promoter_offset;      //bit offset when testing whether a promoter is on
-  
-  struct cPromoter 
-  {
-  public:
-    int m_pos;      //position within genome
-    int m_bit_code; //bit code of promoter
-    int m_regulation; //bit code of promoter
-
-    cPromoter(int pos = 0, int bc = 0, int reg = 0) : m_pos(pos), m_bit_code(bc), m_regulation(reg) { ; }
-    inline int GetRegulatedBitCode() { return m_bit_code ^ m_regulation; }
-    inline ~cPromoter() { ; }
-  };
+  // Promoter model
+  int m_promoter_index;       // site to begin looking for the next active promoter from
+  int m_promoter_offset;      // bit offset when testing whether a promoter is on
   tManagedPointerArray<cPromoter> m_promoters;
-  // Promoter Model -->
-  
-  
-  
-  
-  bool SingleProcess_ExecuteInst(cAvidaContext& ctx, const cInstruction& cur_inst);
-  
-  // --------  Stack Manipulation...  --------
-  inline sInternalValue StackPop();
-  inline void StackClear();
-  inline void SwitchStack();
-  
-  
-  // --------  Head Manipulation (including IP)  --------
-  cHeadCPU& GetActiveHead() { return m_threads[m_cur_thread].heads[m_threads[m_cur_thread].cur_head]; }
-  void AdjustHeads();
-  
-  
-  // --------  Label Manipulation  -------
-  const cCodeLabel& GetLabel() const { return m_threads[m_cur_thread].next_label; }
-  cCodeLabel& GetLabel() { return m_threads[m_cur_thread].next_label; }
-  void ReadLabel(int max_size=nHardware::MAX_LABEL_SIZE);
-  cHeadCPU FindLabelStart(bool mark_executed);
-  cHeadCPU FindLabelForward(bool mark_executed);
-  bool& ReadingLabel() { return m_threads[m_cur_thread].reading; }
-  const cCodeLabel& GetReadLabel() const { return m_threads[m_cur_thread].read_label; }
-  cCodeLabel& GetReadLabel() { return m_threads[m_cur_thread].read_label; }
-  
-  
-  // --------  Thread Manipulation  -------
-  bool ForkThread(); // Adds a new thread based off of m_cur_thread.
-  bool KillThread(); // Kill the current thread!
-  
-  
-  // ---------- Instruction Helpers -----------
-  int FindModifiedRegister(int default_register);
-  int FindModifiedNextRegister(int default_register);
-  int FindModifiedPreviousRegister(int default_register);
-  int FindModifiedHead(int default_head);
-  int FindNextRegister(int base_reg);
-  
-  bool Allocate_Necro(const int new_size);
-  bool Allocate_Random(cAvidaContext& ctx, const int old_size, const int new_size);
-  bool Allocate_Default(const int new_size);
-  bool Allocate_Main(cAvidaContext& ctx, const int allocated_size);
-  
 
-  void internalReset();
   
-  
-  int GetCopiedSize(const int parent_size, const int child_size);
-  
-  bool Divide_Main(cAvidaContext& ctx, const int divide_point, const int extra_lines=0, double mut_multiplier=1);
-
-  void Divide_DoTransposons(cAvidaContext& ctx);
-  
-  void InjectCode(const cGenome& injection, const int line_num);
-  
-  void ReadInst(const int in_inst);
-
-  
   cHardwareExperimental(const cHardwareExperimental&); // @not_implemented
   cHardwareExperimental& operator=(const cHardwareExperimental&); // @not_implemented
 
@@ -289,21 +232,24 @@
 public:
   cHardwareExperimental(cAvidaContext& ctx, cWorld* world, cOrganism* in_organism, cInstSet* in_inst_set);
   ~cHardwareExperimental() { ; }
+  
   static tInstLib<cHardwareExperimental::tMethod>* GetInstLib() { return s_inst_slib; }
   static cString GetDefaultInstFilename() { return "instset-experimental.cfg"; }
 
+
+  // --------  Core Execution Methods  --------
   bool SingleProcess(cAvidaContext& ctx, bool speculative = false);
   void ProcessBonusInst(cAvidaContext& ctx, const cInstruction& inst);
 
   
-  // --------  Helper methods  --------
+  // --------  Helper Methods  --------
   int GetType() const { return HARDWARE_TYPE_CPU_ORIGINAL; }  
   bool OK();
   void PrintStatus(std::ostream& fp);
 
 
-  // --------  Stack Manipulation...  --------
-  inline int GetStack(int depth=0, int stack_id=-1, int in_thread=-1) const;
+  // --------  Stack Manipulation  --------
+  inline int GetStack(int depth=0, int stack_id = -1, int in_thread = -1) const;
   inline int GetNumStacks() const { return 2; }
 
 
@@ -352,20 +298,83 @@
   bool InjectHost(const cCodeLabel& in_label, const cGenome& injection);
 
   
-  // Non-Standard Methods
-  
+  // --------  Non-Standard Methods  --------  
   int GetActiveStack() const { return m_threads[m_cur_thread].cur_stack; }
   bool GetMalActive() const   { return m_mal_active; }
   
+
 private:
   
+  // --------  Core Execution Methods  --------
+  bool SingleProcess_ExecuteInst(cAvidaContext& ctx, const cInstruction& cur_inst);
+  void internalReset();
+  
+  
+  // --------  Stack Manipulation  --------
+  inline sInternalValue stackPop();
+  inline void switchStack();
+  
+  
+  // --------  Head Manipulation (including IP)  --------
+  cHeadCPU& GetActiveHead() { return m_threads[m_cur_thread].heads[m_threads[m_cur_thread].cur_head]; }
+  void AdjustHeads();
+  
+  
+  // --------  Label Manipulation  -------
+  const cCodeLabel& GetLabel() const { return m_threads[m_cur_thread].next_label; }
+  cCodeLabel& GetLabel() { return m_threads[m_cur_thread].next_label; }
+  void ReadLabel(int max_size=nHardware::MAX_LABEL_SIZE);
+  cHeadCPU FindLabelStart(bool mark_executed);
+  cHeadCPU FindLabelForward(bool mark_executed);
+  bool& ReadingLabel() { return m_threads[m_cur_thread].reading; }
+  const cCodeLabel& GetReadLabel() const { return m_threads[m_cur_thread].read_label; }
+  cCodeLabel& GetReadLabel() { return m_threads[m_cur_thread].read_label; }
+  
+  
+  // --------  Thread Manipulation  -------
+  bool ForkThread(); // Adds a new thread based off of m_cur_thread.
+  bool KillThread(); // Kill the current thread!
+  
+  
+  // ---------- Instruction Helpers -----------
+  int FindModifiedRegister(int default_register);
+  int FindModifiedNextRegister(int default_register);
+  int FindModifiedPreviousRegister(int default_register);
+  int FindModifiedHead(int default_head);
+  int FindNextRegister(int base_reg);
+  
+  bool Allocate_Necro(const int new_size);
+  bool Allocate_Random(cAvidaContext& ctx, const int old_size, const int new_size);
+  bool Allocate_Default(const int new_size);
+  bool Allocate_Main(cAvidaContext& ctx, const int allocated_size);
+  
+  int GetCopiedSize(const int parent_size, const int child_size);
+  
+  
+  // --------  Division Support  -------
+  bool Divide_Main(cAvidaContext& ctx, const int divide_point, const int extra_lines=0, double mut_multiplier=1);
+  void Divide_DoTransposons(cAvidaContext& ctx);
+  
+
+  // --------  Parasite Stuff  --------
+  void InjectCode(const cGenome& injection, const int line_num);
+  
+  
   // ---------- Utility Functions -----------
   inline unsigned int BitCount(unsigned int value) const;
   inline void setInternalValue(sInternalValue& dest, int value, bool from_env = false);
   inline void setInternalValue(sInternalValue& dest, int value, const sInternalValue& src);
   inline void setInternalValue(sInternalValue& dest, int value, const sInternalValue& op1, const sInternalValue& op2);  
+
+  void ReadInst(const int in_inst);
   
   
+  // ---------- Promoter Helper Functions -----------
+  void PromoterTerminate(cAvidaContext& ctx);
+  int  Numberate(int _pos, int _dir, int _num_bits = 0);
+  bool Do_Numberate(cAvidaContext& ctx, int num_bits = 0);
+  
+
   // ---------- Instruction Library -----------
 
   // Flow Control
@@ -404,7 +413,7 @@
   bool Inst_TaskOutput(cAvidaContext& ctx);
   bool Inst_TaskOutputExpire(cAvidaContext& ctx);
 
-  // Head-based instructions...
+  // Head-based Instructions
   bool Inst_HeadAlloc(cAvidaContext& ctx);
   bool Inst_MoveHead(cAvidaContext& ctx);
   bool Inst_JumpHead(cAvidaContext& ctx);
@@ -423,7 +432,6 @@
   bool Inst_Goto(cAvidaContext& ctx);
   bool Inst_GotoConsensus(cAvidaContext& ctx);
   bool Inst_GotoConsensus24(cAvidaContext& ctx);
-  
 
   // Promoter Model
   bool Inst_Promoter(cAvidaContext& ctx);
@@ -435,21 +443,14 @@
   bool Inst_SenseRegulate(cAvidaContext& ctx);
   bool Inst_Numberate(cAvidaContext& ctx) { return Do_Numberate(ctx); };
   bool Inst_Numberate24(cAvidaContext& ctx) { return Do_Numberate(ctx, 24); };
-  bool Do_Numberate(cAvidaContext& ctx, int num_bits = 0);
-  
-  // Promoter Helper functions
-  void PromoterTerminate(cAvidaContext& ctx);
-  int  Numberate(int _pos, int _dir, int _num_bits = 0);
-  
-  
-  // Bit consensus functions
+  bool Inst_Execurate(cAvidaContext& ctx);
+  bool Inst_Execurate24(cAvidaContext& ctx);  
+
+  // Bit Consensus
   bool Inst_BitConsensus(cAvidaContext& ctx);
   bool Inst_BitConsensus24(cAvidaContext& ctx);
   
-  bool Inst_Execurate(cAvidaContext& ctx);
-  bool Inst_Execurate24(cAvidaContext& ctx);
-
-
+  // Replication
   bool Inst_Repro(cAvidaContext& ctx);
 };
 
@@ -486,7 +487,7 @@
   else m_cur_thread--;
 }
 
-inline cHardwareExperimental::sInternalValue cHardwareExperimental::StackPop()
+inline cHardwareExperimental::sInternalValue cHardwareExperimental::stackPop()
 {
   if (m_threads[m_cur_thread].cur_stack == 0) {
     return m_threads[m_cur_thread].stack.Pop();
@@ -510,17 +511,8 @@
   return value.value;
 }
 
-inline void cHardwareExperimental::StackClear()
+inline void cHardwareExperimental::switchStack()
 {
-  if (m_threads[m_cur_thread].cur_stack == 0) {
-    m_threads[m_cur_thread].stack.Clear();
-  } else {
-    m_global_stack.Clear();
-  }
-}
-
-inline void cHardwareExperimental::SwitchStack()
-{
   m_threads[m_cur_thread].cur_stack++;
   if (m_threads[m_cur_thread].cur_stack > 1) m_threads[m_cur_thread].cur_stack = 0;
 }




More information about the Avida-cvs mailing list