[Avida-SVN] r2686 - in branches/uml-merge: documentation source/main

dk at myxo.css.msu.edu dk at myxo.css.msu.edu
Wed Jun 25 07:08:01 PDT 2008


Author: dk
Date: 2008-06-25 10:08:00 -0400 (Wed, 25 Jun 2008)
New Revision: 2686

Modified:
   branches/uml-merge/documentation/index.html
   branches/uml-merge/documentation/svn.html
   branches/uml-merge/source/main/cPopulation.cc
   branches/uml-merge/source/main/cResourceCount.cc
   branches/uml-merge/source/main/cSpatialCountElem.h
   branches/uml-merge/source/main/cSpatialResCount.cc
Log:
Merged 2671:2684 development->uml-merge.

Modified: branches/uml-merge/documentation/index.html
===================================================================
--- branches/uml-merge/documentation/index.html	2008-06-25 14:04:41 UTC (rev 2685)
+++ branches/uml-merge/documentation/index.html	2008-06-25 14:08:00 UTC (rev 2686)
@@ -5,6 +5,7 @@
 </head>
 <body>
 
+
 <div align="center">
 <table border="0">
 <tr>

Modified: branches/uml-merge/documentation/svn.html
===================================================================
--- branches/uml-merge/documentation/svn.html	2008-06-25 14:04:41 UTC (rev 2685)
+++ branches/uml-merge/documentation/svn.html	2008-06-25 14:08:00 UTC (rev 2686)
@@ -43,14 +43,11 @@
 <p>
 To download the Avida project, issue the 'checkout' command with the path
 to the Avida repository.  The following two command lines show how this
-command should look and provide the repository paths.   The first line is
-the preferred path.  The second can be used in instances where outbound
-firewalls have blocked access to non-standard web ports.
+command should look and provide the repository paths.
 </p>
 
 <pre>
-svn checkout http://myxo.css.msu.edu:7632/avida/trunk
-svn checkout http://myxo.css.msu.edu:443/avida/trunk
+svn checkout https://avida.devosoft.org/svn/development
 </pre>
 
 
@@ -113,4 +110,4 @@
 <p><a href="index.html">Return to the Index</a></p>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/uml-merge/source/main/cPopulation.cc
===================================================================
--- branches/uml-merge/source/main/cPopulation.cc	2008-06-25 14:04:41 UTC (rev 2685)
+++ branches/uml-merge/source/main/cPopulation.cc	2008-06-25 14:08:00 UTC (rev 2686)
@@ -1153,6 +1153,12 @@
     }
   }
   
+  //re-inject demes with count of 1 back into self
+  for(int i = 0; i < (int)deme_counts.size(); i++) {
+    if(deme_counts[i] == 1)
+      ReplaceDeme(deme_array[i], deme_array[i]);
+  }
+
   // Now, while we can find both a source deme (one with a count greater than 1)
   // and a target deme (one with a count of 0), replace the target with the source.
   while(true) {

Modified: branches/uml-merge/source/main/cResourceCount.cc
===================================================================
--- branches/uml-merge/source/main/cResourceCount.cc	2008-06-25 14:04:41 UTC (rev 2685)
+++ branches/uml-merge/source/main/cResourceCount.cc	2008-06-25 14:08:00 UTC (rev 2686)
@@ -493,7 +493,25 @@
 }
 
 void cResourceCount::ReinitializeResources(double additional_resource){
+  cSpatialResCount src;
+  double c_curr_amount;
+  double c_initial_amount;
+  double c_new_amount;
+
   for(int i = 0; i < resource_name.GetSize(); i++) {
-    Set(i, resource_initial[i]+additional_resource); //will cause problem if more than one resource is used.
-  }
-}
+    Set(i, resource_initial[i]+additional_resource); //will cause problem if more than one resource is used. -- why?  each resource is stored separately (BDC)
+
+    // Additionally, set any initial values given by the CELL command
+    src = GetSpatialResource(i);
+    for(int j = 0; j < src.GetSize(); j++) {
+      c_initial_amount = src.Element(j).GetInitial();
+      if(c_initial_amount > 0) {
+        c_curr_amount = spatial_resource_count[i].GetAmount(j);
+        c_new_amount = c_curr_amount + c_initial_amount + additional_resource;
+        spatial_resource_count[i].SetCellAmount(j, c_new_amount);
+      }
+    }
+
+  } //End going through the resources
+
+} //End ReinitializeResources()

Modified: branches/uml-merge/source/main/cSpatialCountElem.h
===================================================================
--- branches/uml-merge/source/main/cSpatialCountElem.h	2008-06-25 14:04:41 UTC (rev 2685)
+++ branches/uml-merge/source/main/cSpatialCountElem.h	2008-06-25 14:08:00 UTC (rev 2686)
@@ -33,7 +33,7 @@
 class cSpatialCountElem
 {
 private:
-  mutable double amount, delta;
+  mutable double amount, delta, initial;
   tArray<int> elempt, xdist, ydist;
   tArray<double> dist;
   
@@ -52,6 +52,8 @@
   double GetPtrDist(int innum) { return dist[innum]; }
   friend void FlowMatter(cSpatialCountElem&, cSpatialCountElem&, double, double, double, double,
                          int, int, double);
+  void SetInitial(double init) { initial = init; }
+  double GetInitial() { return initial; }
 };
 
 

Modified: branches/uml-merge/source/main/cSpatialResCount.cc
===================================================================
--- branches/uml-merge/source/main/cSpatialResCount.cc	2008-06-25 14:04:41 UTC (rev 2685)
+++ branches/uml-merge/source/main/cSpatialResCount.cc	2008-06-25 14:08:00 UTC (rev 2686)
@@ -226,6 +226,7 @@
     if (cell_id >= 0 && cell_id <= grid.GetSize()) {
       Rate((*cell_list_ptr)[i].GetId(), (*cell_list_ptr)[i].GetInitial());
       State((*cell_list_ptr)[i].GetId());
+      Element(cell_id).SetInitial((*cell_list_ptr)[i].GetInitial());
     }
   }
 }




More information about the Avida-cvs mailing list