[Avida-SVN] r3319 - development/source/actions
beckma24 at myxo.css.msu.edu
beckma24 at myxo.css.msu.edu
Mon Jun 15 12:30:39 PDT 2009
Author: beckma24
Date: 2009-06-15 15:30:39 -0400 (Mon, 15 Jun 2009)
New Revision: 3319
Modified:
development/source/actions/PopulationActions.cc
Log:
Minor enhancement it nand anti-avidian treatment
Modified: development/source/actions/PopulationActions.cc
===================================================================
--- development/source/actions/PopulationActions.cc 2009-06-12 19:37:02 UTC (rev 3318)
+++ development/source/actions/PopulationActions.cc 2009-06-15 19:30:39 UTC (rev 3319)
@@ -955,7 +955,13 @@
// count the number of target instructions in the genome
int count = cGenomeUtil::CountInst(cell.GetOrganism()->GetGenome(), m_world->GetHardwareManager().GetInstSet().GetInst(m_inst));
- double killprob = min(pow(m_exprWeight*count,m_exponent), 100.0)/100.0;
+ double killprob;
+
+ if(m_exponent == -1.0)
+ killprob = min(1.0/(m_exprWeight+ pow(M_E, -count)), 100.0)/100.0; //sigmoid
+ else
+ killprob = min(pow(m_exprWeight*count,m_exponent), 100.0)/100.0; // linear and exponential
+
// cout << count << " " << killprob << endl;
currentKillProb.Add(killprob);
// decide if it should be killed or not, based on the kill probability
More information about the Avida-cvs
mailing list