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

pakanati at myxo.css.msu.edu pakanati at myxo.css.msu.edu
Fri Oct 2 13:10:42 PDT 2009


Author: pakanati
Date: 2009-10-02 16:10:42 -0400 (Fri, 02 Oct 2009)
New Revision: 3440

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


Modified: branches/topology-manager/source/main/cTopologyManager.cc
===================================================================
--- branches/topology-manager/source/main/cTopologyManager.cc	2009-10-02 17:40:41 UTC (rev 3439)
+++ branches/topology-manager/source/main/cTopologyManager.cc	2009-10-02 20:10:42 UTC (rev 3440)
@@ -41,10 +41,9 @@
 
 
 cTopologyManager::cTopologyManager(cWorld* world, cPopulation* pop)
-: m_world(world), m_pop(pop)
+: m_world(world), m_pop(pop), cell_array(pop->cell_array)
 , environment(world->GetEnvironment())
 {
-  cell_array = pop->cell_array;
   int num_demes = m_world->GetConfig().NUM_DEMES.Get();
   // Invalid settings should be changed to one deme
   if (num_demes <= 0) {
@@ -128,7 +127,7 @@
 
 
 
-  pop->cell_array = cell_array;
+
 }
 
 cTopologyManager::~cTopologyManager()

Modified: branches/topology-manager/source/main/cTopologyManager.h
===================================================================
--- branches/topology-manager/source/main/cTopologyManager.h	2009-10-02 17:40:41 UTC (rev 3439)
+++ branches/topology-manager/source/main/cTopologyManager.h	2009-10-02 20:10:42 UTC (rev 3440)
@@ -47,14 +47,14 @@
 private:
   cWorld* m_world;
   cPopulation* m_pop;
-  tArray<cPopulationCell> cell_array;  // Local cells composing the population
+  tArray<cPopulationCell>& cell_array;  // Local cells composing the population
   tArray<int> empty_cell_id_array;     // Used for PREFER_EMPTY birth methods
   cEnvironment & environment;          // Physics & Chemistry description
   int world_x;                         // Structured population width.
   int world_y;                         // Structured population height.
   int world_z; 						   // Population depth.
+z
 
-
 public:
   cTopologyManager(); // not implemented
   cTopologyManager(cWorld* world, cPopulation* pop);

Modified: branches/topology-manager/source/main/cWorld.h
===================================================================
--- branches/topology-manager/source/main/cWorld.h	2009-10-02 17:40:41 UTC (rev 3439)
+++ branches/topology-manager/source/main/cWorld.h	2009-10-02 20:10:42 UTC (rev 3440)
@@ -58,6 +58,7 @@
 class cStats;
 class cTestCPU;
 class cWorldDriver;
+class cTopologyManager;
 template<class T> class tDataEntry;
 template<class T> class tDictionary;
 
@@ -80,25 +81,25 @@
   cWorldDriver* m_driver;
 
   cRandom m_rng;
-  
+
   bool m_test_on_div;     // flag derived from a collection of configuration settings
   bool m_test_sterilize;  // flag derived from a collection of configuration settings
-  
+
   bool m_own_driver;      // specifies whether this world object should manage its driver object
 
   // Internal Methods
   void Setup();
-  
-  
+
+
   cWorld(const cWorld&); // @not_implemented
   cWorld& operator=(const cWorld&); // @not_implemented
-  
+
 public:
   cWorld(cAvidaConfig* cfg) : m_analyze(NULL), m_conf(cfg), m_ctx(m_rng) { Setup(); }
   ~cWorld();
-  
+
   void SetDriver(cWorldDriver* driver, bool take_ownership = false);
-  
+
   // General Object Accessors
   cAnalyze& GetAnalyze();
   cAvidaConfig& GetConfig() { return *m_conf; }
@@ -111,15 +112,15 @@
   cRandom& GetRandom() { return m_rng; }
   cStats& GetStats() { return *m_stats; }
   cWorldDriver& GetDriver() { return *m_driver; }
-  
+
   // Access to Data File Manager
   std::ofstream& GetDataFileOFStream(const cString& fname) { return m_data_mgr->GetOFStream(fname); }
-  cDataFile& GetDataFile(const cString& fname) { return m_data_mgr->Get(fname); }  
+  cDataFile& GetDataFile(const cString& fname) { return m_data_mgr->Get(fname); }
 
   // Config Dependent Modes
   bool GetTestOnDivide() const { return m_test_on_div; }
   bool GetTestSterilize() const { return m_test_sterilize; }
-  
+
   // Convenience Accessors
   int GetNumInstructions();
   int GetNumResources();
@@ -129,10 +130,10 @@
 
   // @DMB - Inherited from cAvidaDriver heritage
   void GetEvents(cAvidaContext& ctx);
-	
+
 	cEventList* GetEventsList() { return m_event_list; }
 
-  // Save to archive 
+  // Save to archive
   template<class Archive>
   void save(Archive & a, const unsigned int version) const {
     a.ArkvObj("m_analyze", m_analyze);
@@ -154,8 +155,8 @@
     a.ArkvObj("m_test_sterilize", __m_test_sterilize);
     a.ArkvObj("m_own_driver", __m_own_driver);
   }
-  
-  // Load from archive 
+
+  // Load from archive
   template<class Archive>
   void load(Archive & a, const unsigned int version){
     a.ArkvObj("m_analyze", m_analyze);
@@ -179,8 +180,8 @@
     m_test_on_div = (__m_test_on_div == 0)?(false):(true);
     m_test_sterilize = (__m_test_sterilize == 0)?(false):(true);
     m_own_driver = (__m_own_driver == 0)?(false):(true);
-  } 
-    
+  }
+
   // Ask archive to handle loads and saves separately
   template<class Archive>
   void serialize(Archive & a, const unsigned int version){
@@ -199,6 +200,6 @@
    **/
   void UnitTests(bool full = false);
 }
-#endif  
+#endif
 
 #endif




More information about the Avida-cvs mailing list