[Avida-SVN] r2791 - development/source/actions

beckma24 at myxo.css.msu.edu beckma24 at myxo.css.msu.edu
Mon Sep 15 09:50:36 PDT 2008


Author: beckma24
Date: 2008-09-15 12:50:35 -0400 (Mon, 15 Sep 2008)
New Revision: 2791

Modified:
   development/source/actions/EnvironmentActions.cc
Log:
minor tweak to seasonal resource action

Modified: development/source/actions/EnvironmentActions.cc
===================================================================
--- development/source/actions/EnvironmentActions.cc	2008-09-15 13:06:42 UTC (rev 2790)
+++ development/source/actions/EnvironmentActions.cc	2008-09-15 16:50:35 UTC (rev 2791)
@@ -582,12 +582,12 @@
 	void Process(cAvidaContext& ctx)
 	{
 		int time = m_world->GetStats().GetUpdate();
-		double m_res_count = -1*(tanh((time-182500)/50000)+1)*(0.5*sin(time/58.091)+0.5)+1;
+		double m_res_count = -m_scale*(tanh((time-182500)/50000)+1)*(0.5*sin(time/58.091)+0.5)+1;
 		if(m_res_count < 0.0)
 			m_res_count = 0.0;
 		cResource* res = m_world->GetEnvironment().GetResourceLib().GetResource(m_res_name);
 		if (res != NULL)
-			m_world->GetPopulation().SetResource(res->GetID(), m_res_count * m_scale);			
+			m_world->GetPopulation().SetResource(res->GetID(), m_res_count);			
 	}
 };
 
@@ -614,12 +614,12 @@
 	void Process(cAvidaContext& ctx)
 	{
 		int time = m_world->GetStats().GetUpdate();
-		double m_res_count = -1*(tanh((time-1825000)/500000)+1)*(0.5*sin(time/58.091)+0.5)+1;
+		double m_res_count = -m_scale*(tanh((time-1825000)/500000)+1)*(0.5*sin(time/58.091)+0.5)+1;
 		if(m_res_count < 0.0)
 			m_res_count = 0.0;
 		cResource* res = m_world->GetEnvironment().GetResourceLib().GetResource(m_res_name);
 		if (res != NULL)
-			m_world->GetPopulation().SetResource(res->GetID(), m_res_count* m_scale);			
+			m_world->GetPopulation().SetResource(res->GetID(), m_res_count);			
 	}
 };
 




More information about the Avida-cvs mailing list