[Avida-SVN] r1880 - in development/source: cpu main
brysonda at myxo.css.msu.edu
brysonda at myxo.css.msu.edu
Wed Aug 1 17:36:51 PDT 2007
Author: brysonda
Date: 2007-08-01 20:36:51 -0400 (Wed, 01 Aug 2007)
New Revision: 1880
Modified:
development/source/cpu/cHardwareBase.cc
development/source/cpu/cHardwareCPU.cc
development/source/cpu/cHardwareExperimental.cc
development/source/cpu/cHardwareGX.cc
development/source/cpu/cHardwareSMT.cc
development/source/cpu/cHardwareTransSMT.cc
development/source/main/cOrganism.cc
development/source/main/cOrganism.h
Log:
Comment out currently un-utilized CPUStats tracking. Nothing currently accesses it outside of the CPU methods that update the values.
Modified: development/source/cpu/cHardwareBase.cc
===================================================================
--- development/source/cpu/cHardwareBase.cc 2007-08-01 17:31:31 UTC (rev 1879)
+++ development/source/cpu/cHardwareBase.cc 2007-08-02 00:36:51 UTC (rev 1880)
@@ -87,7 +87,7 @@
const int min_exe_lines = static_cast<int>(parent_size * m_world->GetConfig().MIN_EXE_LINES.Get());
if (executed_size < min_exe_lines) {
organism->Fault(FAULT_LOC_DIVIDE, FAULT_TYPE_ERROR,
- cStringUtil::Stringf("Too few executed lines (%d < %d)", executed_size, min_exe_lines));
+ cStringUtil::Stringf("Too few executed lines (%d < %d)", executed_size, min_exe_lines));
return false; // (divide fails)
}
@@ -95,7 +95,7 @@
const int min_copied = static_cast<int>(child_size * m_world->GetConfig().MIN_COPIED_LINES.Get());
if (copied_size < min_copied) {
organism->Fault(FAULT_LOC_DIVIDE, FAULT_TYPE_ERROR,
- cStringUtil::Stringf("Too few copied commands (%d < %d)", copied_size, min_copied));
+ cStringUtil::Stringf("Too few copied commands (%d < %d)", copied_size, min_copied));
return false; // (divide fails)
}
@@ -132,18 +132,18 @@
/*
- Return the number of mutations that occur on divide. AWC 06/29/06
- Limit the number of mutations that occur to be less than or equal to maxmut (defaults to INT_MAX)
-*/
+ Return the number of mutations that occur on divide. AWC 06/29/06
+ Limit the number of mutations that occur to be less than or equal to maxmut (defaults to INT_MAX)
+ */
unsigned cHardwareBase::Divide_DoMutations(cAvidaContext& ctx, double mut_multiplier, const int maxmut)
{
int totalMutations = 0;
//cerr << "Maxmut: " << maxmut << endl;
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
cCPUMemory& child_genome = organism->ChildGenome();
organism->GetPhenotype().SetDivType(mut_multiplier);
-
+
// @JEB Slip Mutations
// As if the read head jumped from one random position of the child
// to another random position and continued reading to the end.
@@ -155,7 +155,7 @@
cGenome child_copy = cGenome(child_genome);
int from = ctx.GetRandom().GetInt(child_copy.GetSize());
int to = ctx.GetRandom().GetInt(child_copy.GetSize());
-
+
//Resize child genome
child_genome.Resize( child_genome.GetSize() + (from-to) );
for (int i=0; i < child_copy.GetSize() - to; i++)
@@ -170,12 +170,12 @@
cout << "Child : " << child_genome.AsString() << endl;
}
}
-
+
// Divide Mutations
if (organism->TestDivideMut(ctx) && totalMutations < maxmut) {
const unsigned int mut_line = ctx.GetRandom().GetUInt(child_genome.GetSize());
child_genome[mut_line] = m_inst_set->GetRandomInst(ctx);
- ++cpu_stats.mut_stats.divide_mut_count;
+// ++cpu_stats.mut_stats.divide_mut_count;
totalMutations++;
//cerr << "Mutating HERE!!!! BAD!!!!!" << endl;
}
@@ -184,7 +184,7 @@
if (organism->TestDivideIns(ctx) && child_genome.GetSize() < MAX_CREATURE_SIZE && totalMutations < maxmut) {
const unsigned int mut_line = ctx.GetRandom().GetUInt(child_genome.GetSize() + 1);
child_genome.Insert(mut_line, m_inst_set->GetRandomInst(ctx));
- ++cpu_stats.mut_stats.divide_insert_mut_count;
+// ++cpu_stats.mut_stats.divide_insert_mut_count;
totalMutations++;
}
@@ -192,7 +192,7 @@
if (organism->TestDivideDel(ctx) && child_genome.GetSize() > MIN_CREATURE_SIZE && totalMutations < maxmut) {
const unsigned int mut_line = ctx.GetRandom().GetUInt(child_genome.GetSize());
child_genome.Remove(mut_line);
- ++cpu_stats.mut_stats.divide_delete_mut_count;
+// ++cpu_stats.mut_stats.divide_delete_mut_count;
totalMutations++;
}
@@ -205,15 +205,14 @@
for (int i = 0; i < num_mut && totalMutations < maxmut; i++) {
int site = ctx.GetRandom().GetUInt(child_genome.GetSize());
child_genome[site] = m_inst_set->GetRandomInst(ctx);
- ++cpu_stats.mut_stats.div_mut_count;
- totalMutations++;
- //cerr << "OK to mutate here " << totalMutations << endl;
+// ++cpu_stats.mut_stats.div_mut_count;
+ totalMutations++;
}
}
}
-
+
// Need to come back and fix tese last two - per site instructions
// Insert Mutations (per site)
if (organism->GetInsMutProb() > 0 && totalMutations < maxmut) {
@@ -235,8 +234,8 @@
// Actually do the mutations (in reverse sort order)
for (int i = num_mut-1; i >= 0; i--) {
child_genome.Insert(mut_sites[i], m_inst_set->GetRandomInst(ctx));
- cpu_stats.mut_stats.insert_mut_count++;
- totalMutations++; //Unlike the others we can't be sure this was done only on divide -- AWC 06/29/06
+// cpu_stats.mut_stats.insert_mut_count++;
+ totalMutations++; //Unlike the others we can't be sure this was done only on divide -- AWC 06/29/06
}
}
}
@@ -255,7 +254,7 @@
for (int i = 0; i < num_mut; i++) {
int site = ctx.GetRandom().GetUInt(child_genome.GetSize());
child_genome.Remove(site);
- cpu_stats.mut_stats.delete_mut_count++;
+// cpu_stats.mut_stats.delete_mut_count++;
totalMutations++;
}
}
@@ -265,38 +264,38 @@
for (int i = 0; i < GetMemory().GetSize(); i++) {
if (organism->TestParentMut(ctx)) {
GetMemory()[i] = m_inst_set->GetRandomInst(ctx);
- cpu_stats.mut_stats.parent_mut_line_count++;
- totalMutations++; //Unlike the others we can't be sure this was done only on divide -- AWC 06/29/06
-
+// cpu_stats.mut_stats.parent_mut_line_count++;
+ totalMutations++; //Unlike the others we can't be sure this was done only on divide -- AWC 06/29/06
+
}
}
}
// Count up mutated lines
- for (int i = 0; i < GetMemory().GetSize(); i++) {
- if (GetMemory().FlagPointMut(i)) {
- cpu_stats.mut_stats.point_mut_line_count++;
- }
- }
- for (int i = 0; i < child_genome.GetSize(); i++) {
- if (child_genome.FlagCopyMut(i)) {
- cpu_stats.mut_stats.copy_mut_line_count++;
- }
- }
-
+// for (int i = 0; i < GetMemory().GetSize(); i++) {
+// if (GetMemory().FlagPointMut(i)) {
+// cpu_stats.mut_stats.point_mut_line_count++;
+// }
+// }
+// for (int i = 0; i < child_genome.GetSize(); i++) {
+// if (child_genome.FlagCopyMut(i)) {
+// cpu_stats.mut_stats.copy_mut_line_count++;
+// }
+// }
+
return totalMutations;
}
/*
- Return the number of mutations that occur on divide. AWC 06/29/06
- Limit the number of mutations that occur to be less than or equat to maxmut (defaults to INT_MAX)
-*/
+ Return the number of mutations that occur on divide. AWC 06/29/06
+ Limit the number of mutations that occur to be less than or equat to maxmut (defaults to INT_MAX)
+ */
unsigned cHardwareBase::Divide_DoExactMutations(cAvidaContext& ctx, double mut_multiplier, const int pointmut)
{
int maxmut = pointmut;
int totalMutations = 0;
//cerr << "Maxmut: " << maxmut << endl;
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
cCPUMemory& child_genome = organism->ChildGenome();
organism->GetPhenotype().SetDivType(mut_multiplier);
@@ -305,7 +304,7 @@
if (organism->TestDivideMut(ctx) && totalMutations < maxmut) {
const unsigned int mut_line = ctx.GetRandom().GetUInt(child_genome.GetSize());
child_genome[mut_line] = m_inst_set->GetRandomInst(ctx);
- ++cpu_stats.mut_stats.divide_mut_count;
+// ++cpu_stats.mut_stats.divide_mut_count;
totalMutations++;
//cerr << "Mutating HERE!!!! BAD!!!!!" << endl;
}
@@ -314,7 +313,7 @@
if (organism->TestDivideIns(ctx) && child_genome.GetSize() < MAX_CREATURE_SIZE && totalMutations < maxmut) {
const unsigned int mut_line = ctx.GetRandom().GetUInt(child_genome.GetSize() + 1);
child_genome.Insert(mut_line, m_inst_set->GetRandomInst(ctx));
- ++cpu_stats.mut_stats.divide_insert_mut_count;
+// ++cpu_stats.mut_stats.divide_insert_mut_count;
totalMutations++;
}
@@ -322,7 +321,7 @@
if (organism->TestDivideDel(ctx) && child_genome.GetSize() > MIN_CREATURE_SIZE && totalMutations < maxmut) {
const unsigned int mut_line = ctx.GetRandom().GetUInt(child_genome.GetSize());
child_genome.Remove(mut_line);
- ++cpu_stats.mut_stats.divide_delete_mut_count;
+// ++cpu_stats.mut_stats.divide_delete_mut_count;
totalMutations++;
}
@@ -336,20 +335,20 @@
for (int i = 0; i < num_mut && totalMutations < maxmut; i++) {
int site = ctx.GetRandom().GetUInt(child_genome.GetSize());
child_genome[site] = m_inst_set->GetRandomInst(ctx);
- ++cpu_stats.mut_stats.div_mut_count;
- totalMutations++;
- //cerr << "OK to mutate here " << totalMutations << endl;
+// ++cpu_stats.mut_stats.div_mut_count;
+ totalMutations++;
+ //cerr << "OK to mutate here " << totalMutations << endl;
}
}
}
-
+
// Need to come back and fix tese last two - per site instructions
// Insert Mutations (per site)
if (organism->GetInsMutProb() > 0 && totalMutations < maxmut) {
int num_mut = ctx.GetRandom().GetRandBinomial(child_genome.GetSize(),
- organism->GetInsMutProb());
+ organism->GetInsMutProb());
// If would make creature to big, insert up to MAX_CREATURE_SIZE
if (num_mut + child_genome.GetSize() > MAX_CREATURE_SIZE) {
@@ -367,8 +366,8 @@
// Actually do the mutations (in reverse sort order)
for (int i = num_mut-1; i >= 0; i--) {
child_genome.Insert(mut_sites[i], m_inst_set->GetRandomInst(ctx));
- cpu_stats.mut_stats.insert_mut_count++;
- totalMutations++; //Unlike the others we can't be sure this was done only on divide -- AWC 06/29/06
+// cpu_stats.mut_stats.insert_mut_count++;
+ totalMutations++; //Unlike the others we can't be sure this was done only on divide -- AWC 06/29/06
}
}
}
@@ -387,7 +386,7 @@
for (int i = 0; i < num_mut; i++) {
int site = ctx.GetRandom().GetUInt(child_genome.GetSize());
child_genome.Remove(site);
- cpu_stats.mut_stats.delete_mut_count++;
+// cpu_stats.mut_stats.delete_mut_count++;
totalMutations++;
}
}
@@ -397,35 +396,35 @@
for (int i = 0; i < GetMemory().GetSize(); i++) {
if (organism->TestParentMut(ctx)) {
GetMemory()[i] = m_inst_set->GetRandomInst(ctx);
- cpu_stats.mut_stats.parent_mut_line_count++;
- totalMutations++; //Unlike the others we can't be sure this was done only on divide -- AWC 06/29/06
-
+// cpu_stats.mut_stats.parent_mut_line_count++;
+ totalMutations++; //Unlike the others we can't be sure this was done only on divide -- AWC 06/29/06
+
}
}
}
// Count up mutated lines
- for (int i = 0; i < GetMemory().GetSize(); i++) {
- if (GetMemory().FlagPointMut(i)) {
- cpu_stats.mut_stats.point_mut_line_count++;
- }
- }
- for (int i = 0; i < child_genome.GetSize(); i++) {
- if (child_genome.FlagCopyMut(i)) {
- cpu_stats.mut_stats.copy_mut_line_count++;
- }
- }
-
+// for (int i = 0; i < GetMemory().GetSize(); i++) {
+// if (GetMemory().FlagPointMut(i)) {
+// cpu_stats.mut_stats.point_mut_line_count++;
+// }
+// }
+// for (int i = 0; i < child_genome.GetSize(); i++) {
+// if (child_genome.FlagCopyMut(i)) {
+// cpu_stats.mut_stats.copy_mut_line_count++;
+// }
+// }
+
return totalMutations;
}
// test whether the offspring creature contains an advantageous mutation.
/*
- Return true iff only a reversion is performed -- returns false is sterilized regardless of whether or
- not a reversion is performed. AWC 06/29/06
-*/
+ Return true iff only a reversion is performed -- returns false is sterilized regardless of whether or
+ not a reversion is performed. AWC 06/29/06
+ */
bool cHardwareBase::Divide_TestFitnessMeasures(cAvidaContext& ctx)
{
cPhenotype & phenotype = organism->GetPhenotype();
@@ -443,49 +442,49 @@
const double parent_fitness = organism->GetTestFitness(ctx);
const double neut_min = parent_fitness * (1.0 - organism->GetNeutralMin());//nHardware::FITNESS_NEUTRAL_MIN;
- const double neut_max = parent_fitness * (1.0 + organism->GetNeutralMax());//nHardware::FITNESS_NEUTRAL_MAX;
-
- cTestCPU* testcpu = m_world->GetHardwareManager().CreateTestCPU();
- cCPUTestInfo test_info;
- test_info.UseRandomInputs();
- testcpu->TestGenome(ctx, test_info, organism->ChildGenome());
- const double child_fitness = test_info.GetGenotypeFitness();
- delete testcpu;
-
- bool revert = false;
- bool sterilize = false;
-
- // If implicit mutations are turned off, make sure this won't spawn one.
- if (organism->GetFailImplicit() == true) {
- if (test_info.GetMaxDepth() > 0) sterilize = true;
- }
-
- if (child_fitness == 0.0) {
- // Fatal mutation... test for reversion.
- if (ctx.GetRandom().P(organism->GetRevertFatal())) revert = true;
- if (ctx.GetRandom().P(organism->GetSterilizeFatal())) sterilize = true;
- } else if (child_fitness < neut_min) {
- if (ctx.GetRandom().P(organism->GetRevertNeg())) revert = true;
- if (ctx.GetRandom().P(organism->GetSterilizeNeg())) sterilize = true;
- } else if (child_fitness <= neut_max) {
- if (ctx.GetRandom().P(organism->GetRevertNeut())) revert = true;
- if (ctx.GetRandom().P(organism->GetSterilizeNeut())) sterilize = true;
- } else {
- if (ctx.GetRandom().P(organism->GetRevertPos())) revert = true;
- if (ctx.GetRandom().P(organism->GetSterilizePos())) sterilize = true;
- }
-
- // Ideally, we won't have reversions and sterilizations turned on at the
- // same time, but if we do, give revert the priority.
- if (revert == true) {
- organism->ChildGenome() = organism->GetGenome();
- }
-
- if (sterilize == true) {
- organism->GetPhenotype().ChildFertile() = false;
- }
-
- return (!sterilize) && revert;
+ const double neut_max = parent_fitness * (1.0 + organism->GetNeutralMax());//nHardware::FITNESS_NEUTRAL_MAX;
+
+ cTestCPU* testcpu = m_world->GetHardwareManager().CreateTestCPU();
+ cCPUTestInfo test_info;
+ test_info.UseRandomInputs();
+ testcpu->TestGenome(ctx, test_info, organism->ChildGenome());
+ const double child_fitness = test_info.GetGenotypeFitness();
+ delete testcpu;
+
+ bool revert = false;
+ bool sterilize = false;
+
+ // If implicit mutations are turned off, make sure this won't spawn one.
+ if (organism->GetFailImplicit() == true) {
+ if (test_info.GetMaxDepth() > 0) sterilize = true;
+ }
+
+ if (child_fitness == 0.0) {
+ // Fatal mutation... test for reversion.
+ if (ctx.GetRandom().P(organism->GetRevertFatal())) revert = true;
+ if (ctx.GetRandom().P(organism->GetSterilizeFatal())) sterilize = true;
+ } else if (child_fitness < neut_min) {
+ if (ctx.GetRandom().P(organism->GetRevertNeg())) revert = true;
+ if (ctx.GetRandom().P(organism->GetSterilizeNeg())) sterilize = true;
+ } else if (child_fitness <= neut_max) {
+ if (ctx.GetRandom().P(organism->GetRevertNeut())) revert = true;
+ if (ctx.GetRandom().P(organism->GetSterilizeNeut())) sterilize = true;
+ } else {
+ if (ctx.GetRandom().P(organism->GetRevertPos())) revert = true;
+ if (ctx.GetRandom().P(organism->GetSterilizePos())) sterilize = true;
+ }
+
+ // Ideally, we won't have reversions and sterilizations turned on at the
+ // same time, but if we do, give revert the priority.
+ if (revert == true) {
+ organism->ChildGenome() = organism->GetGenome();
+ }
+
+ if (sterilize == true) {
+ organism->GetPhenotype().ChildFertile() = false;
+ }
+
+ return (!sterilize) && revert;
}
int cHardwareBase::PointMutate(cAvidaContext& ctx, const double mut_rate)
@@ -498,7 +497,7 @@
memory[pos] = m_inst_set->GetRandomInst(ctx);
memory.SetFlagMutated(pos);
memory.SetFlagPointMut(pos);
- organism->CPUStats().mut_stats.point_mut_count++;
+// organism->CPUStats().mut_stats.point_mut_count++;
}
return num_muts;
@@ -632,7 +631,7 @@
has_mutation = true;
mut_info.IncCount(mut_id, num_muts);
}
- break;
+ break;
}
}
@@ -708,7 +707,7 @@
void cHardwareBase::CheckImplicitRepro(cAvidaContext& ctx)
{
if( (m_world->GetConfig().IMPLICIT_REPRO_TIME.Get() && (organism->GetPhenotype().GetCPUCyclesUsed() >= m_world->GetConfig().IMPLICIT_REPRO_TIME.Get()))
- || (m_world->GetConfig().IMPLICIT_REPRO_BONUS.Get() && (organism->GetPhenotype().GetCurBonus() >= m_world->GetConfig().IMPLICIT_REPRO_BONUS.Get())) )
+ || (m_world->GetConfig().IMPLICIT_REPRO_BONUS.Get() && (organism->GetPhenotype().GetCurBonus() >= m_world->GetConfig().IMPLICIT_REPRO_BONUS.Get())) )
{
Inst_Repro(ctx);
}
Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc 2007-08-01 17:31:31 UTC (rev 1879)
+++ development/source/cpu/cHardwareCPU.cc 2007-08-02 00:36:51 UTC (rev 1880)
@@ -2240,14 +2240,14 @@
const cHeadCPU from(this, GetRegister(op1));
cHeadCPU to(this, GetRegister(op2) + GetRegister(op1));
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
if (organism->TestCopyMut(ctx)) {
to.SetInst(m_inst_set->GetRandomInst(ctx));
to.SetFlagMutated(); // Mark this instruction as mutated...
to.SetFlagCopyMut(); // Mark this instruction as copy mut...
//organism->GetPhenotype().IsMutated() = true;
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
} else {
to.SetInst(from.GetInst());
to.ClearFlagMutated(); // UnMark
@@ -2255,7 +2255,7 @@
}
to.SetFlagCopied(); // Set the copied flag.
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
return true;
}
@@ -2280,7 +2280,7 @@
cHeadCPU to(this, GetRegister(op2) + GetRegister(op1));
const int value = Mod(GetRegister(src), m_inst_set->GetSize());
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
// Change value on a mutation...
if (organism->TestCopyMut(ctx)) {
@@ -2288,7 +2288,7 @@
to.SetFlagMutated(); // Mark this instruction as mutated...
to.SetFlagCopyMut(); // Mark this instruction as copy mut...
//organism->GetPhenotype().IsMutated() = true;
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
} else {
to.SetInst(cInstruction(value));
to.ClearFlagMutated(); // UnMark
@@ -2296,7 +2296,7 @@
}
to.SetFlagCopied(); // Set the copied flag.
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
return true;
}
@@ -2314,7 +2314,7 @@
const int op1 = REG_AX;
cHeadCPU to(this, GetRegister(op1) + GetRegister(dst));
const int value = Mod(StackPop(), m_inst_set->GetSize());
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
// Change value on a mutation...
if (organism->TestCopyMut(ctx)) {
@@ -2322,7 +2322,7 @@
to.SetFlagMutated(); // Mark this instruction as mutated...
to.SetFlagCopyMut(); // Mark this instruction as copy mut...
//organism->GetPhenotype().IsMutated() = true;
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
} else {
to.SetInst(cInstruction(value));
to.ClearFlagMutated(); // UnMark
@@ -2330,7 +2330,7 @@
}
to.SetFlagCopied(); // Set the copied flag.
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
return true;
}
@@ -3933,20 +3933,20 @@
const int head_id = FindModifiedHead(nHardware::HEAD_READ);
GetHead(head_id).Adjust();
- sCPUStats & cpu_stats = organism->CPUStats();
+// sCPUStats & cpu_stats = organism->CPUStats();
// Mutations only occur on the read, for the moment.
int read_inst = 0;
if (organism->TestCopyMut(ctx)) {
read_inst = m_inst_set->GetRandomInst(ctx).GetOp();
- cpu_stats.mut_stats.copy_mut_count++; // @CAO, hope this is good!
+// cpu_stats.mut_stats.copy_mut_count++; // @CAO, hope this is good!
} else {
read_inst = GetHead(head_id).GetInst().GetOp();
}
GetRegister(dst) = read_inst;
ReadInst(read_inst);
- cpu_stats.mut_stats.copies_exec++; // @CAO, this too..
+// cpu_stats.mut_stats.copies_exec++; // @CAO, this too..
GetHead(head_id).Advance();
return true;
}
@@ -3975,7 +3975,7 @@
// For the moment, this cannot be nop-modified.
cHeadCPU& read_head = GetHead(nHardware::HEAD_READ);
cHeadCPU& write_head = GetHead(nHardware::HEAD_WRITE);
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
read_head.Adjust();
write_head.Adjust();
@@ -3985,12 +3985,12 @@
ReadInst(read_inst.GetOp());
if (organism->TestCopyMut(ctx)) {
read_inst = m_inst_set->GetRandomInst(ctx);
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
write_head.SetFlagMutated();
write_head.SetFlagCopyMut();
}
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
write_head.SetInst(read_inst);
write_head.SetFlagCopied(); // Set the copied flag...
@@ -4005,7 +4005,7 @@
// For the moment, this cannot be nop-modified.
cHeadCPU & read_head = GetHead(nHardware::HEAD_READ);
cHeadCPU & write_head = GetHead(nHardware::HEAD_WRITE);
- sCPUStats & cpu_stats = organism->CPUStats();
+// sCPUStats & cpu_stats = organism->CPUStats();
read_head.Adjust();
write_head.Adjust();
@@ -4015,13 +4015,13 @@
ReadInst(read_inst.GetOp());
if ( ctx.GetRandom().P(organism->GetCopyMutProb() / reduction) ) {
read_inst = m_inst_set->GetRandomInst(ctx);
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
write_head.SetFlagMutated();
write_head.SetFlagCopyMut();
//organism->GetPhenotype().IsMutated() = true;
}
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
write_head.SetInst(read_inst);
write_head.SetFlagCopied(); // Set the copied flag...
Modified: development/source/cpu/cHardwareExperimental.cc
===================================================================
--- development/source/cpu/cHardwareExperimental.cc 2007-08-01 17:31:31 UTC (rev 1879)
+++ development/source/cpu/cHardwareExperimental.cc 2007-08-02 00:36:51 UTC (rev 1880)
@@ -1103,20 +1103,20 @@
const int head_id = FindModifiedHead(nHardware::HEAD_READ);
GetHead(head_id).Adjust();
- sCPUStats & cpu_stats = organism->CPUStats();
+// sCPUStats & cpu_stats = organism->CPUStats();
// Mutations only occur on the read, for the moment.
int read_inst = 0;
if (organism->TestCopyMut(ctx)) {
read_inst = m_inst_set->GetRandomInst(ctx).GetOp();
- cpu_stats.mut_stats.copy_mut_count++; // @CAO, hope this is good!
+// cpu_stats.mut_stats.copy_mut_count++; // @CAO, hope this is good!
} else {
read_inst = GetHead(head_id).GetInst().GetOp();
}
GetRegister(dst) = read_inst;
ReadInst(read_inst);
- cpu_stats.mut_stats.copies_exec++; // @CAO, this too..
+// cpu_stats.mut_stats.copies_exec++; // @CAO, this too..
GetHead(head_id).Advance();
return true;
}
@@ -1145,7 +1145,7 @@
// For the moment, this cannot be nop-modified.
cHeadCPU& read_head = GetHead(nHardware::HEAD_READ);
cHeadCPU& write_head = GetHead(nHardware::HEAD_WRITE);
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
read_head.Adjust();
write_head.Adjust();
@@ -1155,12 +1155,12 @@
ReadInst(read_inst.GetOp());
if (organism->TestCopyMut(ctx)) {
read_inst = m_inst_set->GetRandomInst(ctx);
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
write_head.SetFlagMutated();
write_head.SetFlagCopyMut();
}
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
write_head.SetInst(read_inst);
write_head.SetFlagCopied(); // Set the copied flag...
Modified: development/source/cpu/cHardwareGX.cc
===================================================================
--- development/source/cpu/cHardwareGX.cc 2007-08-01 17:31:31 UTC (rev 1879)
+++ development/source/cpu/cHardwareGX.cc 2007-08-02 00:36:51 UTC (rev 1880)
@@ -1931,14 +1931,14 @@
const cHeadCPU from(this, GetRegister(op1));
cHeadCPU to(this, GetRegister(op2) + GetRegister(op1));
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
if (organism->TestCopyMut(ctx)) {
to.SetInst(m_inst_set->GetRandomInst(ctx));
to.SetFlagMutated(); // Mark this instruction as mutated...
to.SetFlagCopyMut(); // Mark this instruction as copy mut...
//organism->GetPhenotype().IsMutated() = true;
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
} else {
to.SetInst(from.GetInst());
to.ClearFlagMutated(); // UnMark
@@ -1946,7 +1946,7 @@
}
to.SetFlagCopied(); // Set the copied flag.
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
return true;
}
@@ -1971,7 +1971,7 @@
cHeadCPU to(this, GetRegister(op2) + GetRegister(op1));
const int value = Mod(GetRegister(src), m_inst_set->GetSize());
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
// Change value on a mutation...
if (organism->TestCopyMut(ctx)) {
@@ -1979,7 +1979,7 @@
to.SetFlagMutated(); // Mark this instruction as mutated...
to.SetFlagCopyMut(); // Mark this instruction as copy mut...
//organism->GetPhenotype().IsMutated() = true;
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
} else {
to.SetInst(cInstruction(value));
to.ClearFlagMutated(); // UnMark
@@ -1987,7 +1987,7 @@
}
to.SetFlagCopied(); // Set the copied flag.
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
return true;
}
@@ -2005,7 +2005,7 @@
const int op1 = REG_AX;
cHeadCPU to(this, GetRegister(op1) + GetRegister(dst));
const int value = Mod(StackPop(), m_inst_set->GetSize());
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
// Change value on a mutation...
if (organism->TestCopyMut(ctx)) {
@@ -2013,7 +2013,7 @@
to.SetFlagMutated(); // Mark this instruction as mutated...
to.SetFlagCopyMut(); // Mark this instruction as copy mut...
//organism->GetPhenotype().IsMutated() = true;
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
} else {
to.SetInst(cInstruction(value));
to.ClearFlagMutated(); // UnMark
@@ -2021,7 +2021,7 @@
}
to.SetFlagCopied(); // Set the copied flag.
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
return true;
}
@@ -3195,7 +3195,7 @@
const int head_id = FindModifiedHead(nHardware::HEAD_READ);
GetHead(head_id).Adjust();
- sCPUStats & cpu_stats = organism->CPUStats();
+// sCPUStats & cpu_stats = organism->CPUStats();
// <--- GX addition
if ( !m_programids[GetHead(head_id).GetMemSpace()]->GetReadable() ) return false;
@@ -3205,14 +3205,14 @@
int read_inst = 0;
if (organism->TestCopyMut(ctx)) {
read_inst = m_inst_set->GetRandomInst(ctx).GetOp();
- cpu_stats.mut_stats.copy_mut_count++; // @CAO, hope this is good!
+// cpu_stats.mut_stats.copy_mut_count++; // @CAO, hope this is good!
} else {
read_inst = GetHead(head_id).GetInst().GetOp();
}
GetRegister(dst) = read_inst;
ReadInst(read_inst);
- cpu_stats.mut_stats.copies_exec++; // @CAO, this too..
+// cpu_stats.mut_stats.copies_exec++; // @CAO, this too..
GetHead(head_id).Advance();
return true;
}
@@ -3245,7 +3245,7 @@
// For the moment, this cannot be nop-modified.
cHeadCPU& read_head = GetHead(nHardware::HEAD_READ);
cHeadCPU& write_head = GetHead(nHardware::HEAD_WRITE);
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
read_head.Adjust();
write_head.Adjust();
@@ -3255,12 +3255,12 @@
ReadInst(read_inst.GetOp());
if (organism->TestCopyMut(ctx)) {
read_inst = m_inst_set->GetRandomInst(ctx);
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
write_head.SetFlagMutated();
write_head.SetFlagCopyMut();
}
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
write_head.SetInst(read_inst);
write_head.SetFlagCopied(); // Set the copied flag...
@@ -3275,7 +3275,7 @@
// For the moment, this cannot be nop-modified.
cHeadCPU & read_head = GetHead(nHardware::HEAD_READ);
cHeadCPU & write_head = GetHead(nHardware::HEAD_WRITE);
- sCPUStats & cpu_stats = organism->CPUStats();
+// sCPUStats & cpu_stats = organism->CPUStats();
read_head.Adjust();
write_head.Adjust();
@@ -3285,13 +3285,13 @@
ReadInst(read_inst.GetOp());
if ( ctx.GetRandom().P(organism->GetCopyMutProb() / reduction) ) {
read_inst = m_inst_set->GetRandomInst(ctx);
- cpu_stats.mut_stats.copy_mut_count++;
+// cpu_stats.mut_stats.copy_mut_count++;
write_head.SetFlagMutated();
write_head.SetFlagCopyMut();
//organism->GetPhenotype().IsMutated() = true;
}
- cpu_stats.mut_stats.copies_exec++;
+// cpu_stats.mut_stats.copies_exec++;
write_head.SetInst(read_inst);
write_head.SetFlagCopied(); // Set the copied flag...
Modified: development/source/cpu/cHardwareSMT.cc
===================================================================
--- development/source/cpu/cHardwareSMT.cc 2007-08-01 17:31:31 UTC (rev 1879)
+++ development/source/cpu/cHardwareSMT.cc 2007-08-02 00:36:51 UTC (rev 1880)
@@ -1285,20 +1285,20 @@
#endif
GetHead(head_id).Adjust();
- sCPUStats& cpu_stats = organism->CPUStats();
+// sCPUStats& cpu_stats = organism->CPUStats();
// Mutations only occur on the read, for the moment.
int read_inst = 0;
if (organism->TestCopyMut(ctx)) {
read_inst = m_inst_set->GetRandomInst(ctx).GetOp();
- cpu_stats.mut_stats.copy_mut_count++; // @CAO, hope this is good!
+// cpu_stats.mut_stats.copy_mut_count++; // @CAO, hope this is good!
} else {
read_inst = GetHead(head_id).GetInst().GetOp();
}
Stack(dst).Push(read_inst);
ReadInst(read_inst);
- cpu_stats.mut_stats.copies_exec++; // @CAO, this too..
+// cpu_stats.mut_stats.copies_exec++; // @CAO, this too..
GetHead(head_id).Advance();
return true;
}
Modified: development/source/cpu/cHardwareTransSMT.cc
===================================================================
--- development/source/cpu/cHardwareTransSMT.cc 2007-08-01 17:31:31 UTC (rev 1879)
+++ development/source/cpu/cHardwareTransSMT.cc 2007-08-02 00:36:51 UTC (rev 1880)
@@ -1190,20 +1190,20 @@
#endif
GetHead(head_id).Adjust();
- sCPUStats & cpu_stats = organism->CPUStats();
+// sCPUStats & cpu_stats = organism->CPUStats();
// Mutations only occur on the read, for the moment.
int read_inst = 0;
if (organism->TestCopyMut(ctx)) {
read_inst = m_inst_set->GetRandomInst(ctx).GetOp();
- cpu_stats.mut_stats.copy_mut_count++; // @CAO, hope this is good!
+// cpu_stats.mut_stats.copy_mut_count++; // @CAO, hope this is good!
} else {
read_inst = GetHead(head_id).GetInst().GetOp();
}
Stack(dst).Push(read_inst);
ReadInst(read_inst);
- cpu_stats.mut_stats.copies_exec++; // @CAO, this too..
+// cpu_stats.mut_stats.copies_exec++; // @CAO, this too..
GetHead(head_id).Advance();
return true;
}
Modified: development/source/main/cOrganism.cc
===================================================================
--- development/source/main/cOrganism.cc 2007-08-01 17:31:31 UTC (rev 1879)
+++ development/source/main/cOrganism.cc 2007-08-02 00:36:51 UTC (rev 1880)
@@ -71,7 +71,7 @@
{
// Initialization of structures...
m_hardware = m_world->GetHardwareManager().Create(this);
- m_cpu_stats.Setup();
+// m_cpu_stats.Setup();
if (m_world->GetConfig().DEATH_METHOD.Get() > DEATH_METHOD_OFF) {
m_max_executed = m_world->GetConfig().AGE_LIMIT.Get();
Modified: development/source/main/cOrganism.h
===================================================================
--- development/source/main/cOrganism.h 2007-08-01 17:31:31 UTC (rev 1879)
+++ development/source/main/cOrganism.h 2007-08-02 00:36:51 UTC (rev 1880)
@@ -31,9 +31,9 @@
#ifndef cCPUMemory_h
#include "cCPUMemory.h"
#endif
-#ifndef sCPUStats_h
-#include "sCPUStats.h"
-#endif
+//#ifndef sCPUStats_h
+//#include "sCPUStats.h"
+//#endif
#ifndef cGenome_h
#include "cGenome.h"
#endif
@@ -99,7 +99,7 @@
// Other stats
cCPUMemory m_child_genome; // Child genome, while under construction.
- sCPUStats m_cpu_stats; // Info for statistics
+// sCPUStats m_cpu_stats; // Info for statistics
// Input and Output with the environment
int m_input_pointer;
@@ -169,7 +169,7 @@
int GetMaxExecuted() const { return m_max_executed; }
cCPUMemory& ChildGenome() { return m_child_genome; }
- sCPUStats& CPUStats() { return m_cpu_stats; }
+// sCPUStats& CPUStats() { return m_cpu_stats; }
void SetRunning(bool in_running) { m_is_running = in_running; }
bool IsRunning() { return m_is_running; }
More information about the Avida-cvs
mailing list