[Avida-SVN] r2813 - in development/source: actions analyze

baerb at myxo.css.msu.edu baerb at myxo.css.msu.edu
Thu Oct 2 12:38:38 PDT 2008


Author: baerb
Date: 2008-10-02 15:38:38 -0400 (Thu, 02 Oct 2008)
New Revision: 2813

Modified:
   development/source/actions/EnvironmentActions.cc
   development/source/actions/PopulationActions.cc
   development/source/analyze/cAnalyze.cc
Log:
Some minor fixes to allow program to compile under windows.

Modified: development/source/actions/EnvironmentActions.cc
===================================================================
--- development/source/actions/EnvironmentActions.cc	2008-10-01 09:56:05 UTC (rev 2812)
+++ development/source/actions/EnvironmentActions.cc	2008-10-02 19:38:38 UTC (rev 2813)
@@ -554,7 +554,7 @@
 	void Process(cAvidaContext& ctx)
 	{
 		int time = m_world->GetStats().GetUpdate();
-		double m_res_count = -1*(0.4*tanh((time-182500)/50000)+0.5)*(0.5*sin(time/58.091)+0.5)+1;
+		double m_res_count = -1*(0.4*tanh(((double)time-182500.0)/50000.0)+0.5)*(0.5*sin((double)time/58.091)+0.5)+1;
 		cResource* res = m_world->GetEnvironment().GetResourceLib().GetResource(m_res_name);
 		if (res != NULL)
 			m_world->GetPopulation().SetResource(res->GetID(), m_res_count);
@@ -582,7 +582,7 @@
 	void Process(cAvidaContext& ctx)
 	{
 		int time = m_world->GetStats().GetUpdate();
-		double m_res_count = -m_scale*(tanh((time-182500)/50000)+1)*(0.5*sin(time/58.091)+0.5)+1;
+		double m_res_count = -m_scale*(tanh(((double)time-182500.0)/50000.0)+1.0)*(0.5*sin((double)time/58.091)+0.5)+1.0;
 		if(m_res_count < 0.0)
 			m_res_count = 0.0;
 		cResource* res = m_world->GetEnvironment().GetResourceLib().GetResource(m_res_name);
@@ -614,7 +614,7 @@
 	void Process(cAvidaContext& ctx)
 	{
 		int time = m_world->GetStats().GetUpdate();
-		double m_res_count = -m_scale*(tanh((time-1825000)/500000)+1)*(0.5*sin(time/58.091)+0.5)+1;
+		double m_res_count = -m_scale*(tanh(((double)time-1825000.0)/500000.0)+1.0)*(0.5*sin((double)time/58.091)+0.5)+1.0;
 		if(m_res_count < 0.0)
 			m_res_count = 0.0;
 		cResource* res = m_world->GetEnvironment().GetResourceLib().GetResource(m_res_name);

Modified: development/source/actions/PopulationActions.cc
===================================================================
--- development/source/actions/PopulationActions.cc	2008-10-01 09:56:05 UTC (rev 2812)
+++ development/source/actions/PopulationActions.cc	2008-10-02 19:38:38 UTC (rev 2813)
@@ -40,8 +40,8 @@
 #include <map>
 #include <set>
 #include <numeric>
+#include <algorithm>
 
-
 /*
  Injects a single organism into the population.
  

Modified: development/source/analyze/cAnalyze.cc
===================================================================
--- development/source/analyze/cAnalyze.cc	2008-10-01 09:56:05 UTC (rev 2812)
+++ development/source/analyze/cAnalyze.cc	2008-10-02 19:38:38 UTC (rev 2813)
@@ -5584,7 +5584,7 @@
       
       for (double log10_fc=-4.0; log10_fc<=0.0; log10_fc+=0.1)
       {
-        double fc = exp(log10_fc*log(10));
+        double fc = exp(log10_fc*log(10.0));
         
         // Modify the instruction set to include the current probability of failure.
         for (int j=0; j<modify_inst_set.GetSize(); j++)




More information about the Avida-cvs mailing list