[Avida-SVN] r2797 - development/source/cpu
jbarrick at myxo.css.msu.edu
jbarrick at myxo.css.msu.edu
Sat Sep 27 10:39:00 PDT 2008
Author: jbarrick
Date: 2008-09-27 13:38:59 -0400 (Sat, 27 Sep 2008)
New Revision: 2797
Modified:
development/source/cpu/cHardwareCPU.cc
Log:
Instructions that fail (due to prob_fail) are flagged as executed so that high failure organisms can still meet division conditions (cHardwareCPU only).
Added CommandAnalyzeRedundancyByInstFailure
Tests an organism at a range of different probabilities of instruction failure, and outputs the fraction of the time that they maintain their current fitness.
Skeleton for cAnalyze::FindLastCommonAncestor
Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc 2008-09-26 17:46:00 UTC (rev 2796)
+++ development/source/cpu/cHardwareCPU.cc 2008-09-27 17:38:59 UTC (rev 2797)
@@ -676,6 +676,12 @@
exec = !( ctx.GetRandom().P(m_inst_set->GetProbFail(cur_inst)) );
}
+ // Flag instruction as executed even if it failed (moved from SingleProcess_ExecuteInst)
+ // this allows division conditions to be met even if most instruction executions failed. @JEB
+
+ // Mark the instruction as executed
+ IP().SetFlagExecuted();
+
// Add to the promoter inst executed count before executing the inst (in case it is a terminator)
if (m_promoters_enabled) m_threads[m_cur_thread].IncPromoterInstExecuted();
@@ -731,10 +737,6 @@
// Get a pointer to the corresponding method...
int inst_idx = m_inst_set->GetLibFunctionIndex(actual_inst);
- // Mark the instruction as executed
- IP().SetFlagExecuted();
-
-
#if INSTRUCTION_COUNT
// instruction execution count incremented
organism->GetPhenotype().IncCurInstCount(actual_inst.GetOp());
More information about the Avida-cvs
mailing list