[Avida-SVN] r2502 - development/source/main

dknoester at myxo.css.msu.edu dknoester at myxo.css.msu.edu
Thu Mar 27 04:56:05 PDT 2008


Author: dknoester
Date: 2008-03-27 07:56:05 -0400 (Thu, 27 Mar 2008)
New Revision: 2502

Modified:
   development/source/main/cStats.cc
   development/source/main/cStats.h
Log:
Updated PrintDemeFounders to track all genotypes, as opposed to all unique genotypes.

Modified: development/source/main/cStats.cc
===================================================================
--- development/source/main/cStats.cc	2008-03-27 01:29:48 UTC (rev 2501)
+++ development/source/main/cStats.cc	2008-03-27 11:56:05 UTC (rev 2502)
@@ -1237,11 +1237,11 @@
 */
 void cStats::DemePostReplication(cDeme& source_deme, cDeme& target_deme)
 {
-  std::set<int> genotype_ids;
+  std::vector<int> genotype_ids;
   for(int i=0; i<target_deme.GetSize(); ++i) {
     cPopulationCell& cell = target_deme.GetCell(i);
     if(cell.IsOccupied()) {
-      genotype_ids.insert(cell.GetOrganism()->GetGenotype()->GetID());  
+      genotype_ids.push_back(cell.GetOrganism()->GetGenotype()->GetID());  
     }
   }
   assert(genotype_ids.size()>0); // How did we get to replication otherwise?
@@ -1301,11 +1301,9 @@
 /*! Print the genotype IDs of the founders of recently born demes.
 
 Prints only the most recent set of founding genotype ids for each deme.  If a deme was replaced multiple
-times since the last time this method ran, only the most recent is maintained.  Only deme "births" (i.e., due
+times since the last time this method ran, only the most recent is printed.  Only deme "births" (i.e., due
 to deme replication) are tracked; the ancestral deme founders are lost.  The update column is the update 
-at which this method executes, not the time at which the given deme was born.  Only unique genotype ids are
-recorded (if multiple individuals are cloned from source to target deme [propagule size > 1], only a single
-genotype id will appear in the datafile).          
+at which this method executes, not the time at which the given deme was born.
 */
 void cStats::PrintDemeFounders(const cString& filename)
 {
@@ -1322,7 +1320,7 @@
   std::ofstream& out = df.GetOFStream();
   for(t_founder_map::iterator i=m_deme_founders.begin(); i!=m_deme_founders.end(); ++i) {
     out << GetUpdate() << " " << i->first << " " << i->second.size();    
-    for(std::set<int>::iterator j=i->second.begin(); j!=i->second.end(); ++j) {
+    for(std::vector<int>::iterator j=i->second.begin(); j!=i->second.end(); ++j) {
       out << " " << *j;
     }
     df.Endl();

Modified: development/source/main/cStats.h
===================================================================
--- development/source/main/cStats.h	2008-03-27 01:29:48 UTC (rev 2501)
+++ development/source/main/cStats.h	2008-03-27 11:56:05 UTC (rev 2502)
@@ -31,7 +31,6 @@
 #include <iostream>
 #include <vector>
 #include <map>
-#include <set>
 
 #ifndef defs_h
 #include "defs.h"
@@ -716,7 +715,7 @@
   double GetAveGermlineGeneration() const { return m_germline_generation.Average(); }
   /*! Typedef of a data structure to track deme founders.
     * Map of deme id -> {founder genotype id_0, id_1,... id_{deme propagule size}} */
-  typedef std::map<int, std::set<int> > t_founder_map;
+  typedef std::map<int, std::vector<int> > t_founder_map;
   //! Print the genotype IDs for the founders of demes that have recently been "born."
   void PrintDemeFounders(const cString& filename);
 




More information about the Avida-cvs mailing list