[Avida-cvs] [avida-svn] r786 - in development/source: actions main

brysonda@myxo.css.msu.edu brysonda at myxo.css.msu.edu
Thu Jun 29 18:06:48 PDT 2006


Author: brysonda
Date: 2006-06-29 21:06:47 -0400 (Thu, 29 Jun 2006)
New Revision: 786

Modified:
   development/source/actions/LandscapeActions.cc
   development/source/main/cEnvironment.cc
   development/source/main/cMutationalNeighborhood.cc
   development/source/main/cMutationalNeighborhood.h
   development/source/main/cMutationalNeighborhoodResults.h
   development/source/main/cReactionResult.cc
   development/source/main/cReactionResult.h
Log:
Implement task accounting in cMutationalNeighborhood.   This essentially completes the implementation.

Also comment out some unused portions of cEnvironment and cReactionResult.  The side effect of the extra loop appears to be limited to modification of the receive_tasks bool array in cReactionResult.  As this array is not, and cannot, be accessed outside of cReactionResult at this time, it is fruitless to perform the tests.   The removal of instantiation, maintenance, and destruction of these unused arrays yields about a 9% performance improvement in single threaded landscape computation (given the default 9 task environment).  If this second loop becomes necessary in the future, a better method of determining which tasks to reevaluate should be devised.

Modified: development/source/actions/LandscapeActions.cc
===================================================================
--- development/source/actions/LandscapeActions.cc	2006-06-28 20:06:33 UTC (rev 785)
+++ development/source/actions/LandscapeActions.cc	2006-06-30 01:06:47 UTC (rev 786)
@@ -388,6 +388,7 @@
 {
 private:
   cString m_filename;
+  int m_target;
   
   struct sBatchEntry {
     cMutationalNeighborhood* mutn;
@@ -400,15 +401,16 @@
   
 public:
   cActionMutationalNeighborhood(cWorld* world, const cString& args)
-    : cAction(world, args), m_filename("mut-neighborhood.dat")
+    : cAction(world, args), m_filename("mut-neighborhood.dat"), m_target(-1)
   {
       cString largs(args);
       if (largs.GetSize()) m_filename = largs.PopWord();
+      if (largs.GetSize()) m_target = largs.PopWord().AsInt();
   }
   
   const cString GetDescription()
   {
-    return "MutationalNeighborhood [filename='mut-neighborhood.dat']";
+    return "MutationalNeighborhood [string fname='mut-neighborhood.dat'] [int target=-1]";
   }
   
   void Process(cAvidaContext& ctx)
@@ -429,7 +431,7 @@
       tListIterator<cAnalyzeGenotype> batch_it(m_world->GetAnalyze().GetCurrentBatch().List());
       cAnalyzeGenotype* genotype = NULL;
       while (genotype = batch_it.Next()) {
-        mutn = new cMutationalNeighborhood(m_world, genotype->GetGenome(), inst_set);
+        mutn = new cMutationalNeighborhood(m_world, genotype->GetGenome(), inst_set, m_target);
         m_batch.PushRear(new sBatchEntry(mutn, genotype->GetDepth()));
         jobqueue.AddJob(new tAnalyzeJob<cMutationalNeighborhood>(mutn, &cMutationalNeighborhood::Process));
       }
@@ -439,7 +441,7 @@
         m_world->GetDriver().NotifyComment("Calculating Mutational Neighborhood...");
       
       const cGenome& best_genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
-      mutn = new cMutationalNeighborhood(m_world, best_genome, inst_set);
+      mutn = new cMutationalNeighborhood(m_world, best_genome, inst_set, m_target);
 
       m_batch.PushRear(new sBatchEntry(mutn, m_world->GetStats().GetUpdate()));
       mutn->Process(ctx);

Modified: development/source/main/cEnvironment.cc
===================================================================
--- development/source/main/cEnvironment.cc	2006-06-28 20:06:33 UTC (rev 785)
+++ development/source/main/cEnvironment.cc	2006-06-30 01:06:47 UTC (rev 786)
@@ -696,34 +696,37 @@
     // Mark this reaction as occuring...
     result.MarkReaction(cur_reaction->GetID());
   }
+
+// @DMB - The following block of code only seems to affect MarkReceiveTask, the side effect of which
+//        is not used anywhere.
+//
+//  // Loop again to check receive tasks...
+//  // if (receive_buf.GetSize() != 0)
+//  {
+//    // Do setup for reaction tests...
+//    
+//    for (int i = 0; i < num_reactions; i++) {
+//      cReaction * cur_reaction = reaction_lib.GetReaction(i);
+//      assert(cur_reaction != NULL);
+//      
+//      // Only use active reactions...
+//      if (cur_reaction->GetActive() == false) continue;
+//      
+//      // Examine the task trigger associated with this reaction
+//      cTaskEntry * cur_task = cur_reaction->GetTask();
+//      assert(cur_task != NULL);
+//      const double task_quality = task_lib.TestOutput(*cur_task, &taskctx);
+//      const int task_id = cur_task->GetID();
+//      
+//      // If this task wasn't performed, move on to the next one.
+//      if (task_quality == 0.0) continue;
+//      
+//      // Mark this task as performed...
+//      result.MarkReceiveTask(task_id);
+//    }
+//  }
   
-  // Loop again to check receive tasks...
-  // if (receive_buf.GetSize() != 0)
-  {
-    // Do setup for reaction tests...
-    
-    for (int i = 0; i < num_reactions; i++) {
-      cReaction * cur_reaction = reaction_lib.GetReaction(i);
-      assert(cur_reaction != NULL);
-      
-      // Only use active reactions...
-      if (cur_reaction->GetActive() == false) continue;
-      
-      // Examine the task trigger associated with this reaction
-      cTaskEntry * cur_task = cur_reaction->GetTask();
-      assert(cur_task != NULL);
-      const double task_quality = task_lib.TestOutput(*cur_task, &taskctx);
-      const int task_id = cur_task->GetID();
-      
-      // If this task wasn't performed, move on to the next one.
-      if (task_quality == 0.0) continue;
-      
-      // Mark this task as performed...
-      result.MarkReceiveTask(task_id);
-    }
-  }
   
-  
   return result.GetActive();
 }
 

Modified: development/source/main/cMutationalNeighborhood.cc
===================================================================
--- development/source/main/cMutationalNeighborhood.cc	2006-06-28 20:06:33 UTC (rev 785)
+++ development/source/main/cMutationalNeighborhood.cc	2006-06-30 01:06:47 UTC (rev 786)
@@ -41,14 +41,13 @@
       cCPUTestInfo test_info;
       
       // Setup One Step Data
-      sOneStep& odata = m_onestep[cur_site];
+      sStep& odata = m_onestep[cur_site];
       odata.peak_fitness = m_base_fitness;
       odata.peak_genome = m_base_genome;
-      odata.fitness.Resize(m_inst_set.GetSize(), 0.0);
       odata.site_count.Resize(m_base_genome.GetSize(), 0);
 
       // Setup Data Used in Two Step
-      sTwoStep& tdata = m_twostep[cur_site];
+      sStep& tdata = m_twostep[cur_site];
       tdata.peak_fitness = m_base_fitness;
       tdata.peak_genome = m_base_genome;
       tdata.site_count.Resize(m_base_genome.GetSize(), 0);
@@ -86,11 +85,15 @@
   m_neut_min = m_base_fitness * nHardware::FITNESS_NEUTRAL_MIN;
   m_neut_max = m_base_fitness * nHardware::FITNESS_NEUTRAL_MAX;
   
+  // If invalid target supplied, set to the last task
+  if (m_target >= m_base_tasks.GetSize() || m_target < 0) m_target = m_base_tasks.GetSize() - 1;
+  
   delete testcpu;
 
   // Setup state to begin processing
   m_onestep.ResizeClear(m_base_genome.GetSize());
   m_twostep.ResizeClear(m_base_genome.GetSize());
+  m_fitness.ResizeClear(m_base_genome.GetSize(), m_inst_set.GetSize());
   
   m_cur_site = 0;
   m_completed = 0;
@@ -112,13 +115,16 @@
 void cMutationalNeighborhood::ProcessOneStep(cAvidaContext& ctx, cTestCPU* testcpu, cCPUTestInfo& test_info, int cur_site)
 {
   const int inst_size = m_inst_set.GetSize();
-  sOneStep& odata = m_onestep[cur_site];
+  sStep& odata = m_onestep[cur_site];
   
   cGenome mod_genome(m_base_genome);
   
   // Loop through all the lines of genome, testing trying all combinations.
   int cur_inst = mod_genome[cur_site].GetOp();
   
+  // Fill in unmutated entry in fitness table with base fitness
+  m_fitness[cur_site][cur_inst] = m_base_fitness;
+  
   // Loop through all instructions...
   for (int inst_num = 0; inst_num < inst_size; inst_num++) {
     if (cur_inst == inst_num) continue;
@@ -149,20 +155,27 @@
     
     if (test_fitness >= m_neut_min) odata.site_count[cur_site]++;
     
-    odata.fitness[cur_inst] = test_fitness;
-    odata.cur_tasks = test_info.GetColonyOrganism()->GetPhenotype().GetLastTaskCount();
-    
-    // @TODO - calculate task values
+    m_fitness[cur_site][cur_inst] = test_fitness;
 
-    //ProcessTwoStep(ctx, testcpu, test_info, cur_site, mod_genome);
+    const tArray<int>& cur_tasks = test_info.GetColonyOrganism()->GetPhenotype().GetLastTaskCount();    
+    bool knockout = false;
+    bool anytask = false;
+    for (int i = 0; i < m_base_tasks.GetSize(); i++) {
+      if (m_base_tasks[i] && !cur_tasks[i]) knockout = true;
+      else if (!m_base_tasks[i] && cur_tasks[i]) anytask = true;
+    }
+    if (knockout) odata.task_knockout++;
+    if (anytask) odata.task_total++;
+    if (m_base_tasks.GetSize() && !m_base_tasks[m_target] && cur_tasks[m_target]) odata.task_target++;
+
+    ProcessTwoStep(ctx, testcpu, test_info, cur_site, mod_genome);
   }
 }
 
 void cMutationalNeighborhood::ProcessTwoStep(cAvidaContext& ctx, cTestCPU* testcpu, cCPUTestInfo& test_info, int cur_site, cGenome& mod_genome)
 {
   const int inst_size = m_inst_set.GetSize();
-  sOneStep& odata = m_onestep[cur_site];
-  sTwoStep& tdata = m_twostep[cur_site];
+  sStep& tdata = m_twostep[cur_site];
 
   // Loop through remaining lines of genome, testing trying all combinations.
   for (int line_num = cur_site + 1; line_num < m_base_genome.GetSize(); line_num++) {
@@ -198,7 +211,22 @@
       
       if (test_fitness >= m_neut_min) tdata.site_count[line_num]++;
       
-      // @TODO - calculate task values
+      const tArray<int>& cur_tasks = test_info.GetColonyOrganism()->GetPhenotype().GetLastTaskCount();    
+      bool knockout = false;
+      bool anytask = false;
+      for (int i = 0; i < m_base_tasks.GetSize(); i++) {
+        if (m_base_tasks[i] && !cur_tasks[i]) knockout = true;
+        else if (!m_base_tasks[i] && cur_tasks[i]) anytask = true;
+      }
+      if (knockout) tdata.task_knockout++;
+      if (anytask) tdata.task_total++;
+      if (m_base_tasks.GetSize() && !m_base_tasks[m_target] && cur_tasks[m_target]) {
+        tdata.task_target++;
+        // Push both instructions as possible first mutations, for post determination of relative fitness
+        m_pending.Push(new sPendingTarget(cur_site, mod_genome[cur_site].GetOp()));
+        m_pending.Push(new sPendingTarget(line_num, inst_num));
+      }
+      
     }
     
     mod_genome[line_num].SetOp(cur_inst);
@@ -226,7 +254,7 @@
   m_o_task_knockout = 0;
 
   for (int i = 0; i < m_onestep.GetSize(); i++) {
-    sOneStep& odata = m_onestep[i];
+    sStep& odata = m_onestep[i];
     m_o_total += odata.total;
     m_o_total_fitness += odata.total_fitness;
     m_o_total_sqr_fitness += odata.total_sqr_fitness;
@@ -247,7 +275,9 @@
       m_o_site_count[j] += odata.site_count[j];
     }
       
-    // @TODO - aggregate task data
+    m_o_task_target += odata.task_target;
+    m_o_task_total += odata.task_total;
+    m_o_task_knockout += odata.task_knockout;
   }
   
   const double max_ent = log(static_cast<double>(m_inst_set.GetSize()));
@@ -281,7 +311,7 @@
   m_t_task_knockout = 0;
   
   for (int i = 0; i < m_twostep.GetSize(); i++) {
-    sTwoStep& tdata = m_twostep[i];
+    sStep& tdata = m_twostep[i];
     m_t_total += tdata.total;
     m_t_total_fitness += tdata.total_fitness;
     m_t_total_sqr_fitness += tdata.total_sqr_fitness;
@@ -302,7 +332,9 @@
       m_t_site_count[j] += tdata.site_count[j];
     }
       
-    // @TODO - aggregate task data
+    m_t_task_target += tdata.task_target;
+    m_t_task_total += tdata.task_total;
+    m_t_task_knockout += tdata.task_knockout;
   }
 
   for (int i = 0; i < m_base_genome.GetSize(); i++) {
@@ -312,25 +344,44 @@
   }
   m_t_complexity = m_base_genome.GetSize() - m_t_total_entropy;
 
+  // @TODO - Do post relative fitness determination for target task counts
+  sPendingTarget* pend = NULL;
+  while (pend = m_pending.Pop()) {
+    double fitness = m_fitness[pend->site][pend->inst];
+    
+    if (fitness == 0.0)
+      m_t_task_target_dead++;
+    else if (fitness < m_neut_min)
+      m_t_task_target_neg++;
+    else if (fitness <= m_neut_max)
+      m_t_task_target_neut++;
+    else
+      m_t_task_target_pos++;
+    
+    delete pend;
+  }
   
   pthread_rwlock_unlock(&m_rwlock);
 }
 
 
-void cMutationalNeighborhood::PrintStats(cDataFile& df, int update)
+void cMutationalNeighborhood::PrintStats(cDataFile& df, int update) const
 {
   df.Write(update, "Update/Tree Depth");
   
+  df.Write(GetTargetTask(), "Target Task");
+
   df.Write(GetBaseFitness(), "Base Fitness");
   df.Write(GetBaseMerit(), "Base Merit");
   df.Write(GetBaseGestation(), "Base Gestation");
   df.Write(GetBaseGenome().GetSize(), "Base Genome Length");
+  df.Write(GetBaseTargetTask(), "Base Performs Target Task");
 
   df.Write(GetSingleTotal(), "Total One Step Mutants");
   df.Write(GetSingleProbPos(), "One Step Probability Positive");
   df.Write(GetSingleProbNeg(), "One Step Probability Deleterious");
   df.Write(GetSingleProbNeut(), "One Step Probability Neutral");
-  df.Write(GetSingleProbDead(), "One Step Probability Dead");
+  df.Write(GetSingleProbDead(), "One Step Probability Fatal");
   df.Write(GetSingleAverageSizePos(), "One Step Average Positive Size");
   df.Write(GetSingleAverageSizeNeg(), "One Step Average Negative Size");
   df.Write(GetSinglePeakFitness(), "One Step Peak Fitness");
@@ -338,15 +389,18 @@
   df.Write(GetSingleAverageSqrFitness(), "One Step Average Square Fitness");
   df.Write(GetSingleTotalEntropy(), "One Step Total Entropy");
   df.Write(GetSingleComplexity(), "One Step Total Complexity");
+  df.Write(GetSingleTargetTask(), "One Step Confers Target Task");
   df.Write(GetSingleProbTargetTask(), "One Step Probability Confers Target Task");
+  df.Write(GetSingleTask(), "One Step Confers Any Task");
   df.Write(GetSingleProbTask(), "One Step Probability Confers Any Task");
+  df.Write(GetSingleKnockout(), "One Step Knockout Task");
   df.Write(GetSingleProbKnockout(), "One Step Probability Knockout Task");
 
   df.Write(GetDoubleTotal(), "Total Two Step Mutants");
   df.Write(GetDoubleProbPos(), "Two Step Probability Positive");
   df.Write(GetDoubleProbNeg(), "Two Step Probability Deleterious");
+  df.Write(GetDoubleProbNeut(), "Two Step Probability Neutral");
   df.Write(GetDoubleProbDead(), "Two Step Probability Fatal");
-  df.Write(GetDoubleProbNeut(), "Two Step Probability Neutral");
   df.Write(GetDoubleAverageSizePos(), "Two Step Average Positive Size");
   df.Write(GetDoubleAverageSizeNeg(), "Two Step Average Negative Size");
   df.Write(GetDoublePeakFitness(), "Two Step Peak Fitness");
@@ -354,12 +408,19 @@
   df.Write(GetDoubleAverageSqrFitness(), "Two Step Average Square Fitness");
   df.Write(GetDoubleTotalEntropy(), "Two Step Total Entropy");
   df.Write(GetDoubleComplexity(), "Two Step Total Complexity");
+  df.Write(GetDoubleTargetTask(), "Two Step Confers Target Task");
   df.Write(GetDoubleProbTargetTask(), "Two Step Probability Confers Target Task");
+  df.Write(GetDoubleTargetTaskPos(), "Two Step Confers Target - Previous Positive");
   df.Write(GetDoubleProbTargetTaskPos(), "Two Step Prob. Confers Target - Previous Positive");
+  df.Write(GetDoubleTargetTaskNeg(), "Two Step Confers Target - Previous Deleterious");
   df.Write(GetDoubleProbTargetTaskNeg(), "Two Step Prob. Confers Target - Previous Deleterious");
+  df.Write(GetDoubleTargetTaskNeut(), "Two Step Confers Target - Previous Neutral");
   df.Write(GetDoubleProbTargetTaskNeut(), "Two Step Prob. Confers Target - Previous Neutral");
+  df.Write(GetDoubleTargetTaskDead(), "Two Step Confers Target - Previous Fatal");
   df.Write(GetDoubleProbTargetTaskDead(), "Two Step Prob. Confers Target - Previous Fatal");
+  df.Write(GetDoubleTask(), "Two Step Confers Any Task");
   df.Write(GetDoubleProbTask(), "Two Step Probability Confers Any Task");
+  df.Write(GetDoubleKnockout(), "Two Step Knockout Task");
   df.Write(GetDoubleProbKnockout(), "Two Step Probability Knockout Task");
   
   df.Endl();

Modified: development/source/main/cMutationalNeighborhood.h
===================================================================
--- development/source/main/cMutationalNeighborhood.h	2006-06-28 20:06:33 UTC (rev 785)
+++ development/source/main/cMutationalNeighborhood.h	2006-06-30 01:06:47 UTC (rev 786)
@@ -19,6 +19,12 @@
 #ifndef tArray_h
 #include "tArray.h"
 #endif
+#ifndef tList_h
+#include "tList.h"
+#endif
+#ifndef tMatrix_h
+#include "tMatrix.h"
+#endif
 
 #include <pthread.h>
 
@@ -47,7 +53,7 @@
   int m_cur_site;
   int m_completed;
   
-  struct sOneStep
+  struct sStep
   {
     int total;
     
@@ -69,48 +75,25 @@
     int task_total;
     int task_knockout;
 
-    // state used in two step calculations
-    tArray<double> fitness;
-    tArray<int> cur_tasks;
     
-    sOneStep() : total(0), total_fitness(0.0), total_sqr_fitness(0.0), peak_fitness(0.0), dead(0), neg(0), neut(0), pos(0),
+    sStep() : total(0), total_fitness(0.0), total_sqr_fitness(0.0), peak_fitness(0.0), dead(0), neg(0), neut(0), pos(0),
       size_pos(0.0), size_neg(0.0), task_target(0), task_total(0), task_knockout(0) { ; }
   };
-  tArray<sOneStep> m_onestep;
+  tArray<sStep> m_onestep;
+  tArray<sStep> m_twostep;
+
+  tMatrix<double> m_fitness;
   
-  struct sTwoStep
+  struct sPendingTarget
   {
-    int total;
-    
-    double total_fitness;
-    double total_sqr_fitness;
-    cGenome peak_genome;
-    double peak_fitness;
-    
-    int dead;
-    int neg;
-    int neut;
-    int pos;
-    double size_pos;
-    double size_neg;
-    
-    tArray<int> site_count;
-    
-    int task_target;
-    int task_target_pos;
-    int task_target_neg;
-    int task_target_neut;
-    int task_target_dead;
-    int task_total;
-    int task_knockout;
-    
-    sTwoStep() : total(0), total_fitness(0.0), total_sqr_fitness(0.0), peak_fitness(0.0), dead(0), neg(0), neut(0), pos(0),
-      size_pos(0.0), size_neg(0.0), task_target(0), task_target_pos(0), task_target_neg(0), task_target_dead(0),
-      task_total(0), task_knockout(0) { ; }
+    int site;
+    int inst;
+    sPendingTarget(int in_site, int in_inst) : site(in_site), inst(in_inst) { ; }
   };
-  tArray<sTwoStep> m_twostep;
+  tList<sPendingTarget> m_pending;
   
-  const cInstSet& m_inst_set;
+  const cInstSet& m_inst_set;  
+  int m_target;
   
   // Base data
   // --------------------------------------------------------------------------
@@ -187,8 +170,8 @@
   cMutationalNeighborhood& operator=(const cMutationalNeighborhood&); // @not_implemented
   
 public:
-  cMutationalNeighborhood(cWorld* world, const cGenome& genome, const cInstSet& inst_set)
-  : m_world(world), m_initialized(false), m_inst_set(inst_set), m_base_genome(genome)
+  cMutationalNeighborhood(cWorld* world, const cGenome& genome, const cInstSet& inst_set, int target)
+  : m_world(world), m_initialized(false), m_inst_set(inst_set), m_target(target), m_base_genome(genome)
   {
     pthread_rwlock_init(&m_rwlock, NULL);
     pthread_mutex_init(&m_mutex, NULL);
@@ -207,13 +190,19 @@
   
 // These methods can only be accessed via a cMutationalNeighborhoodResults object
 private:
-  void PrintStats(cDataFile& df, int update = -1);
+  void PrintStats(cDataFile& df, int update = -1) const;
   
+  inline int GetTargetTask() const { return m_target; }
+
   inline const cGenome& GetBaseGenome() const { return m_base_genome; }
   inline double GetBaseFitness() const { return m_base_fitness; }
   inline double GetBaseMerit() const { return m_base_merit; }
   inline double GetBaseGestation() const { return m_base_gestation; }
-  
+  inline bool GetBaseTargetTask() const
+  {
+    if (m_base_tasks.GetSize()) return m_base_tasks[m_target]; else return false;
+  }
+
   inline int GetSingleTotal() const { return m_o_total; }
   
   inline double GetSingleAverageFitness() const { return m_o_total_fitness / m_o_total; }
@@ -259,13 +248,25 @@
   inline int GetDoubleTargetTask() const { return m_t_task_target; }
   inline double GetDoubleProbTargetTask() const { return static_cast<double>(m_t_task_target) / m_t_total; }
   inline int GetDoubleTargetTaskPos() const { return m_t_task_target_pos; }
-  inline double GetDoubleProbTargetTaskPos() const { return static_cast<double>(m_t_task_target_pos) / m_t_total; }
+  inline double GetDoubleProbTargetTaskPos() const
+  {
+    if (m_t_task_target == 0) return 0.0; else return static_cast<double>(m_t_task_target_pos) / (2 * m_t_task_target);
+  }
   inline int GetDoubleTargetTaskNeg() const { return m_t_task_target_neg; }
-  inline double GetDoubleProbTargetTaskNeg() const { return static_cast<double>(m_t_task_target_neg) / m_t_total; }
+  inline double GetDoubleProbTargetTaskNeg() const
+  {
+    if (m_t_task_target == 0) return 0.0; else return static_cast<double>(m_t_task_target_neg) / (2 * m_t_task_target);
+  }
   inline int GetDoubleTargetTaskNeut() const { return m_t_task_target_neut; }
-  inline double GetDoubleProbTargetTaskNeut() const { return static_cast<double>(m_t_task_target_neut) / m_t_total; }
+  inline double GetDoubleProbTargetTaskNeut() const
+  {
+    if (m_t_task_target == 0) return 0.0; else return static_cast<double>(m_t_task_target_neut) / (2 * m_t_task_target);
+  }
   inline int GetDoubleTargetTaskDead() const { return m_t_task_target_dead; }
-  inline double GetDoubleProbTargetTaskDead() const { return static_cast<double>(m_t_task_target_dead) / m_t_total; }
+  inline double GetDoubleProbTargetTaskDead() const
+  {
+    if (m_t_task_target == 0) return 0.0; else return static_cast<double>(m_t_task_target_dead) / (2 * m_t_task_target);
+  }
   inline int GetDoubleTask() const { return m_t_task_total; }
   inline double GetDoubleProbTask() const { return static_cast<double>(m_t_task_total) / m_t_total; }
   inline int GetDoubleKnockout() const { return m_t_task_knockout; }

Modified: development/source/main/cMutationalNeighborhoodResults.h
===================================================================
--- development/source/main/cMutationalNeighborhoodResults.h	2006-06-28 20:06:33 UTC (rev 785)
+++ development/source/main/cMutationalNeighborhoodResults.h	2006-06-30 01:06:47 UTC (rev 786)
@@ -40,10 +40,13 @@
   
   inline void PrintStats(cDataFile& df, int update = -1) const { m_src.PrintStats(df, update); }
   
+  inline int GetTargetTask() const { return m_src.GetTargetTask(); }
+  
   inline const cGenome& GetBaseGenome() const { return m_src.GetBaseGenome(); }
   inline double GetBaseFitness() const { return m_src.GetBaseFitness(); }
   inline double GetBaseMerit() const { return m_src.GetBaseMerit(); }
   inline double GetBaseGestation() const { return m_src.GetBaseGestation(); }
+  inline bool GetBaseTargetTask() const { return m_src.GetBaseTargetTask(); }
   
   inline int GetSingleTotal() const { return m_src.GetSingleTotal(); }
   

Modified: development/source/main/cReactionResult.cc
===================================================================
--- development/source/main/cReactionResult.cc	2006-06-28 20:06:33 UTC (rev 785)
+++ development/source/main/cReactionResult.cc	2006-06-30 01:06:47 UTC (rev 786)
@@ -19,8 +19,8 @@
   , resources_detected(num_resources)
   , tasks_done(num_tasks)
   , tasks_quality(num_tasks)
-  , receive_tasks_done(num_tasks)
-  , send_tasks_done(num_tasks)
+// @DMB - not used -  , receive_tasks_done(num_tasks)
+// @DMB - not used -  , send_tasks_done(num_tasks)
   , reactions_triggered(num_reactions)
   , bonus_add(0.0)
   , bonus_mult(1.0)
@@ -41,8 +41,8 @@
   resources_detected.SetAll(-1.0);
   tasks_done.SetAll(false);
   tasks_quality.SetAll(0.0);
-  receive_tasks_done.SetAll(false);
-  send_tasks_done.SetAll(false);
+// @DMB - not used - receive_tasks_done.SetAll(false);
+// @DMB - not used - send_tasks_done.SetAll(false);
   reactions_triggered.SetAll(false);
 
   // And finally note that this is indeed already active.
@@ -84,20 +84,19 @@
 }
 
 
-void cReactionResult::MarkReceiveTask(int id)
-{
-  ActivateReaction();
-  receive_tasks_done[id] = true;
-}
+// @DMB - not used - void cReactionResult::MarkReceiveTask(int id)
+// @DMB - not used - {
+// @DMB - not used -   ActivateReaction();
+// @DMB - not used -   receive_tasks_done[id] = true;
+// @DMB - not used - }
 
+// @DMB - not used - void cReactionResult::MarkSendTask(int id)
+// @DMB - not used - {
+// @DMB - not used -   ActivateReaction();
+// @DMB - not used -   send_tasks_done[id] = true;
+// @DMB - not used - }
 
-void cReactionResult::MarkSendTask(int id)
-{
-  ActivateReaction();
-  send_tasks_done[id] = true;
-}
 
-
 void cReactionResult::MarkReaction(int id)
 {
   ActivateReaction();

Modified: development/source/main/cReactionResult.h
===================================================================
--- development/source/main/cReactionResult.h	2006-06-28 20:06:33 UTC (rev 785)
+++ development/source/main/cReactionResult.h	2006-06-30 01:06:47 UTC (rev 786)
@@ -22,8 +22,8 @@
   tArray<double> resources_detected;  //Initialize to -1.0
   tArray<bool> tasks_done;
   tArray<double> tasks_quality;
-  tArray<bool> receive_tasks_done;
-  tArray<bool> send_tasks_done;
+// @DMB - not used -   tArray<bool> receive_tasks_done;
+// @DMB - not used -   tArray<bool> send_tasks_done;
   tArray<bool> reactions_triggered;
   double bonus_add;
   double bonus_mult;
@@ -50,8 +50,8 @@
   void Lethal(bool flag);
   void MarkTask(int id, const double quality=1);
 
-  void MarkReceiveTask(int id);
-  void MarkSendTask(int id);
+// @DMB - not used -   void MarkReceiveTask(int id);
+// @DMB - not used -   void MarkSendTask(int id);
   void MarkReaction(int id);
   void AddBonus(double value);
   void MultBonus(double value);




More information about the Avida-cvs mailing list