[Avida-cvs] [avida-svn] r426 - in development: Avida.xcodeproj source/cpu source/viewer
brysonda@myxo.css.msu.edu
brysonda at myxo.css.msu.edu
Wed Dec 21 16:46:27 PST 2005
Author: brysonda
Date: 2005-12-21 19:46:26 -0500 (Wed, 21 Dec 2005)
New Revision: 426
Added:
development/source/viewer/cTextViewerDriver.cc
development/source/viewer/cTextViewerDriver.h
Removed:
development/source/cpu/cMemoryFlags.h
development/source/viewer/cAvidaDriver_TextPopViewer.cc
development/source/viewer/cAvidaDriver_TextPopViewer.h
Modified:
development/Avida.xcodeproj/project.pbxproj
development/source/cpu/cCPUMemory.cc
development/source/cpu/cCPUMemory.h
development/source/cpu/cHardware4Stack.cc
development/source/cpu/cHardwareCPU.cc
development/source/cpu/cHardwareSMT.cc
development/source/cpu/cHeadCPU.cc
development/source/cpu/cHeadCPU.h
development/source/cpu/cHeadMultiMem.cc
development/source/cpu/cHeadMultiMem.h
development/source/viewer/CMakeLists.txt
development/source/viewer/cZoomScreen.cc
development/source/viewer/viewer.cc
Log:
Update cCPUMemory flags to use bitmasked fields, just like the trunk. Also update the viewer driver to use the new framework.
Modified: development/Avida.xcodeproj/project.pbxproj
===================================================================
--- development/Avida.xcodeproj/project.pbxproj 2005-12-20 18:54:00 UTC (rev 425)
+++ development/Avida.xcodeproj/project.pbxproj 2005-12-22 00:46:26 UTC (rev 426)
@@ -53,7 +53,6 @@
70422A34091B141000A5E67F /* cAnalyze.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70422A1C091B141000A5E67F /* cAnalyze.cc */; };
70422A3C091B141000A5E67F /* cAnalyzeGenotype.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70422A24091B141000A5E67F /* cAnalyzeGenotype.cc */; };
70422A3E091B141000A5E67F /* cAnalyzeUtil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70422A26091B141000A5E67F /* cAnalyzeUtil.cc */; };
- 704866D3090B51310048600A /* cAvidaDriver_TextPopViewer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866B3090B51310048600A /* cAvidaDriver_TextPopViewer.cc */; };
704866D5090B51310048600A /* cBarScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866B5090B51310048600A /* cBarScreen.cc */; };
704866D8090B51310048600A /* cEnvironmentScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866B8090B51310048600A /* cEnvironmentScreen.cc */; };
704866DA090B51310048600A /* cHistScreen.cc in Sources */ = {isa = PBXBuildFile; fileRef = 704866BA090B51310048600A /* cHistScreen.cc */; };
@@ -96,6 +95,7 @@
706D32EB0854A39900D7DC8F /* organism.parasite in CopyFiles */ = {isa = PBXBuildFile; fileRef = DCC311980762539F008F7A48 /* organism.parasite */; };
706D330F0854A7B900D7DC8F /* organism.smt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 706D330E0854A7B900D7DC8F /* organism.smt */; };
706D33280854A90D00D7DC8F /* inst_set.smt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 706D33270854A90D00D7DC8F /* inst_set.smt */; };
+ 709D4B83095A2EFA00EC9358 /* cTextViewerDriver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 709D4B81095A2EFA00EC9358 /* cTextViewerDriver.cc */; };
70B0865908F4974300FC65FE /* cLandscape.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865108F4974300FC65FE /* cLandscape.cc */; };
70B0865C08F4974300FC65FE /* cLocalMutations.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865408F4974300FC65FE /* cLocalMutations.cc */; };
70B0865E08F4974300FC65FE /* cMutationLib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865608F4974300FC65FE /* cMutationLib.cc */; };
@@ -379,8 +379,6 @@
70422A26091B141000A5E67F /* cAnalyzeUtil.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cAnalyzeUtil.cc; sourceTree = "<group>"; };
70422A27091B141000A5E67F /* cAnalyzeUtil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cAnalyzeUtil.h; sourceTree = "<group>"; };
70422A44091B1B8500A5E67F /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 704866B3090B51310048600A /* cAvidaDriver_TextPopViewer.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cAvidaDriver_TextPopViewer.cc; sourceTree = "<group>"; };
- 704866B4090B51310048600A /* cAvidaDriver_TextPopViewer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cAvidaDriver_TextPopViewer.h; sourceTree = "<group>"; };
704866B5090B51310048600A /* cBarScreen.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cBarScreen.cc; sourceTree = "<group>"; };
704866B6090B51310048600A /* cBarScreen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cBarScreen.h; sourceTree = "<group>"; };
704866B7090B51310048600A /* cBaseTextWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cBaseTextWindow.h; sourceTree = "<group>"; };
@@ -434,6 +432,8 @@
706D330E0854A7B900D7DC8F /* organism.smt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = organism.smt; sourceTree = "<group>"; };
706D33270854A90D00D7DC8F /* inst_set.smt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = inst_set.smt; sourceTree = "<group>"; };
707A687408E3750300576968 /* cHardwareTracer_SMT.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cHardwareTracer_SMT.h; sourceTree = "<group>"; };
+ 709D4B81095A2EFA00EC9358 /* cTextViewerDriver.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cTextViewerDriver.cc; sourceTree = "<group>"; };
+ 709D4B82095A2EFA00EC9358 /* cTextViewerDriver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cTextViewerDriver.h; sourceTree = "<group>"; };
70B0864808F4972600FC65FE /* cLandscape.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cLandscape.h; sourceTree = "<group>"; };
70B0864B08F4972600FC65FE /* cLocalMutations.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cLocalMutations.h; sourceTree = "<group>"; };
70B0864C08F4972600FC65FE /* cMutation.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cMutation.h; sourceTree = "<group>"; };
@@ -606,7 +606,6 @@
70C1F01B08C3C6FC00F50912 /* cHeadCPU.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cHeadCPU.h; sourceTree = "<group>"; };
70C1F01C08C3C6FC00F50912 /* cHeadMultiMem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cHeadMultiMem.h; sourceTree = "<group>"; };
70C1F01D08C3C6FC00F50912 /* cInstLibCPU.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInstLibCPU.h; sourceTree = "<group>"; };
- 70C1F01E08C3C6FC00F50912 /* cMemoryFlags.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cMemoryFlags.h; sourceTree = "<group>"; };
70C1F01F08C3C6FC00F50912 /* cTestCPU.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cTestCPU.h; sourceTree = "<group>"; };
70C1F02008C3C6FC00F50912 /* cTestUtil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cTestUtil.h; sourceTree = "<group>"; };
70C1F02108C3C6FC00F50912 /* nHardwareSMT.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = nHardwareSMT.h; sourceTree = "<group>"; };
@@ -822,8 +821,8 @@
704866B2090B51310048600A /* viewer */ = {
isa = PBXGroup;
children = (
- 704866B3090B51310048600A /* cAvidaDriver_TextPopViewer.cc */,
- 704866B4090B51310048600A /* cAvidaDriver_TextPopViewer.h */,
+ 709D4B81095A2EFA00EC9358 /* cTextViewerDriver.cc */,
+ 709D4B82095A2EFA00EC9358 /* cTextViewerDriver.h */,
704866B5090B51310048600A /* cBarScreen.cc */,
704866B6090B51310048600A /* cBarScreen.h */,
704866B7090B51310048600A /* cBaseTextWindow.h */,
@@ -964,7 +963,6 @@
70C1F02708C3C71300F50912 /* cHeadMultiMem.cc */,
70C1F01C08C3C6FC00F50912 /* cHeadMultiMem.h */,
70C1F01D08C3C6FC00F50912 /* cInstLibCPU.h */,
- 70C1F01E08C3C6FC00F50912 /* cMemoryFlags.h */,
70C1EF6108C3954700F50912 /* cCPUStack.cc */,
70C1EF6008C3953A00F50912 /* cCPUStack.h */,
70C1F02808C3C71300F50912 /* cTestCPU.cc */,
@@ -1598,7 +1596,6 @@
70C5BC6709059A970028A785 /* cWorld.cc in Sources */,
70C5BD6D0905CE5F0028A785 /* cHardwareManager.cc in Sources */,
7040CF1E0906A52E00AA820F /* cEventManager.cc in Sources */,
- 704866D3090B51310048600A /* cAvidaDriver_TextPopViewer.cc in Sources */,
704866D5090B51310048600A /* cBarScreen.cc in Sources */,
704866D8090B51310048600A /* cEnvironmentScreen.cc in Sources */,
704866DA090B51310048600A /* cHistScreen.cc in Sources */,
@@ -1631,6 +1628,7 @@
701D9310094CAD6B008B845F /* cDefaultRunDriver.cc in Sources */,
701D9384094CBA69008B845F /* cDriverManager.cc in Sources */,
701D93EB094CBF71008B845F /* cDefaultAnalyzeDriver.cc in Sources */,
+ 709D4B83095A2EFA00EC9358 /* cTextViewerDriver.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1835,6 +1833,7 @@
DEBUG,
REVISION_SUPPORT,
);
+ GCC_STRICT_ALIASING = YES;
GCC_UNROLL_LOOPS = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
WARNING_CFLAGS = (
@@ -1859,6 +1858,7 @@
NDEBUG,
REVISION_SUPPORT,
);
+ GCC_STRICT_ALIASING = YES;
GCC_UNROLL_LOOPS = YES;
WARNING_CFLAGS = (
"-Wmost",
@@ -1956,6 +1956,7 @@
NDEBUG,
REVISION_SUPPORT,
);
+ GCC_STRICT_ALIASING = YES;
GCC_UNROLL_LOOPS = YES;
WARNING_CFLAGS = (
"-Wmost",
@@ -1978,6 +1979,7 @@
NDEBUG,
REVISION_SUPPORT,
);
+ GCC_STRICT_ALIASING = YES;
GCC_UNROLL_LOOPS = YES;
WARNING_CFLAGS = (
"-Wmost",
Modified: development/source/cpu/cCPUMemory.cc
===================================================================
--- development/source/cpu/cCPUMemory.cc 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/cpu/cCPUMemory.cc 2005-12-22 00:46:26 UTC (rev 426)
@@ -87,7 +87,7 @@
// Fill in the new information...
for (int i = 0; i < active_size; i++) {
genome[i] = other_genome[i];
- flag_array[i].Clear();
+ flag_array[i] = 0;
}
}
@@ -102,19 +102,6 @@
flag_array[to] = flag_array[from];
}
-void cCPUMemory::Clear()
-{
- for (int i = 0; i < active_size; i++) {
- genome[i].SetOp(0);
- flag_array[i].Clear();
- }
-}
-
-void cCPUMemory::ClearFlags()
-{
- for (int i = 0; i < active_size; i++) flag_array[i].Clear();
-}
-
void cCPUMemory::Reset(int new_size)
{
assert(new_size >= 0);
@@ -136,7 +123,7 @@
// Clean up all of the old memory that might need it...
for (int i = old_size; i < new_size && i < old_array_size; i++) {
genome[i].SetOp(0);
- flag_array[i].Clear();
+ flag_array[i] = 0;
}
}
@@ -157,7 +144,7 @@
SloppyInsert(pos, 1);
genome[pos] = in_inst;
- flag_array[pos].Clear();
+ flag_array[pos] = 0;
}
void cCPUMemory::Insert(int pos, const cGenome & in_genome)
@@ -168,7 +155,7 @@
SloppyInsert(pos, in_genome.GetSize());
for (int i = 0; i < in_genome.GetSize(); i++) {
genome[i+pos] = in_genome[i];
- flag_array[i+pos].Clear();
+ flag_array[i+pos] = 0;
}
}
Modified: development/source/cpu/cCPUMemory.h
===================================================================
--- development/source/cpu/cCPUMemory.h 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/cpu/cCPUMemory.h 2005-12-22 00:46:26 UTC (rev 426)
@@ -14,12 +14,9 @@
#ifndef cGenome_h
#include "cGenome.h"
#endif
-#ifndef tManagedPointerArray_h
-#include "tManagedPointerArray.h"
+#ifndef tArray_h
+#include "tArray.h"
#endif
-#ifndef cMemoryFlags_h
-#include "cMemoryFlags.h"
-#endif
class cGenome;
class cInstruction;
@@ -29,8 +26,17 @@
class cCPUMemory : public cGenome {
private:
- tManagedPointerArray<cMemoryFlags> flag_array;
-
+ static const unsigned char MASK_COPIED = 0x01;
+ static const unsigned char MASK_MUTATED = 0x02;
+ static const unsigned char MASK_EXECUTED = 0x04;
+ static const unsigned char MASK_BREAK = 0x08;
+ static const unsigned char MASK_POINTMUT = 0x10;
+ static const unsigned char MASK_COPYMUT = 0x20;
+ static const unsigned char MASK_INJECTED = 0x40;
+ static const unsigned char MASK_UNUSED = 0x80; // unused bit
+
+ tArray<unsigned char> flag_array;
+
// A collection of sloppy instructions to perform oft-used functions that
// will need to be cleaned up after this is run.
void SloppyResize(int new_size); // Set size, ignore new contents.
@@ -46,28 +52,42 @@
void operator=(const cGenome & other_genome);
void Copy(int to, int from);
- void Clear();
- void ClearFlags();
+ void Clear()
+ {
+ for (int i = 0; i < active_size; i++) {
+ genome[i].SetOp(0);
+ flag_array[i] = 0;
+ }
+ }
+ void ClearFlags() { flag_array.SetAll(0); }
void Reset(int new_size); // Reset size, clearing contents...
void Resize(int new_size); // Reset size, save contents, init to default
void ResizeOld(int new_size); // Reset size, save contents, init to previous
- bool FlagCopied(int pos) const { return flag_array[pos].copied; }
- bool FlagMutated(int pos) const { return flag_array[pos].mutated; }
- bool FlagExecuted(int pos) const { return flag_array[pos].executed; }
- bool FlagBreakpoint(int pos) const { return flag_array[pos].breakpoint; }
- bool FlagPointMut(int pos) const { return flag_array[pos].point_mut; }
- bool FlagCopyMut(int pos) const { return flag_array[pos].copy_mut; }
- bool FlagInjected(int pos) const { return flag_array[pos].injected; }
-
- bool & FlagCopied(int pos) { return flag_array[pos].copied; }
- bool & FlagMutated(int pos) { return flag_array[pos].mutated; }
- bool & FlagExecuted(int pos) { return flag_array[pos].executed; }
- bool & FlagBreakpoint(int pos) { return flag_array[pos].breakpoint; }
- bool & FlagPointMut(int pos) { return flag_array[pos].point_mut; }
- bool & FlagCopyMut(int pos) { return flag_array[pos].copy_mut; }
- bool & FlagInjected(int pos) { return flag_array[pos].injected; }
-
+ bool FlagCopied(int pos) const { return MASK_COPIED & flag_array[pos]; }
+ bool FlagMutated(int pos) const { return MASK_MUTATED & flag_array[pos]; }
+ bool FlagExecuted(int pos) const { return MASK_EXECUTED & flag_array[pos]; }
+ bool FlagBreakpoint(int pos) const { return MASK_BREAK & flag_array[pos]; }
+ bool FlagPointMut(int pos) const { return MASK_POINTMUT & flag_array[pos]; }
+ bool FlagCopyMut(int pos) const { return MASK_COPYMUT & flag_array[pos]; }
+ bool FlagInjected(int pos) const { return MASK_INJECTED & flag_array[pos]; }
+
+ void SetFlagCopied(int pos) { flag_array[pos] |= MASK_COPIED; }
+ void SetFlagMutated(int pos) { flag_array[pos] |= MASK_MUTATED; }
+ void SetFlagExecuted(int pos) { flag_array[pos] |= MASK_EXECUTED; }
+ void SetFlagBreakpoint(int pos) { flag_array[pos] |= MASK_BREAK; }
+ void SetFlagPointMut(int pos) { flag_array[pos] |= MASK_POINTMUT; }
+ void SetFlagCopyMut(int pos) { flag_array[pos] |= MASK_COPYMUT; }
+ void SetFlagInjected(int pos) { flag_array[pos] |= MASK_INJECTED; }
+
+ void ClearFlagCopied(int pos) { flag_array[pos] &= ~MASK_COPIED; }
+ void ClearFlagMutated(int pos) { flag_array[pos] &= ~MASK_MUTATED; }
+ void ClearFlagExecuted(int pos) { flag_array[pos] &= ~MASK_EXECUTED; }
+ void ClearFlagBreakpoint(int pos) { flag_array[pos] &= ~MASK_BREAK; }
+ void ClearFlagPointMut(int pos) { flag_array[pos] &= ~MASK_POINTMUT; }
+ void ClearFlagCopyMut(int pos) { flag_array[pos] &= ~MASK_COPYMUT; }
+ void ClearFlagInjected(int pos) { flag_array[pos] &= ~MASK_INJECTED; }
+
void Insert(int pos, const cInstruction & in_inst);
void Insert(int pos, const cGenome & in_genome);
void Remove(int pos, int num_insts=1);
Modified: development/source/cpu/cHardware4Stack.cc
===================================================================
--- development/source/cpu/cHardware4Stack.cc 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/cpu/cHardware4Stack.cc 2005-12-22 00:46:26 UTC (rev 426)
@@ -326,7 +326,7 @@
IP().Adjust();
#ifdef BREAKPOINTS
- if (IP().FlagBreakpoint() == true) {
+ if (IP().FlagBreakpoint()) {
organism->DoBreakpoint();
}
#endif
@@ -415,7 +415,7 @@
int inst_idx = m_inst_set->GetLibFunctionIndex(actual_inst);
// Mark the instruction as executed
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
#ifdef INSTRUCTION_COUNT
@@ -934,7 +934,7 @@
// Set instruction flags on the injected code
for (int i = 0; i < inject_code.GetSize(); i++) {
- memory_array[target_mem_space].FlagInjected(i) = true;
+ memory_array[target_mem_space].SetFlagInjected(i);
}
organism->GetPhenotype().IsModified() = true;
@@ -966,8 +966,8 @@
assert(mut_point >= 0 && mut_point < GetMemory(0).GetSize());
GetMemory(0)[mut_point] = m_inst_set->GetRandomInst();
- GetMemory(0).FlagMutated(mut_point) = true;
- GetMemory(0).FlagPointMut(mut_point) = true;
+ GetMemory(0).SetFlagMutated(mut_point);
+ GetMemory(0).SetFlagPointMut(mut_point);
//organism->GetPhenotype().IsMutated() = true;
organism->CPUStats().mut_stats.point_mut_count++;
}
@@ -1110,7 +1110,7 @@
switch (type) {
case nMutation::TYPE_POINT:
target_memory[pos] = m_inst_set->GetRandomInst();
- target_memory.FlagMutated(pos) = true;
+ target_memory.SetFlagMutated(pos);
break;
case nMutation::TYPE_INSERT:
case nMutation::TYPE_DELETE:
@@ -1152,7 +1152,7 @@
// If this is the first line of the template, mark it executed.
if (GetLabel().GetSize() <= m_world->GetConfig().MAX_LABEL_EXE_SIZE.Get()) {
- inst_ptr->FlagExecuted() = true;
+ inst_ptr->SetFlagExecuted();
}
}
}
@@ -1227,7 +1227,7 @@
if (m_inst_set->IsNop(IP().GetNextInst())) {
IP().Advance();
default_stack = m_inst_set->GetNopMod(IP().GetInst());
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
}
return default_stack;
}
@@ -1240,7 +1240,7 @@
IP().Advance();
int nop_head = m_inst_set->GetNopMod(IP().GetInst());
if (nop_head < nHardware::NUM_HEADS) default_head = nop_head;
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
}
return default_head;
}
@@ -1338,7 +1338,6 @@
// Divide Deletions
if (organism->TestDivideDel() && child_genome.GetSize() > MIN_CREATURE_SIZE){
const unsigned int mut_line = m_world->GetRandom().GetUInt(child_genome.GetSize());
- // if( child_genome.FlagCopied(mut_line) == true) copied_size_change--;
child_genome.Remove(mut_line);
cpu_stats.mut_stats.divide_delete_mut_count++;
}
@@ -1396,7 +1395,6 @@
// If we have lines to delete...
for (int i = 0; i < num_mut; i++) {
int site = m_world->GetRandom().GetUInt(child_genome.GetSize());
- // if (child_genome.FlagCopied(site) == true) copied_size_change--;
child_genome.Remove(site);
cpu_stats.mut_stats.delete_mut_count++;
}
@@ -1415,12 +1413,12 @@
// Count up mutated lines
for(int i = 0; i < GetMemory(0).GetSize(); i++){
- if (GetMemory(0).FlagPointMut(i) == true) {
+ if (GetMemory(0).FlagPointMut(i)) {
cpu_stats.mut_stats.point_mut_line_count++;
}
}
for(int i = 0; i < child_genome.GetSize(); i++){
- if( child_genome.FlagCopyMut(i) == true) {
+ if( child_genome.FlagCopyMut(i)) {
cpu_stats.mut_stats.copy_mut_line_count++;
}
}
@@ -1450,7 +1448,6 @@
// Divide Deletions
if (organism->TestDivideDel() && injected_code.GetSize() > MIN_CREATURE_SIZE){
const unsigned int mut_line = m_world->GetRandom().GetUInt(injected_code.GetSize());
- // if( injected_code.FlagCopied(mut_line) == true) copied_size_change--;
injected_code.Remove(mut_line);
//cpu_stats.mut_stats.divide_delete_mut_count++;
}
@@ -1508,7 +1505,6 @@
// If we have lines to delete...
for (int i = 0; i < num_mut; i++) {
int site = m_world->GetRandom().GetUInt(injected_code.GetSize());
- // if (injected_code.FlagCopied(site) == true) copied_size_change--;
injected_code.Remove(site);
//cpu_stats.mut_stats.delete_mut_count++;
}
@@ -1524,18 +1520,6 @@
}
}
- /*
- // Count up mutated lines
- for(int i = 0; i < GetMemory(0).GetSize(); i++){
- if (GetMemory(0).FlagPointMut(i) == true) {
- cpu_stats.mut_stats.point_mut_line_count++;
- }
- }
- for(int i = 0; i < injected_code.GetSize(); i++){
- if( injected_code.FlagCopyMut(i) == true) {
- cpu_stats.mut_stats.copy_mut_line_count++;
- }
- }*/
}
@@ -1834,7 +1818,7 @@
if (value < 0 || value >= m_inst_set->GetSize()) value = 0;
active_head.SetInst(cInstruction(value));
- active_head.FlagCopied() = true;
+ active_head.SetFlagCopied();
// Advance the head after write...
active_head++;
@@ -1859,8 +1843,8 @@
if (organism->TestCopyMut()) {
read_inst = m_inst_set->GetRandomInst();
cpu_stats.mut_stats.copy_mut_count++;
- write_head.FlagMutated() = true;
- write_head.FlagCopyMut() = true;
+ write_head.SetFlagMutated();
+ write_head.SetFlagCopyMut();
//organism->GetPhenotype().IsMutated() = true;
}
ReadInst(read_inst.GetOp());
@@ -1868,7 +1852,7 @@
cpu_stats.mut_stats.copies_exec++;
write_head.SetInst(read_inst);
- write_head.FlagCopied() = true; // Set the copied flag...
+ write_head.SetFlagCopied(); // Set the copied flag...
// TriggerMutations(nMutation::TRIGGER_WRITE, write_head);
Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/cpu/cHardwareCPU.cc 2005-12-22 00:46:26 UTC (rev 426)
@@ -453,7 +453,7 @@
IP().Adjust();
#ifdef BREAKPOINTS
- if (IP().FlagBreakpoint() == true) {
+ if (IP().FlagBreakpoint()) {
organism->DoBreakpoint();
}
#endif
@@ -543,7 +543,7 @@
int inst_idx = m_inst_set->GetLibFunctionIndex(actual_inst);
// Mark the instruction as executed
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
#ifdef INSTRUCTION_COUNT
@@ -990,7 +990,7 @@
// Set instruction flags on the injected code
for (int i = line_num; i < line_num + inject_size; i++) {
- memory.FlagInjected(i) = true;
+ memory.SetFlagInjected(i);
}
organism->GetPhenotype().IsModified() = true;
@@ -1017,7 +1017,7 @@
// Set instruction flags on the injected code
for (int i = line_num; i < line_num + inject_size; i++) {
- memory.FlagInjected(i) = true;
+ memory.SetFlagInjected(i);
}
organism->GetPhenotype().IsModified() = true;
organism->GetPhenotype().IsMultiThread() = true;
@@ -1051,8 +1051,8 @@
assert(mut_point >= 0 && mut_point < GetMemory().GetSize());
GetMemory()[mut_point] = m_inst_set->GetRandomInst();
- GetMemory().FlagMutated(mut_point) = true;
- GetMemory().FlagPointMut(mut_point) = true;
+ GetMemory().SetFlagMutated(mut_point);
+ GetMemory().SetFlagPointMut(mut_point);
//organism->GetPhenotype().IsMutated() = true;
organism->CPUStats().mut_stats.point_mut_count++;
}
@@ -1196,7 +1196,7 @@
switch (type) {
case nMutation::TYPE_POINT:
target_memory[pos] = m_inst_set->GetRandomInst();
- target_memory.FlagMutated(pos) = true;
+ target_memory.SetFlagMutated(pos);
break;
case nMutation::TYPE_INSERT:
case nMutation::TYPE_DELETE:
@@ -1250,7 +1250,7 @@
// If this is the first line of the template, mark it executed.
if (GetLabel().GetSize() <= m_world->GetConfig().MAX_LABEL_EXE_SIZE.Get()) {
- inst_ptr->FlagExecuted() = true;
+ inst_ptr->SetFlagExecuted();
}
}
}
@@ -1321,7 +1321,7 @@
if (m_inst_set->IsNop(IP().GetNextInst())) {
IP().Advance();
default_register = m_inst_set->GetNopMod(IP().GetInst());
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
}
return default_register;
}
@@ -1334,7 +1334,7 @@
if (m_inst_set->IsNop(IP().GetNextInst())) {
IP().Advance();
default_head = m_inst_set->GetNopMod(IP().GetInst());
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
}
return default_head;
}
@@ -1561,7 +1561,6 @@
// Divide Deletions
if (organism->TestDivideDel() && child_genome.GetSize() > MIN_CREATURE_SIZE){
const unsigned int mut_line = m_world->GetRandom().GetUInt(child_genome.GetSize());
- // if( child_genome.FlagCopied(mut_line) == true) copied_size_change--;
child_genome.Remove(mut_line);
cpu_stats.mut_stats.divide_delete_mut_count++;
}
@@ -1619,7 +1618,6 @@
// If we have lines to delete...
for (int i = 0; i < num_mut; i++) {
int site = m_world->GetRandom().GetUInt(child_genome.GetSize());
- // if (child_genome.FlagCopied(site) == true) copied_size_change--;
child_genome.Remove(site);
cpu_stats.mut_stats.delete_mut_count++;
}
@@ -1638,12 +1636,12 @@
// Count up mutated lines
for(int i = 0; i < GetMemory().GetSize(); i++){
- if (GetMemory().FlagPointMut(i) == true) {
+ 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) == true) {
+ if( child_genome.FlagCopyMut(i)) {
cpu_stats.mut_stats.copy_mut_line_count++;
}
}
@@ -2349,17 +2347,17 @@
if (organism->TestCopyMut()) {
to.SetInst(m_inst_set->GetRandomInst());
- to.FlagMutated() = true; // Mark this instruction as mutated...
- to.FlagCopyMut() = true; // Mark this instruction as copy mut...
+ 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++;
} else {
to.SetInst(from.GetInst());
- to.FlagMutated() = false; // UnMark
- to.FlagCopyMut() = false; // UnMark
+ to.ClearFlagMutated(); // UnMark
+ to.ClearFlagCopyMut(); // UnMark
}
- to.FlagCopied() = true; // Set the copied flag.
+ to.SetFlagCopied(); // Set the copied flag.
cpu_stats.mut_stats.copies_exec++;
return true;
}
@@ -2385,17 +2383,17 @@
// Change value on a mutation...
if (organism->TestCopyMut()) {
to.SetInst(m_inst_set->GetRandomInst());
- to.FlagMutated() = true; // Mark this instruction as mutated...
- to.FlagCopyMut() = true; // Mark this instruction as copy mut...
+ 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++;
} else {
to.SetInst(cInstruction(value));
- to.FlagMutated() = false; // UnMark
- to.FlagCopyMut() = false; // UnMark
+ to.ClearFlagMutated(); // UnMark
+ to.ClearFlagCopyMut(); // UnMark
}
-to.FlagCopied() = true; // Set the copied flag.
+to.SetFlagCopied(); // Set the copied flag.
cpu_stats.mut_stats.copies_exec++;
return true;
}
@@ -2418,17 +2416,17 @@
// Change value on a mutation...
if (organism->TestCopyMut()) {
to.SetInst(m_inst_set->GetRandomInst());
- to.FlagMutated() = true; // Mark this instruction as mutated...
- to.FlagCopyMut() = true; // Mark this instruction as copy mut...
+ 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++;
} else {
to.SetInst(cInstruction(value));
- to.FlagMutated() = false; // UnMark
- to.FlagCopyMut() = false; // UnMark
+ to.ClearFlagMutated(); // UnMark
+ to.ClearFlagCopyMut(); // UnMark
}
- to.FlagCopied() = true; // Set the copied flag.
+ to.SetFlagCopied(); // Set the copied flag.
cpu_stats.mut_stats.copies_exec++;
return true;
}
@@ -2442,8 +2440,8 @@
// Compare is dangerous -- it can cause mutations!
if (organism->TestCopyMut()) {
to.SetInst(m_inst_set->GetRandomInst());
- to.FlagMutated() = true; // Mark this instruction as mutated...
- to.FlagCopyMut() = true; // Mark this instruction as copy mut...
+ to.SetFlagMutated(); // Mark this instruction as mutated...
+ to.SetFlagCopyMut(); // Mark this instruction as copy mut...
//organism->GetPhenotype().IsMutated() = true;
}
@@ -2511,7 +2509,7 @@
int lines_executed = 0;
for ( int i = 0; i < GetMemory().GetSize(); i++ ) {
- if ( GetMemory().FlagExecuted(i) == true ) lines_executed++;
+ if ( GetMemory().FlagExecuted(i)) lines_executed++;
}
organism->GetPhenotype().SetLinesExecuted(lines_executed);
@@ -3239,7 +3237,7 @@
if (value < 0 || value >= m_inst_set->GetSize()) value = 0;
active_head.SetInst(cInstruction(value));
- active_head.FlagCopied() = true;
+ active_head.SetFlagCopied();
// Advance the head after write...
active_head++;
@@ -3264,15 +3262,15 @@
if (organism->TestCopyMut()) {
read_inst = m_inst_set->GetRandomInst();
cpu_stats.mut_stats.copy_mut_count++;
- write_head.FlagMutated() = true;
- write_head.FlagCopyMut() = true;
+ write_head.SetFlagMutated();
+ write_head.SetFlagCopyMut();
//organism->GetPhenotype().IsMutated() = true;
}
cpu_stats.mut_stats.copies_exec++;
write_head.SetInst(read_inst);
- write_head.FlagCopied() = true; // Set the copied flag...
+ write_head.SetFlagCopied(); // Set the copied flag...
// TriggerMutations(nMutation::TRIGGER_WRITE, write_head);
@@ -3297,15 +3295,15 @@
if ( m_world->GetRandom().P(organism->GetCopyMutProb() / reduction) ) {
read_inst = m_inst_set->GetRandomInst();
cpu_stats.mut_stats.copy_mut_count++;
- write_head.FlagMutated() = true;
- write_head.FlagCopyMut() = true;
+ write_head.SetFlagMutated();
+ write_head.SetFlagCopyMut();
//organism->GetPhenotype().IsMutated() = true;
}
cpu_stats.mut_stats.copies_exec++;
write_head.SetInst(read_inst);
- write_head.FlagCopied() = true; // Set the copied flag...
+ write_head.SetFlagCopied(); // Set the copied flag...
read_head.Advance();
write_head.Advance();
Modified: development/source/cpu/cHardwareSMT.cc
===================================================================
--- development/source/cpu/cHardwareSMT.cc 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/cpu/cHardwareSMT.cc 2005-12-22 00:46:26 UTC (rev 426)
@@ -181,7 +181,7 @@
IP().Adjust();
#ifdef BREAKPOINTS
- if (IP().FlagBreakpoint() == true) {
+ if (IP().FlagBreakpoint()) {
organism->DoBreakpoint();
}
#endif
@@ -267,7 +267,7 @@
int inst_idx = m_inst_set->GetLibFunctionIndex(actual_inst);
// Mark the instruction as executed
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
#ifdef INSTRUCTION_COUNT
@@ -753,8 +753,8 @@
assert(mut_point >= 0 && mut_point < m_mem_array[0].GetSize());
m_mem_array[0][mut_point] = m_inst_set->GetRandomInst();
- m_mem_array[0].FlagMutated(mut_point) = true;
- m_mem_array[0].FlagPointMut(mut_point) = true;
+ m_mem_array[0].SetFlagMutated(mut_point);
+ m_mem_array[0].SetFlagPointMut(mut_point);
organism->CPUStats().mut_stats.point_mut_count++;
}
@@ -895,7 +895,7 @@
switch (type) {
case nMutation::TYPE_POINT:
target_memory[pos] = m_inst_set->GetRandomInst();
- target_memory.FlagMutated(pos) = true;
+ target_memory.SetFlagMutated(pos);
break;
case nMutation::TYPE_INSERT:
case nMutation::TYPE_DELETE:
@@ -937,7 +937,7 @@
// If this is the first line of the template, mark it executed.
if (GetLabel().GetSize() <= m_world->GetConfig().MAX_LABEL_EXE_SIZE.Get()) {
- inst_ptr->FlagExecuted() = true;
+ inst_ptr->SetFlagExecuted();
}
}
}
@@ -1011,7 +1011,7 @@
if (m_inst_set->IsNop(IP().GetNextInst())) {
IP().Advance();
default_stack = m_inst_set->GetNopMod(IP().GetInst());
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
}
return default_stack;
}
@@ -1023,7 +1023,7 @@
if (m_inst_set->IsNop(IP().GetNextInst())) {
IP().Advance();
default_stack = m_inst_set->GetNopMod(IP().GetInst());
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
} else {
default_stack = FindNextStack(default_stack);
}
@@ -1037,7 +1037,7 @@
if (m_inst_set->IsNop(IP().GetNextInst())) {
IP().Advance();
default_stack = m_inst_set->GetNopMod(IP().GetInst());
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
} else {
default_stack = FindPreviousStack(default_stack);
}
@@ -1051,7 +1051,7 @@
if (m_inst_set->IsNop(IP().GetNextInst())) {
IP().Advance();
default_stack = m_inst_set->GetNopMod(IP().GetInst());
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
} else {
default_stack = FindPreviousStack(default_stack);
}
@@ -1066,7 +1066,7 @@
IP().Advance();
int nop_head = m_inst_set->GetNopMod(IP().GetInst());
if (nop_head < nHardware::NUM_HEADS) default_head = nop_head;
- IP().FlagExecuted() = true;
+ IP().SetFlagExecuted();
}
return default_head;
}
@@ -1173,7 +1173,6 @@
// Divide Deletions
if (organism->TestDivideDel() && child_genome.GetSize() > MIN_CREATURE_SIZE){
const unsigned int mut_line = m_world->GetRandom().GetUInt(child_genome.GetSize());
- // if( child_genome.FlagCopied(mut_line) == true) copied_size_change--;
child_genome.Remove(mut_line);
cpu_stats.mut_stats.divide_delete_mut_count++;
}
@@ -1231,7 +1230,6 @@
// If we have lines to delete...
for (int i = 0; i < num_mut; i++) {
int site = m_world->GetRandom().GetUInt(child_genome.GetSize());
- // if (child_genome.FlagCopied(site) == true) copied_size_change--;
child_genome.Remove(site);
cpu_stats.mut_stats.delete_mut_count++;
}
@@ -1250,12 +1248,12 @@
// Count up mutated lines
for(int i = 0; i < m_mem_array[0].GetSize(); i++){
- if (m_mem_array[0].FlagPointMut(i) == true) {
+ if (m_mem_array[0].FlagPointMut(i)) {
cpu_stats.mut_stats.point_mut_line_count++;
}
}
for(int i = 0; i < child_genome.GetSize(); i++){
- if( child_genome.FlagCopyMut(i) == true) {
+ if( child_genome.FlagCopyMut(i)) {
cpu_stats.mut_stats.copy_mut_line_count++;
}
}
@@ -1731,7 +1729,7 @@
if (value < 0 || value >= m_inst_set->GetSize()) value = nHardwareSMT::NOPX;
active_head.SetInst(cInstruction(value));
- active_head.FlagCopied() = true;
+ active_head.SetFlagCopied();
// Advance the head after write...
active_head++;
@@ -1754,8 +1752,8 @@
if (organism->TestCopyMut()) {
read_inst = m_inst_set->GetRandomInst();
cpu_stats.mut_stats.copy_mut_count++;
- write_head.FlagMutated() = true;
- write_head.FlagCopyMut() = true;
+ write_head.SetFlagMutated();
+ write_head.SetFlagCopyMut();
//organism->GetPhenotype().IsMutated() = true;
}
ReadInst(read_inst.GetOp());
@@ -1763,7 +1761,7 @@
cpu_stats.mut_stats.copies_exec++;
write_head.SetInst(read_inst);
- write_head.FlagCopied() = true; // Set the copied flag...
+ write_head.SetFlagCopied(); // Set the copied flag...
read_head.Advance();
write_head.Advance();
Modified: development/source/cpu/cHeadCPU.cc
===================================================================
--- development/source/cpu/cHeadCPU.cc 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/cpu/cHeadCPU.cc 2005-12-22 00:46:26 UTC (rev 426)
@@ -221,42 +221,78 @@
-bool & cHeadCPU::FlagCopied()
+void cHeadCPU::SetFlagCopied()
{
assert(cur_hardware != NULL);
- return cur_hardware->GetMemory().FlagCopied(position);
+ return cur_hardware->GetMemory().SetFlagCopied(position);
}
-bool & cHeadCPU::FlagMutated()
+void cHeadCPU::SetFlagMutated()
{
assert(cur_hardware != NULL);
- return cur_hardware->GetMemory().FlagMutated(position);
+ return cur_hardware->GetMemory().SetFlagMutated(position);
}
-bool & cHeadCPU::FlagExecuted()
+void cHeadCPU::SetFlagExecuted()
{
assert(cur_hardware != NULL);
- return cur_hardware->GetMemory().FlagExecuted(position);
+ return cur_hardware->GetMemory().SetFlagExecuted(position);
}
-bool & cHeadCPU::FlagBreakpoint()
+void cHeadCPU::SetFlagBreakpoint()
{
assert(cur_hardware != NULL);
- return cur_hardware->GetMemory().FlagBreakpoint(position);
+ return cur_hardware->GetMemory().SetFlagBreakpoint(position);
}
-bool & cHeadCPU::FlagPointMut()
+void cHeadCPU::SetFlagPointMut()
{
assert(cur_hardware != NULL);
- return cur_hardware->GetMemory().FlagPointMut(position);
+ return cur_hardware->GetMemory().SetFlagPointMut(position);
}
-bool & cHeadCPU::FlagCopyMut()
+void cHeadCPU::SetFlagCopyMut()
{
assert(cur_hardware != NULL);
- return cur_hardware->GetMemory().FlagCopyMut(position);
+ return cur_hardware->GetMemory().SetFlagCopyMut(position);
}
+void cHeadCPU::ClearFlagCopied()
+{
+ assert(cur_hardware != NULL);
+ return cur_hardware->GetMemory().ClearFlagCopied(position);
+}
+
+void cHeadCPU::ClearFlagMutated()
+{
+ assert(cur_hardware != NULL);
+ return cur_hardware->GetMemory().ClearFlagMutated(position);
+}
+
+void cHeadCPU::ClearFlagExecuted()
+{
+ assert(cur_hardware != NULL);
+ return cur_hardware->GetMemory().ClearFlagExecuted(position);
+}
+
+void cHeadCPU::ClearFlagBreakpoint()
+{
+ assert(cur_hardware != NULL);
+ return cur_hardware->GetMemory().ClearFlagBreakpoint(position);
+}
+
+void cHeadCPU::ClearFlagPointMut()
+{
+ assert(cur_hardware != NULL);
+ return cur_hardware->GetMemory().ClearFlagPointMut(position);
+}
+
+void cHeadCPU::ClearFlagCopyMut()
+{
+ assert(cur_hardware != NULL);
+ return cur_hardware->GetMemory().ClearFlagCopyMut(position);
+}
+
cHeadCPU & cHeadCPU::operator=(const cHeadCPU & in_cpu_head)
{
main_hardware = in_cpu_head.main_hardware;
Modified: development/source/cpu/cHeadCPU.h
===================================================================
--- development/source/cpu/cHeadCPU.h 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/cpu/cHeadCPU.h 2005-12-22 00:46:26 UTC (rev 426)
@@ -88,13 +88,20 @@
virtual void RemoveInst();
virtual const cInstruction & GetNextInst();
- virtual bool & FlagCopied();
- virtual bool & FlagMutated();
- virtual bool & FlagExecuted();
- virtual bool & FlagBreakpoint();
- virtual bool & FlagPointMut();
- virtual bool & FlagCopyMut();
-
+ virtual void SetFlagCopied();
+ virtual void SetFlagMutated();
+ virtual void SetFlagExecuted();
+ virtual void SetFlagBreakpoint();
+ virtual void SetFlagPointMut();
+ virtual void SetFlagCopyMut();
+
+ virtual void ClearFlagCopied();
+ virtual void ClearFlagMutated();
+ virtual void ClearFlagExecuted();
+ virtual void ClearFlagBreakpoint();
+ virtual void ClearFlagPointMut();
+ virtual void ClearFlagCopyMut();
+
// Operator Overloading...
virtual cHeadCPU & operator=(const cHeadCPU & in_cpu_head);
cHeadCPU & operator++();
Modified: development/source/cpu/cHeadMultiMem.cc
===================================================================
--- development/source/cpu/cHeadMultiMem.cc 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/cpu/cHeadMultiMem.cc 2005-12-22 00:46:26 UTC (rev 426)
@@ -143,42 +143,78 @@
return (AtEnd()) ? cInstSet::GetInstError() : GetMemory()[position+1];
}
-bool & cHeadMultiMem::FlagCopied()
+void cHeadMultiMem::SetFlagCopied()
{
assert(cur_hardware != NULL);
- return GetMemory().FlagCopied(position);
+ GetMemory().SetFlagCopied(position);
}
-bool & cHeadMultiMem::FlagMutated()
+void cHeadMultiMem::SetFlagMutated()
{
assert(cur_hardware != NULL);
- return GetMemory().FlagMutated(position);
+ GetMemory().SetFlagMutated(position);
}
-bool & cHeadMultiMem::FlagExecuted()
+void cHeadMultiMem::SetFlagExecuted()
{
assert(cur_hardware != NULL);
- return GetMemory().FlagExecuted(position);
+ GetMemory().SetFlagExecuted(position);
}
-bool & cHeadMultiMem::FlagBreakpoint()
+void cHeadMultiMem::SetFlagBreakpoint()
{
assert(cur_hardware != NULL);
- return GetMemory().FlagBreakpoint(position);
+ GetMemory().SetFlagBreakpoint(position);
}
-bool & cHeadMultiMem::FlagPointMut()
+void cHeadMultiMem::SetFlagPointMut()
{
assert(cur_hardware != NULL);
- return GetMemory().FlagPointMut(position);
+ GetMemory().SetFlagPointMut(position);
}
-bool & cHeadMultiMem::FlagCopyMut()
+void cHeadMultiMem::SetFlagCopyMut()
{
assert(cur_hardware != NULL);
- return GetMemory().FlagCopyMut(position);
+ GetMemory().SetFlagCopyMut(position);
}
+void cHeadMultiMem::ClearFlagCopied()
+{
+ assert(cur_hardware != NULL);
+ GetMemory().ClearFlagCopied(position);
+}
+
+void cHeadMultiMem::ClearFlagMutated()
+{
+ assert(cur_hardware != NULL);
+ GetMemory().ClearFlagMutated(position);
+}
+
+void cHeadMultiMem::ClearFlagExecuted()
+{
+ assert(cur_hardware != NULL);
+ GetMemory().ClearFlagExecuted(position);
+}
+
+void cHeadMultiMem::ClearFlagBreakpoint()
+{
+ assert(cur_hardware != NULL);
+ GetMemory().ClearFlagBreakpoint(position);
+}
+
+void cHeadMultiMem::ClearFlagPointMut()
+{
+ assert(cur_hardware != NULL);
+ GetMemory().ClearFlagPointMut(position);
+}
+
+void cHeadMultiMem::ClearFlagCopyMut()
+{
+ assert(cur_hardware != NULL);
+ GetMemory().ClearFlagCopyMut(position);
+}
+
cHeadMultiMem & cHeadMultiMem::operator=(const cHeadMultiMem & in_cpu_head)
{
main_hardware = in_cpu_head.main_hardware;
Modified: development/source/cpu/cHeadMultiMem.h
===================================================================
--- development/source/cpu/cHeadMultiMem.h 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/cpu/cHeadMultiMem.h 2005-12-22 00:46:26 UTC (rev 426)
@@ -41,13 +41,20 @@
void RemoveInst();
const cInstruction& GetNextInst();
- bool& FlagCopied();
- bool& FlagMutated();
- bool& FlagExecuted();
- bool& FlagBreakpoint();
- bool& FlagPointMut();
- bool& FlagCopyMut();
-
+ void SetFlagCopied();
+ void SetFlagMutated();
+ void SetFlagExecuted();
+ void SetFlagBreakpoint();
+ void SetFlagPointMut();
+ void SetFlagCopyMut();
+
+ void ClearFlagCopied();
+ void ClearFlagMutated();
+ void ClearFlagExecuted();
+ void ClearFlagBreakpoint();
+ void ClearFlagPointMut();
+ void ClearFlagCopyMut();
+
// Operator Overloading...
cHeadMultiMem& operator=(const cHeadMultiMem & in_cpu_head);
bool operator==(const cHeadMultiMem & in_cpu_head) const;
Deleted: development/source/cpu/cMemoryFlags.h
===================================================================
--- development/source/cpu/cMemoryFlags.h 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/cpu/cMemoryFlags.h 2005-12-22 00:46:26 UTC (rev 426)
@@ -1,41 +0,0 @@
-/*
- * cMemoryFlags.h
- * Avida
- *
- * Created by David on 11/30/05.
- * Copyright 2005 Michigan State University. All rights reserved.
- * Copyright 1999-2003 California Institute of Technology.
- *
- */
-
-#ifndef cMemoryFlags_h
-#define cMemoryFlags_h
-
-class cMemoryFlags {
- friend class cCPUMemory;
-protected:
- bool copied; // Has this site been copied?
- bool mutated; // Has this site been mutated?
- bool executed; // Has this site been executed?
- bool breakpoint; // Has a breakpoint been set at this position?
- bool point_mut; // Has there been a point mutation here?
- bool copy_mut; // Has there been a copy mutation here?
- bool injected; // Was this instruction injected into the genome?
-
-public:
- cMemoryFlags() { Clear(); }
- ~cMemoryFlags() { ; }
-
- void Clear()
- {
- copied = false;
- mutated = false;
- executed = false;
- breakpoint = false;
- point_mut = false;
- copy_mut = false;
- injected = false;
- }
-};
-
-#endif
Modified: development/source/viewer/CMakeLists.txt
===================================================================
--- development/source/viewer/CMakeLists.txt 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/viewer/CMakeLists.txt 2005-12-22 00:46:26 UTC (rev 426)
@@ -7,7 +7,6 @@
)
SET(libviewer_SOURCES
- cAvidaDriver_TextPopViewer.cc
cBarScreen.cc
cEnvironmentScreen.cc
cHistScreen.cc
@@ -17,6 +16,7 @@
cScreen.cc
cStatsScreen.cc
cSymbolUtil.cc
+ cTextViewerDriver.cc
cTextWindow.cc
cView.cc
cViewInfo.cc
@@ -32,6 +32,8 @@
cpu
event
analyze
+ drivers
+ analyze
cpu
main
tools
Deleted: development/source/viewer/cAvidaDriver_TextPopViewer.cc
===================================================================
--- development/source/viewer/cAvidaDriver_TextPopViewer.cc 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/viewer/cAvidaDriver_TextPopViewer.cc 2005-12-22 00:46:26 UTC (rev 426)
@@ -1,96 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2001 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#include "cAvidaDriver_TextPopViewer.h"
-
-#include "cPopulation.h"
-#include "cView.h"
-#include "cWorld.h"
-
-#include <iostream>
-
-using namespace std;
-
-cAvidaDriver_TextPopViewer::
-cAvidaDriver_TextPopViewer(cWorld* world)
- : cAvidaDriver_Population(world)
- , viewer(NULL)
-{
- cout << "Initializing Text Viewer... " << flush;
-
- viewer = new cView(world);
- viewer->SetViewMode(world->GetConfig().VIEW_MODE.Get());
-
- cout << " ...done" << endl;
-}
-
-cAvidaDriver_TextPopViewer::~cAvidaDriver_TextPopViewer()
-{
- if (viewer != NULL) EndProg(0);
-}
-
-void cAvidaDriver_TextPopViewer::ProcessOrganisms()
-{
- // Process the update.
- const int UD_size = m_world->GetConfig().AVE_TIME_SLICE.Get() * m_world->GetPopulation().GetNumOrganisms();
- const double step_size = 1.0 / (double) UD_size;
-
- // Are we stepping through an organism?
- if (viewer->GetStepOrganism() != -1) { // Yes we are!
- // Keep the viewer informed about the organism we are stepping through...
- for (int i = 0; i < UD_size; i++) {
- const int next_id = m_world->GetPopulation().ScheduleOrganism();
- if (next_id == viewer->GetStepOrganism()) viewer->NotifyUpdate();
- m_world->GetPopulation().ProcessStep(step_size, next_id);
- }
- }
- else {
- for (int i = 0; i < UD_size; i++) m_world->GetPopulation().ProcessStep(step_size);
- }
-
- // end of update stats...
- m_world->GetPopulation().CalcUpdateStats();
-
- // Setup the viewer for the new update.
- if (viewer->GetStepOrganism() == -1) NotifyUpdate();
-}
-
-void cAvidaDriver_TextPopViewer::NotifyComment(const cString & in_string)
-{
- // Send a commment to the user.
- viewer->NotifyComment(in_string);
-}
-
-void cAvidaDriver_TextPopViewer::NotifyWarning(const cString & in_string)
-{
- // Send a warning to the user.
- viewer->NotifyWarning(in_string);
-}
-
-void cAvidaDriver_TextPopViewer::NotifyError(const cString & in_string)
-{
- // Send an error to the user.
- viewer->NotifyError(in_string);
-}
-
-void cAvidaDriver_TextPopViewer::NotifyUpdate()
-{
- viewer->NotifyUpdate();
- viewer->NewUpdate();
-
- // This is needed to have the top bar drawn properly; I'm not sure why...
- static bool first_update = true;
- if (first_update) {
- viewer->Refresh();
- first_update = false;
- }
-}
-
-void cAvidaDriver_TextPopViewer::SignalBreakpoint()
-{
- viewer->DoBreakpoint();
-}
Deleted: development/source/viewer/cAvidaDriver_TextPopViewer.h
===================================================================
--- development/source/viewer/cAvidaDriver_TextPopViewer.h 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/viewer/cAvidaDriver_TextPopViewer.h 2005-12-22 00:46:26 UTC (rev 426)
@@ -1,34 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2001 California Institute of Technology //
-// //
-// Read the COPYING and README files, or contact 'avida at alife.org', //
-// before continuing. SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE. //
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef cAvidaDriver_TextPopViewer_h
-#define cAvidaDriver_TextPopViewer_h
-
-#ifndef cAvidaDriver_Population_h
-#include "cAvidaDriver_Population.h"
-#endif
-
-class cView;
-
-class cAvidaDriver_TextPopViewer : public cAvidaDriver_Population {
-protected:
- cView* viewer;
-public:
- cAvidaDriver_TextPopViewer(cWorld* world);
- ~cAvidaDriver_TextPopViewer();
-
- virtual void ProcessOrganisms();
-
- virtual void NotifyComment(const cString & in_string);
- virtual void NotifyWarning(const cString & in_string);
- virtual void NotifyError(const cString & in_string);
- virtual void NotifyUpdate();
-
- virtual void SignalBreakpoint();
-};
-
-#endif
Copied: development/source/viewer/cTextViewerDriver.cc (from rev 425, development/source/viewer/cAvidaDriver_TextPopViewer.cc)
===================================================================
--- development/source/viewer/cAvidaDriver_TextPopViewer.cc 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/viewer/cTextViewerDriver.cc 2005-12-22 00:46:26 UTC (rev 426)
@@ -0,0 +1,167 @@
+/*
+ * cTextViewerDriver.cc
+ * Avida
+ *
+ * Created by David on 12/11/05.
+ * Copyright 2005 Michigan State University. All rights reserved.
+ *
+ */
+
+#include "cTextViewerDriver.h"
+
+#include "cChangeList.h"
+#include "cClassificationManager.h"
+#include "cDriverManager.h"
+#include "cGenotype.h"
+#include "cHardwareBase.h"
+#include "cOrganism.h"
+#include "cPopulation.h"
+#include "cPopulationCell.h"
+#include "cStats.h"
+#include "cString.h"
+#include "cView.h"
+#include "cWorld.h"
+
+#include <stdlib.h>
+
+using namespace std;
+
+
+cTextViewerDriver::cTextViewerDriver(cWorld* world) : m_world(world), m_done(false), m_view(NULL)
+{
+ m_view = new cView(world);
+ m_view->SetViewMode(world->GetConfig().VIEW_MODE.Get());
+
+ cDriverManager::Register(static_cast<cAvidaDriver*>(this));
+ world->SetDriver(this);
+}
+
+cTextViewerDriver::~cTextViewerDriver()
+{
+ cDriverManager::Unregister(static_cast<cAvidaDriver*>(this));
+ delete m_world;
+
+ if (m_view != NULL) EndProg(0);
+}
+
+
+void cTextViewerDriver::Run()
+{
+ cClassificationManager& classmgr = m_world->GetClassificationManager();
+ cPopulation& population = m_world->GetPopulation();
+ cStats& stats = m_world->GetStats();
+
+ const int ave_time_slice = m_world->GetConfig().AVE_TIME_SLICE.Get();
+ const double point_mut_prob = m_world->GetConfig().POINT_MUT_PROB.Get();
+
+ while (!m_done) {
+ if (cChangeList* change_list = population.GetChangeList()) {
+ change_list->Reset();
+ }
+
+ m_world->GetEvents();
+ if (m_done == true) break;
+
+ // Increment the Update.
+ stats.IncCurrentUpdate();
+
+ // Handle all data collection for previous update.
+ if (stats.GetUpdate() > 0) {
+ // Tell the stats object to do update calculations and printing.
+ stats.ProcessUpdate();
+
+ // Update all the genotypes for the end of this update.
+ for (cGenotype * cur_genotype = classmgr.ResetThread(0);
+ cur_genotype != NULL && cur_genotype->GetThreshold();
+ cur_genotype = classmgr.NextGenotype(0)) {
+ cur_genotype->UpdateReset();
+ }
+ }
+
+
+ // Process the update.
+ const int UD_size = ave_time_slice * population.GetNumOrganisms();
+ const double step_size = 1.0 / (double) UD_size;
+
+
+ // Are we stepping through an organism?
+ if (m_view->GetStepOrganism() != -1) { // Yes we are!
+ // Keep the viewer informed about the organism we are stepping through...
+ for (int i = 0; i < UD_size; i++) {
+ const int next_id = population.ScheduleOrganism();
+ if (next_id == m_view->GetStepOrganism()) {
+ m_view->NotifyUpdate();
+ m_view->NewUpdate();
+
+ // This is needed to have the top bar drawn properly; I'm not sure why...
+ static bool first_update = true;
+ if (first_update) {
+ m_view->Refresh();
+ first_update = false;
+ }
+ }
+ population.ProcessStep(step_size, next_id);
+ }
+ }
+ else {
+ for (int i = 0; i < UD_size; i++) population.ProcessStep(step_size);
+ }
+
+
+ // end of update stats...
+ population.CalcUpdateStats();
+
+
+ // Setup the viewer for the new update.
+ if (m_view->GetStepOrganism() == -1) {
+ m_view->NotifyUpdate();
+ m_view->NewUpdate();
+
+ // This is needed to have the top bar drawn properly; I'm not sure why...
+ static bool first_update = true;
+ if (first_update) {
+ m_view->Refresh();
+ first_update = false;
+ }
+ }
+
+
+ // Do Point Mutations
+ if (point_mut_prob > 0 ) {
+ for (int i = 0; i < population.GetSize(); i++) {
+ if (population.GetCell(i).IsOccupied()) {
+ population.GetCell(i).GetOrganism()->GetHardware().PointMutate(point_mut_prob);
+ }
+ }
+ }
+
+ // Exit conditons...
+ if (population.GetNumOrganisms() == 0) m_done = true;
+ }
+}
+
+void cTextViewerDriver::RaiseException(const cString& in_string)
+{
+ m_view->NotifyError(in_string);
+}
+
+void cTextViewerDriver::RaiseFatalException(int exit_code, const cString& in_string)
+{
+ m_view->NotifyError(in_string);
+ exit(exit_code);
+}
+
+void cTextViewerDriver::NotifyComment(const cString& in_string)
+{
+ m_view->NotifyComment(in_string);
+}
+
+void cTextViewerDriver::NotifyWarning(const cString& in_string)
+{
+ m_view->NotifyWarning(in_string);
+}
+
+void cTextViewerDriver::SignalBreakpoint()
+{
+ m_view->DoBreakpoint();
+}
Copied: development/source/viewer/cTextViewerDriver.h (from rev 425, development/source/viewer/cAvidaDriver_TextPopViewer.h)
===================================================================
--- development/source/viewer/cAvidaDriver_TextPopViewer.h 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/viewer/cTextViewerDriver.h 2005-12-22 00:46:26 UTC (rev 426)
@@ -0,0 +1,53 @@
+/*
+ * cTextViewerDriver.h
+ * Avida
+ *
+ * Created by David on 12/11/05.
+ * Copyright 2005 Michigan State University. All rights reserved.
+ *
+ */
+
+#ifndef cTextViewerDriver_h
+#define cTextViewerDriver_h
+
+#ifndef cAvidaDriver_h
+#include "cAvidaDriver.h"
+#endif
+#ifndef cWorldDriver_h
+#include "cWorldDriver.h"
+#endif
+
+class cString;
+class cView;
+class cWorld;
+
+class cTextViewerDriver : public cAvidaDriver, public cWorldDriver
+{
+private:
+ cTextViewerDriver(); // not implemented
+
+protected:
+ cWorld* m_world;
+ bool m_done; // This is set to true when run should finish.
+
+ cView* m_view;
+
+public:
+ cTextViewerDriver(cWorld* world);
+ ~cTextViewerDriver();
+
+ void Run();
+
+ // Driver Actions
+ void SignalBreakpoint();
+ void SetDone() { m_done = true; }
+
+ void RaiseException(const cString& in_string);
+ void RaiseFatalException(int exit_code, const cString& in_string);
+
+ // Notifications
+ void NotifyComment(const cString& in_string);
+ void NotifyWarning(const cString& in_string);
+};
+
+#endif
Modified: development/source/viewer/cZoomScreen.cc
===================================================================
--- development/source/viewer/cZoomScreen.cc 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/viewer/cZoomScreen.cc 2005-12-22 00:46:26 UTC (rev 426)
@@ -946,21 +946,21 @@
" ");
// Only list the "Cpy" flag or the "Inj" flag...
- if (memory.FlagCopied(adj_inst_ptr) == true) {
+ if (memory.FlagCopied(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 15, "Cpy");
}
- if (memory.FlagInjected(adj_inst_ptr) == true) {
+ if (memory.FlagInjected(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 15, "Inj");
}
// Other flags we're interested in...
- if (memory.FlagMutated(adj_inst_ptr) == true) {
+ if (memory.FlagMutated(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 19, "Mut");
}
- if (memory.FlagExecuted(adj_inst_ptr) == true) {
+ if (memory.FlagExecuted(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 23, "Exe");
}
- if (memory.FlagBreakpoint(adj_inst_ptr) == true) {
+ if (memory.FlagBreakpoint(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 27, "Bp");
}
@@ -1086,21 +1086,21 @@
" ");
// Only list the "Cpy" flag or the "Inj" flag...
- if (memory.FlagCopied(adj_inst_ptr) == true) {
+ if (memory.FlagCopied(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 16, "Cpy");
}
- if (memory.FlagInjected(adj_inst_ptr) == true) {
+ if (memory.FlagInjected(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 16, "Inj");
}
// Other flags we're interested in...
- if (memory.FlagMutated(adj_inst_ptr) == true) {
+ if (memory.FlagMutated(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 20, "Mut");
}
- if (memory.FlagExecuted(adj_inst_ptr) == true) {
+ if (memory.FlagExecuted(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 24, "Exe");
}
- if (memory.FlagBreakpoint(adj_inst_ptr) == true) {
+ if (memory.FlagBreakpoint(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 28, "Bp");
}
@@ -1229,21 +1229,21 @@
" ");
// Only list the "Cpy" flag or the "Inj" flag...
- if (memory.FlagCopied(adj_inst_ptr) == true) {
+ if (memory.FlagCopied(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 16, "Cpy");
}
- if (memory.FlagInjected(adj_inst_ptr) == true) {
+ if (memory.FlagInjected(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 16, "Inj");
}
// Other flags we're interested in...
- if (memory.FlagMutated(adj_inst_ptr) == true) {
+ if (memory.FlagMutated(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 20, "Mut");
}
- if (memory.FlagExecuted(adj_inst_ptr) == true) {
+ if (memory.FlagExecuted(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 24, "Exe");
}
- if (memory.FlagBreakpoint(adj_inst_ptr) == true) {
+ if (memory.FlagBreakpoint(adj_inst_ptr)) {
Print(MEMORY_Y + MEMORY_PRE_SIZE + 3 + i, MEMORY_X + 28, "Bp");
}
@@ -1381,7 +1381,10 @@
// Finally, act on the edit method!
switch (edit_method) {
case INST_EDIT_BREAKPOINT:
- ToggleBool( edit_head.FlagBreakpoint() );
+ if (edit_head.GetMemory().FlagBreakpoint(edit_head.GetPosition()))
+ edit_head.SetFlagBreakpoint();
+ else
+ edit_head.ClearFlagBreakpoint();
break;
case INST_EDIT_JUMP_IP:
hardware.IP() = edit_head;
@@ -1491,19 +1494,19 @@
window->Print(6, 14, "%3d", inst_set.GetRedundancy(cInstruction(inst_id)) );
window->Print(7, 14, "%3d", inst_set.GetCost(cInstruction(inst_id)) );
- if (inst_ptr.FlagCopied() == true) window->SetBoldColor(COLOR_CYAN);
+ if (inst_ptr.GetMemory().FlagCopied(inst_ptr.GetPosition())) window->SetBoldColor(COLOR_CYAN);
else window->SetColor(COLOR_CYAN);
window->Print(4, 25, "Copied");
- if (inst_ptr.FlagMutated() == true) window->SetBoldColor(COLOR_CYAN);
+ if (inst_ptr.GetMemory().FlagMutated(inst_ptr.GetPosition())) window->SetBoldColor(COLOR_CYAN);
else window->SetColor(COLOR_CYAN);
window->Print(5, 25, "Mutated");
- if (inst_ptr.FlagExecuted() == true) window->SetBoldColor(COLOR_CYAN);
+ if (inst_ptr.GetMemory().FlagExecuted(inst_ptr.GetPosition())) window->SetBoldColor(COLOR_CYAN);
else window->SetColor(COLOR_CYAN);
window->Print(6, 25, "Executed");
- if (inst_ptr.FlagBreakpoint() == true) window->SetBoldColor(COLOR_CYAN);
+ if (inst_ptr.GetMemory().FlagBreakpoint(inst_ptr.GetPosition())) window->SetBoldColor(COLOR_CYAN);
else window->SetColor(COLOR_CYAN);
window->Print(7, 25, "Breakpoint");
Modified: development/source/viewer/viewer.cc
===================================================================
--- development/source/viewer/viewer.cc 2005-12-20 18:54:00 UTC (rev 425)
+++ development/source/viewer/viewer.cc 2005-12-22 00:46:26 UTC (rev 426)
@@ -10,8 +10,9 @@
#include "avida.h"
#include "cAvidaConfig.h"
-#include "cAvidaDriver_Analyze.h"
-#include "cAvidaDriver_TextPopViewer.h"
+#include "cDefaultAnalyzeDriver.h"
+#include "cDriverManager.h"
+#include "cTextViewerDriver.h"
#include "cWorld.h"
using namespace std;
@@ -23,19 +24,22 @@
printVersionBanner();
+ cDriverManager::Initialize();
+
// Initialize the configuration data...
cWorld* world = new cWorld(cAvidaConfig::LoadWithCmdLineArgs(argc, argv));
+ cAvidaDriver* driver = NULL;
if (world->GetConfig().ANALYZE_MODE.Get() > 0) {
- cAvidaDriver_Base::main_driver = new cAvidaDriver_Analyze(world, (world->GetConfig().ANALYZE_MODE.Get() == 2));
+ driver = new cDefaultAnalyzeDriver(world, (world->GetConfig().ANALYZE_MODE.Get() == 2));
} else {
- cAvidaDriver_Base::main_driver = new cAvidaDriver_TextPopViewer(world);
+ driver = new cTextViewerDriver(world);
}
cout << endl;
- cAvidaDriver_Base::main_driver->Run();
-
+ driver->Run();
+
// Exit Nicely
ExitAvida(0);
}
More information about the Avida-cvs
mailing list