[Avida-SVN] r3518 - branches/topology-manager/source/main

pakanati at myxo.css.msu.edu pakanati at myxo.css.msu.edu
Fri Oct 30 21:45:29 PDT 2009


Author: pakanati
Date: 2009-10-31 00:45:29 -0400 (Sat, 31 Oct 2009)
New Revision: 3518

Modified:
   branches/topology-manager/source/main/cTopologyManager.cc
   branches/topology-manager/source/main/cWorld.h
Log:
Broken topology manager update again...

Modified: branches/topology-manager/source/main/cTopologyManager.cc
===================================================================
--- branches/topology-manager/source/main/cTopologyManager.cc	2009-10-30 21:34:56 UTC (rev 3517)
+++ branches/topology-manager/source/main/cTopologyManager.cc	2009-10-31 04:45:29 UTC (rev 3518)
@@ -203,14 +203,15 @@
 
 }
 
+/*
 cTopologyManager::InitiateTop()
 {
 
 }
+*/
 
 
 
-
 /*! Compete all demes with each other based on the given vector of fitness values.
 
 This form of compete demes uses fitness-proportional selection on a vector of deme
@@ -914,7 +915,8 @@
 @todo Fix lineage label on injected genomes.
 @todo Different strategies for non-random placement.
 */
-void cTopologyManager::SeedDeme(cDeme& deme, cGenome& genome) {
+void cTopologyManager::SeedDeme(cDeme& deme, cGenome& genome)
+{
   // Kill all the organisms in the deme.
   deme.KillAll();
 
@@ -926,7 +928,8 @@
   }
 }
 
-void cTopologyManager::SeedDeme(cDeme& _deme, cGenotype& _genotype) {
+void cTopologyManager::SeedDeme(cDeme& _deme, cGenotype& _genotype)
+{
   // Kill all the organisms in the deme.
   _deme.KillAll();
   _deme.ClearFounders();
@@ -945,7 +948,8 @@
 All organisms in the target deme are terminated, and a subset of the organisms in
 the source will be cloned to the target. Returns whether target deme was successfully seeded.
 */
-bool cTopologyManager::SeedDeme(cDeme& source_deme, cDeme& target_deme) {
+bool cTopologyManager::SeedDeme(cDeme& source_deme, cDeme& target_deme)
+{
   cRandom& random = m_world->GetRandom();
 
   bool successfully_seeded = true;
@@ -1512,7 +1516,7 @@
     // then we might do something like this... (untested)
     //organism->SetPhenotype(*_phenotype);
     // Re-initialize the time-slice for this new organism.
-    //AdjustSchedule(_cell_id, organism->GetPhenotype().GetMerit());
+    //AdjustSchedule(_cell_id, organism->GetPhenotype().GetMerit());ana
 
     // For now, just copy the generation...
     organism->GetPhenotype().SetGeneration( _phenotype->GetGeneration() );
@@ -1543,7 +1547,8 @@
 already.  Used for replicating multiple organisms from the source to the
 target deme in a sensible fashion.
 */
-int cTopologyManager::DemeSelectInjectionCell(cDeme& deme, int sequence) {
+int cTopologyManager::DemeSelectInjectionCell(cDeme& deme, int sequence)
+{
   int cellid = -1;
 
   assert(sequence < deme.GetSize()); // cannot inject a sequence bigger then the deme
@@ -1756,7 +1761,8 @@
   InjectClone( cell2_id, *(cell_array[cell1_id].GetOrganism()) );
 }
 
-void cTopologyManager::AddDemePred(cString type, int times) {
+void cTopologyManager::AddDemePred(cString type, int times)
+{
   if(type == "EventReceivedCenter") {
     for (int deme_id = 0; deme_id < deme_array.GetSize(); deme_id++) {
       deme_array[deme_id].AddEventReceivedCenterPred(times);
@@ -1798,7 +1804,8 @@
 }
 
 // Print out all statistics about individual demes
-void cTopologyManager::PrintDemeAllStats() {
+void cTopologyManager::PrintDemeAllStats()
+{
   PrintDemeFitness();
   PrintDemeLifeFitness();
   PrintDemeMerit();
@@ -1816,7 +1823,8 @@
   }
 }
 
-void cTopologyManager::PrintDemeTestamentStats(const cString& filename) {
+void cTopologyManager::PrintDemeTestamentStats(const cString& filename)
+{
   cStats& stats = m_world->GetStats();
 
   cDataFile& df = m_world->GetDataFile(filename);
@@ -1835,7 +1843,8 @@
   stats.SumEnergyTestamentToNeighborOrganisms().Clear();
 }
 
-void cTopologyManager::PrintCurrentMeanDemeDensity(const cString& filename) {
+void cTopologyManager::PrintCurrentMeanDemeDensity(const cString& filename)
+{
 	cDoubleSum demeDensity;
 	demeDensity.Clear();
 	const int num_demes = deme_array.GetSize();
@@ -1852,7 +1861,8 @@
 }
 
 // Print some stats about the energy sharing behavior of each deme
-void cTopologyManager::PrintDemeEnergySharingStats() {
+void cTopologyManager::PrintDemeEnergySharingStats()
+{
   const int num_demes = deme_array.GetSize();
   cStats& stats = m_world->GetStats();
   cDataFile & df_donor = m_world->GetDataFile("deme_energy_sharing.dat");
@@ -1906,7 +1916,8 @@
 // Print some stats about the distribution of energy among the cells in a deme
 // If a cell is occupied, the amount returned is that of the organism in that cell
 // If a cell is not occupied, the amount returned is the amount of energy resource in the cell
-void cTopologyManager::PrintDemeEnergyDistributionStats() {
+void cTopologyManager::PrintDemeEnergyDistributionStats()
+{
   const int num_demes = deme_array.GetSize();
   cStats& stats = m_world->GetStats();
   cString comment;
@@ -1956,7 +1967,8 @@
 // Print some stats about the distribution of energy among the organism in a deme
 // If a cell is occupied, the amount returned is that of the organism in that cell
 // If a cell is not occupied, 0 energy is returned for that cell.
-void cTopologyManager::PrintDemeOrganismEnergyDistributionStats() {
+void cTopologyManager::PrintDemeOrganismEnergyDistributionStats()
+{
   const int num_demes = deme_array.GetSize();
   cStats& stats = m_world->GetStats();
   cString comment;
@@ -2003,7 +2015,8 @@
 } //End PrintDemeOrganismEnergyDistributionStats()
 
 
-void cTopologyManager::PrintDemeDonor() {
+void cTopologyManager::PrintDemeDonor()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   cDataFile & df_donor = m_world->GetDataFile("deme_donor.dat");
@@ -2028,7 +2041,8 @@
   df_donor.Endl();
 }
 
-void cTopologyManager::PrintDemeFitness() {
+void cTopologyManager::PrintDemeFitness()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   cDataFile & df_fit = m_world->GetDataFile("deme_fitness.dat");
@@ -2053,7 +2067,8 @@
   df_fit.Endl();
 }
 
-void cTopologyManager::PrintDemeTotalAvgEnergy() {
+void cTopologyManager::PrintDemeTotalAvgEnergy()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   cDataFile & df_fit = m_world->GetDataFile("deme_totalAvgEnergy.dat");
@@ -2070,7 +2085,8 @@
 	df_fit.Endl();
 }
 
-void cTopologyManager::PrintDemeGestationTime() {
+void cTopologyManager::PrintDemeGestationTime()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   cDataFile & df_gest = m_world->GetDataFile("deme_gest_time.dat");
@@ -2095,7 +2111,8 @@
   df_gest.Endl();
 }
 
-void cTopologyManager::PrintDemeInstructions() {
+void cTopologyManager::PrintDemeInstructions()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   const int num_inst = m_world->GetNumInstructions();
@@ -2132,7 +2149,8 @@
   }
 }
 
-void cTopologyManager::PrintDemeLifeFitness() {
+void cTopologyManager::PrintDemeLifeFitness()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   cDataFile & df_life_fit = m_world->GetDataFile("deme_lifetime_fitness.dat");
@@ -2157,7 +2175,8 @@
   df_life_fit.Endl();
 }
 
-void cTopologyManager::PrintDemeMerit() {
+void cTopologyManager::PrintDemeMerit()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   cDataFile & df_merit = m_world->GetDataFile("deme_merit.dat");
@@ -2182,7 +2201,8 @@
   df_merit.Endl();
 }
 
-void cTopologyManager::PrintDemeMutationRate() {
+void cTopologyManager::PrintDemeMutationRate()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   cDataFile & df_mut_rates = m_world->GetDataFile("deme_mut_rates.dat");
@@ -2209,7 +2229,8 @@
   df_mut_rates.Endl();
 }
 
-void cTopologyManager::PrintDemeReceiver() {
+void cTopologyManager::PrintDemeReceiver()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   cDataFile & df_receiver = m_world->GetDataFile("deme_receiver.dat");
@@ -2234,7 +2255,8 @@
   df_receiver.Endl();
 }
 
-void cTopologyManager::PrintDemeResource() {
+void cTopologyManager::PrintDemeResource()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   cDataFile & df_resources = m_world->GetDataFile("deme_resources.dat");
@@ -2259,7 +2281,8 @@
 }
 
 // Write spatial energy data to a file that can easily be read into Matlab
-void cTopologyManager::PrintDemeSpatialEnergyData() const {
+void cTopologyManager::PrintDemeSpatialEnergyData() const
+{
   int cellID = 0;
   int update = m_world->GetStats().GetUpdate();
 
@@ -2288,7 +2311,8 @@
 }
 
 // Write spatial data to a file that can easily be read into Matlab
-void cTopologyManager::PrintDemeSpatialResData(const cResourceCount& res, const int i, const int deme_id) const {
+void cTopologyManager::PrintDemeSpatialResData(const cResourceCount& res, const int i, const int deme_id) const
+{
   const char* tmpResName = res.GetResName(i);
   cString tmpfilename = cStringUtil::Stringf( "deme_spatial_resource_%s.m", tmpResName );
   cDataFile& df = m_world->GetDataFile(tmpfilename);
@@ -2308,7 +2332,8 @@
 }
 
 // Write spatial energy data to a file that can easily be read into Matlab
-void cTopologyManager::PrintDemeSpatialSleepData() const {
+void cTopologyManager::PrintDemeSpatialSleepData() const
+{
   int cellID = 0;
   cString tmpfilename = "deme_spatial_sleep.m";
   cDataFile& df = m_world->GetDataFile(tmpfilename);
@@ -2336,7 +2361,8 @@
   }
 }
 
-void cTopologyManager::PrintDemeTasks() {
+void cTopologyManager::PrintDemeTasks()
+{
   cStats& stats = m_world->GetStats();
   const int num_demes = deme_array.GetSize();
   const int num_task = environment.GetNumTasks();
@@ -2369,7 +2395,8 @@
   df_task.Endl();
 }
 
-void cTopologyManager::DumpDemeFounders(ofstream& fp) {
+void cTopologyManager::DumpDemeFounders(ofstream& fp)
+{
   fp << "#filetype deme_founders" << endl
   << "#format deme_id num_founders genotype_ids" << endl
   << endl
@@ -2646,7 +2673,7 @@
   schedule->SetChangeList(change_list);
 }
 
-cChangeList *cPopulation::GetChangeList()
+cChangeList *cTopologyManager::GetChangeList()
 {
   return schedule->GetChangeList();
 }

Modified: branches/topology-manager/source/main/cWorld.h
===================================================================
--- branches/topology-manager/source/main/cWorld.h	2009-10-30 21:34:56 UTC (rev 3517)
+++ branches/topology-manager/source/main/cWorld.h	2009-10-31 04:45:29 UTC (rev 3518)
@@ -137,11 +137,12 @@
   // @DMB - Inherited from cAvidaDriver heritage
   void GetEvents(cAvidaContext& ctx);
 
-	cEventList* GetEventsList() { return m_event_list; }
+  cEventList* GetEventsList() { return m_event_list; }
 
   // Save to archive
   template<class Archive>
-  void save(Archive & a, const unsigned int version) const {
+  void save(Archive & a, const unsigned int version) const
+  {
     a.ArkvObj("m_analyze", m_analyze);
     a.ArkvObj("m_conf", m_conf);
     a.ArkvObj("m_ctx", m_ctx);
@@ -192,7 +193,8 @@
 
   // Ask archive to handle loads and saves separately
   template<class Archive>
-  void serialize(Archive & a, const unsigned int version){
+  void serialize(Archive & a, const unsigned int version)
+  {
     a.SplitLoadSave(*this, version);
   }
 




More information about the Avida-cvs mailing list