[Avida-SVN] r2329 - in development: Avida.xcodeproj documentation/notes source/main

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Thu Feb 14 10:48:26 PST 2008


Author: beckma24
Date: 2008-02-14 13:48:25 -0500 (Thu, 14 Feb 2008)
New Revision: 2329

Modified:
   development/Avida.xcodeproj/project.pbxproj
   development/documentation/notes/3.0-notes
   development/source/main/cAvidaConfig.h
   development/source/main/cDeme.cc
   development/source/main/cDeme.h
   development/source/main/cPhenotype.cc
   development/source/main/cPopulation.cc
Log:
Added config option DEMES_RESET_PARENT_RESOURCES to allow the parent deme's recources to remain unchanged

Modified: development/Avida.xcodeproj/project.pbxproj
===================================================================
--- development/Avida.xcodeproj/project.pbxproj	2008-02-14 18:37:33 UTC (rev 2328)
+++ development/Avida.xcodeproj/project.pbxproj	2008-02-14 18:48:25 UTC (rev 2329)
@@ -213,6 +213,23 @@
 		};
 /* End PBXBuildRule section */
 
+/* Begin PBXBuildStyle section */
+		B500CC0C0D64C64300E812AF /* Development */ = {
+			isa = PBXBuildStyle;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+			};
+			name = Development;
+		};
+		B500CC0D0D64C64300E812AF /* Deployment */ = {
+			isa = PBXBuildStyle;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+			};
+			name = Deployment;
+		};
+/* End PBXBuildStyle section */
+
 /* Begin PBXContainerItemProxy section */
 		56F555DA0C3B36FC00E2E929 /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
@@ -1784,12 +1801,16 @@
 		DCC30C4D0762532C008F7A48 /* Project object */ = {
 			isa = PBXProject;
 			buildConfigurationList = 702442D70859E0B00059BD9B /* Build configuration list for PBXProject "Avida" */;
-			compatibilityVersion = "Xcode 2.4";
+			buildSettings = {
+			};
+			buildStyles = (
+				B500CC0C0D64C64300E812AF /* Development */,
+				B500CC0D0D64C64300E812AF /* Deployment */,
+			);
 			hasScannedForEncodings = 0;
 			mainGroup = DCC30C490762532C008F7A48;
 			productRefGroup = DCC3164E07626CF3008F7A48 /* Products */;
 			projectDirPath = "";
-			projectRoot = "";
 			targets = (
 				7023ED520C0A590200362B9C /* full-suite */,
 				DCC3164C07626CF3008F7A48 /* avida */,

Modified: development/documentation/notes/3.0-notes
===================================================================
--- development/documentation/notes/3.0-notes	2008-02-14 18:37:33 UTC (rev 2328)
+++ development/documentation/notes/3.0-notes	2008-02-14 18:48:25 UTC (rev 2329)
@@ -20,4 +20,4 @@
 Make sure all output files have headers.  There should be a central object
 that all files are output through that will make sure this is the case.
 
-Make events just call analyze scripts.  Re-design entire even structure.
+Make events just call analyze scripts.  Re-design entire event structure.

Modified: development/source/main/cAvidaConfig.h
===================================================================
--- development/source/main/cAvidaConfig.h	2008-02-14 18:37:33 UTC (rev 2328)
+++ development/source/main/cAvidaConfig.h	2008-02-14 18:48:25 UTC (rev 2329)
@@ -298,6 +298,7 @@
   CONFIG_ADD_VAR(DEMES_USE_GERMLINE, int, 0, "Whether demes use a distinct germline (default=0).");
   CONFIG_ADD_VAR(DEMES_HAVE_MERIT, int, 0, "Whether demes have merit (default=0).");
   CONFIG_ADD_VAR(DEMES_PREVENT_STERILE, int, 0, "Whether to prevent sterile demes from\nreplicating (default=0).");
+  CONFIG_ADD_VAR(DEMES_RESET_PARENT_RESOURCES, bool, 1, "Reset resources in parent (or source) deme on replication. 0/1 (off/on)");
   CONFIG_ADD_VAR(DEMES_REPLICATE_SIZE, int, 1, "Number of identical organisms to create or copy from the\nsource deme to the target deme (default=1).");
   CONFIG_ADD_VAR(DEMES_PROB_ORG_TRANSFER, double, 0.0, "Probablity of an organism being transferred from the\nsource deme to the target deme (default=0.0).");
   CONFIG_ADD_VAR(DEMES_ORGANISM_PLACEMENT, int, 0, "How organisms are placed during deme replication.\n0=cell-array middle (default).\n1=deme center.\n2=random placement.");
@@ -319,7 +320,7 @@
   CONFIG_ADD_VAR(DIVIDE_METHOD, int, 1, "0 = Divide leaves state of mother untouched.\n1 = Divide resets state of mother\n    (after the divide, we have 2 children)\n2 = Divide resets state of current thread only\n    (does not touch possible parasite threads)");
   CONFIG_ADD_VAR(INJECT_METHOD, int, 0, "0 = Leaves the parasite thread state untouched.\n1 = Resets the calling thread state on inject");
   CONFIG_ADD_VAR(GENERATION_INC_METHOD, int, 1, "0 = Only the generation of the child is\n    increased on divide.\n1 = Both the generation of the mother and child are\n    increased on divide (good with DIVIDE_METHOD 1).");
-	CONFIG_ADD_VAR(RESET_INPUTS_ON_DIVIDE, int, 0, "Reset environment inputs of parent upon successful divide.");
+  CONFIG_ADD_VAR(RESET_INPUTS_ON_DIVIDE, int, 0, "Reset environment inputs of parent upon successful divide.");
 	
   CONFIG_ADD_GROUP(RECOMBINATION_GROUP, "Sexual Recombination and Modularity");
   CONFIG_ADD_VAR(RECOMBINATION_PROB, double, 1.0, "probability of recombination in div-sex");

Modified: development/source/main/cDeme.cc
===================================================================
--- development/source/main/cDeme.cc	2008-02-14 18:37:33 UTC (rev 2328)
+++ development/source/main/cDeme.cc	2008-02-14 18:48:25 UTC (rev 2329)
@@ -90,14 +90,15 @@
   ++_age;
 }
 
-void cDeme::Reset()
+void cDeme::Reset(bool resetResources)
 {
   birth_count = 0;
   _age = 0;
-  deme_resource_count.ReinitializeResources();
+  if(resetResources)
+    deme_resource_count.ReinitializeResources();
 }
 
-void cDeme::Reset(double deme_energy)
+void cDeme::Reset(double deme_energy, bool resetResources)
 {
   assert(m_world->GetConfig().ENERGY_ENABLED.Get());
   assert(org_count>0);
@@ -117,7 +118,7 @@
       phenotype.SetMerit(cMerit(cMerit::EnergyToMerit(phenotype.GetStoredEnergy() * phenotype.GetEnergyUsageRatio(), m_world)));
     }
   }
-  Reset();
+  Reset(resetResources);
 }
 
 

Modified: development/source/main/cDeme.h
===================================================================
--- development/source/main/cDeme.h	2008-02-14 18:37:33 UTC (rev 2328)
+++ development/source/main/cDeme.h	2008-02-14 18:48:25 UTC (rev 2329)
@@ -72,8 +72,8 @@
   int GetWidth() const { return width; }
   int GetHeight() const { return cell_ids.GetSize() / width; }
 
-  void Reset();
-  void Reset(double deme_energy); //! used to pass energy to offspring deme
+  void Reset(bool resetResources = true);
+  void Reset(double deme_energy, bool resetResources = true); //! used to pass energy to offspring deme
   int GetBirthCount() const { return birth_count; }
   void IncBirthCount() { birth_count++; }
 

Modified: development/source/main/cPhenotype.cc
===================================================================
--- development/source/main/cPhenotype.cc	2008-02-14 18:37:33 UTC (rev 2328)
+++ development/source/main/cPhenotype.cc	2008-02-14 18:48:25 UTC (rev 2329)
@@ -557,7 +557,7 @@
   last_num_donates          = cur_num_donates;
   last_task_count           = cur_task_count;
   last_task_quality         = cur_task_quality;
-  last_task_value			= cur_task_value;
+  last_task_value           = cur_task_value;
   last_reaction_count       = cur_reaction_count;
   last_reaction_add_reward  = cur_reaction_add_reward;
   last_inst_count           = cur_inst_count;

Modified: development/source/main/cPopulation.cc
===================================================================
--- development/source/main/cPopulation.cc	2008-02-14 18:37:33 UTC (rev 2328)
+++ development/source/main/cPopulation.cc	2008-02-14 18:48:25 UTC (rev 2329)
@@ -1211,10 +1211,10 @@
   
   // Reset both demes, in case they have any cleanup work to do.
   if(m_world->GetConfig().ENERGY_ENABLED.Get()) {
-    source_deme.Reset(parent_deme_energy);
-    target_deme.Reset(offspring_deme_energy);  
+    source_deme.Reset(parent_deme_energy, m_world->GetConfig().DEMES_RESET_PARENT_RESOURCES.Get());
+    target_deme.Reset(offspring_deme_energy);
   } else {
-    source_deme.Reset();
+    source_deme.Reset(m_world->GetConfig().DEMES_RESET_PARENT_RESOURCES.Get());
     target_deme.Reset();
   }
   




More information about the Avida-cvs mailing list