[Avida-cvs] [Avida2-svn] r399 - in development: . Avida.xcodeproj source source/analyze source/classification source/cpu source/event source/main source/support source/testsuites/unit_testsuites source/testsuites/unit_testsuites/level_1 source/tools source/viewer

brysonda@myxo.css.msu.edu brysonda at myxo.css.msu.edu
Tue Nov 15 10:08:11 PST 2005


Author: brysonda
Date: 2005-11-15 13:05:29 -0500 (Tue, 15 Nov 2005)
New Revision: 399

Added:
   development/source/analyze/cGenotypeBatch.h
   development/source/classification/cClassificationManager.cc
   development/source/classification/cClassificationManager.h
   development/source/classification/cGenotype.cc
   development/source/classification/cGenotype.h
   development/source/classification/cGenotypeControl.cc
   development/source/classification/cGenotypeControl.h
   development/source/classification/cGenotype_BirthData.cc
   development/source/classification/cGenotype_BirthData.h
   development/source/classification/cGenotype_TestData.cc
   development/source/classification/cGenotype_TestData.h
   development/source/classification/cInjectGenotype.cc
   development/source/classification/cInjectGenotype.h
   development/source/classification/cInjectGenotypeControl.cc
   development/source/classification/cInjectGenotypeControl.h
   development/source/classification/cInjectGenotypeElement.h
   development/source/classification/cInjectGenotypeQueue.cc
   development/source/classification/cInjectGenotypeQueue.h
   development/source/classification/cInjectGenotype_BirthData.cc
   development/source/classification/cInjectGenotype_BirthData.h
   development/source/classification/cLineage.cc
   development/source/classification/cLineage.h
   development/source/classification/cSpecies.cc
   development/source/classification/cSpecies.h
   development/source/classification/cSpeciesControl.cc
   development/source/classification/cSpeciesControl.h
   development/source/classification/cSpeciesQueue.cc
   development/source/classification/cSpeciesQueue.h
   development/source/classification/nGenotype.h
   development/source/classification/nInjectGenotype.h
   development/source/classification/nSpecies.h
Removed:
   development/source/main/cGenebank.cc
   development/source/main/cGenebank.h
   development/source/main/cGenotype.cc
   development/source/main/cGenotype.h
   development/source/main/cGenotypeBatch.h
   development/source/main/cGenotypeControl.cc
   development/source/main/cGenotypeControl.h
   development/source/main/cGenotype_BirthData.cc
   development/source/main/cGenotype_BirthData.h
   development/source/main/cGenotype_TestData.cc
   development/source/main/cGenotype_TestData.h
   development/source/main/cInjectGenebank.cc
   development/source/main/cInjectGenebank.h
   development/source/main/cInjectGenotype.cc
   development/source/main/cInjectGenotype.h
   development/source/main/cInjectGenotypeControl.cc
   development/source/main/cInjectGenotypeControl.h
   development/source/main/cInjectGenotypeElement.h
   development/source/main/cInjectGenotypeQueue.cc
   development/source/main/cInjectGenotypeQueue.h
   development/source/main/cInjectGenotype_BirthData.cc
   development/source/main/cInjectGenotype_BirthData.h
   development/source/main/cLineage.cc
   development/source/main/cLineage.h
   development/source/main/cLineageControl.cc
   development/source/main/cLineageControl.h
   development/source/main/cSpecies.cc
   development/source/main/cSpecies.h
   development/source/main/cSpeciesControl.cc
   development/source/main/cSpeciesControl.h
   development/source/main/cSpeciesQueue.cc
   development/source/main/cSpeciesQueue.h
   development/source/main/nGenotype.h
   development/source/main/nInjectGenotype.h
   development/source/main/nSpecies.h
Modified:
   development/Avida.xcodeproj/project.pbxproj
   development/CMakeLists.txt
   development/source/CMakeLists.txt
   development/source/analyze/cAnalyze.cc
   development/source/analyze/cAnalyzeGenotype.cc
   development/source/analyze/cAnalyzeUtil.cc
   development/source/analyze/cAnalyzeUtil.h
   development/source/cpu/cCodeLabel.cc
   development/source/cpu/cCodeLabel.h
   development/source/cpu/cHardware4Stack.cc
   development/source/cpu/cHardware4Stack.h
   development/source/cpu/cHardware4Stack_Thread.cc
   development/source/cpu/cHardware4Stack_Thread.h
   development/source/cpu/cHardwareBase.cc
   development/source/cpu/cHardwareBase.h
   development/source/cpu/cHardwareCPU.cc
   development/source/cpu/cHardwareCPU.h
   development/source/cpu/cHardwareCPU_Thread.cc
   development/source/cpu/cHardwareCPU_Thread.h
   development/source/cpu/cHardwareManager.cc
   development/source/cpu/cHardwareSMT.cc
   development/source/cpu/cHardwareSMT.h
   development/source/cpu/cHardwareSMT_Thread.cc
   development/source/cpu/cHardwareSMT_Thread.h
   development/source/event/cEventManager.cc
   development/source/main/CMakeLists.txt
   development/source/main/cAvidaDriver_Population.cc
   development/source/main/cBirthChamber.cc
   development/source/main/cBirthChamber.h
   development/source/main/cInstSet.cc
   development/source/main/cInstSet.h
   development/source/main/cOrganism.cc
   development/source/main/cOrganism.h
   development/source/main/cPopulation.cc
   development/source/main/cPopulation.h
   development/source/main/cPopulationCell.cc
   development/source/main/cPopulationCell.h
   development/source/main/cPopulationInterface.cc
   development/source/main/cStats.cc
   development/source/main/cStats.h
   development/source/main/cWorld.cc
   development/source/main/cWorld.h
   development/source/support/CMakeLists.txt
   development/source/testsuites/unit_testsuites/genebank.t.cc
   development/source/testsuites/unit_testsuites/level_1/instruction.t.cc
   development/source/tools/tArray.h
   development/source/viewer/CMakeLists.txt
   development/source/viewer/cEnvironmentScreen.cc
   development/source/viewer/cHistScreen.cc
   development/source/viewer/cScreen.h
   development/source/viewer/cStatsScreen.cc
   development/source/viewer/cViewInfo.cc
   development/source/viewer/cViewInfo.h
   development/source/viewer/cZoomScreen.cc
   development/status.xml
Log:
Move classification classes into cClassificationManager.  This includes Genotypes, Species, and Lineages.  The classification manager now handles assigning identifiers to the aforementioned classifications.  Renamed genebank to archive, representing the fact that it holds more than just genotypes.

Modified: development/Avida.xcodeproj/project.pbxproj
===================================================================
--- development/Avida.xcodeproj/project.pbxproj	2005-11-15 17:22:29 UTC (rev 398)
+++ development/Avida.xcodeproj/project.pbxproj	2005-11-15 18:05:29 UTC (rev 399)
@@ -69,6 +69,24 @@
 		70486BA50826722F009328F0 /* inst_set.4stack in CopyFiles */ = {isa = PBXBuildFile; fileRef = DCC311840762539F008F7A48 /* inst_set.4stack */; };
 		70486BA60826722F009328F0 /* inst_set.default in CopyFiles */ = {isa = PBXBuildFile; fileRef = DCC311850762539F008F7A48 /* inst_set.default */; };
 		70486BA70826722F009328F0 /* organism.default in CopyFiles */ = {isa = PBXBuildFile; fileRef = DCC311890762539F008F7A48 /* organism.default */; };
+		7053324C0929764C006BD186 /* cSpecies.cc in Sources */ = {isa = PBXBuildFile; fileRef = 705332480929764A006BD186 /* cSpecies.cc */; };
+		7053324D0929764E006BD186 /* cSpeciesQueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7053324A0929764A006BD186 /* cSpeciesQueue.cc */; };
+		7053336D092A3DF9006BD186 /* cInjectGenotype.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70533364092A3DF4006BD186 /* cInjectGenotype.cc */; };
+		7053336E092A3DFB006BD186 /* cInjectGenotype_BirthData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70533362092A3DF4006BD186 /* cInjectGenotype_BirthData.cc */; };
+		7053336F092A3DFC006BD186 /* cInjectGenotypeControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70533366092A3DF4006BD186 /* cInjectGenotypeControl.cc */; };
+		70533371092A3E00006BD186 /* cInjectGenotypeQueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70533369092A3DF4006BD186 /* cInjectGenotypeQueue.cc */; };
+		705333E7092A4B7F006BD186 /* cLineage.cc in Sources */ = {isa = PBXBuildFile; fileRef = 705333E5092A4B7C006BD186 /* cLineage.cc */; };
+		70533479092A4F4D006BD186 /* cGenotype_BirthData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DE700929678E009E311D /* cGenotype_BirthData.cc */; };
+		7053347A092A4F4F006BD186 /* cGenotype_TestData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DE720929678E009E311D /* cGenotype_TestData.cc */; };
+		7053347B092A4F50006BD186 /* cGenotypeControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DE6809296613009E311D /* cGenotypeControl.cc */; };
+		7053347C092A4F52006BD186 /* cInjectGenotype.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70533364092A3DF4006BD186 /* cInjectGenotype.cc */; };
+		7053347D092A4F53006BD186 /* cInjectGenotype_BirthData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70533362092A3DF4006BD186 /* cInjectGenotype_BirthData.cc */; };
+		7053347E092A4F55006BD186 /* cInjectGenotypeControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70533366092A3DF4006BD186 /* cInjectGenotypeControl.cc */; };
+		70533480092A4F59006BD186 /* cInjectGenotypeQueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70533369092A3DF4006BD186 /* cInjectGenotypeQueue.cc */; };
+		70533481092A4F5B006BD186 /* cLineage.cc in Sources */ = {isa = PBXBuildFile; fileRef = 705333E5092A4B7C006BD186 /* cLineage.cc */; };
+		70533482092A4F5D006BD186 /* cSpecies.cc in Sources */ = {isa = PBXBuildFile; fileRef = 705332480929764A006BD186 /* cSpecies.cc */; };
+		70533483092A4F5F006BD186 /* cSpeciesControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DE6A09296613009E311D /* cSpeciesControl.cc */; };
+		70533484092A4F60006BD186 /* cSpeciesQueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7053324A0929764A006BD186 /* cSpeciesQueue.cc */; };
 		70658C44085DE5FF00486BED /* primitive.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC311090762539E008F7A48 /* primitive.cc */; };
 		70658C5A085DF67D00486BED /* libncurses.5.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 70658C59085DF67D00486BED /* libncurses.5.4.dylib */; };
 		706D32E90854A39800D7DC8F /* dummy in CopyFiles */ = {isa = PBXBuildFile; fileRef = DCC311950762539F008F7A48 /* dummy */; };
@@ -77,15 +95,11 @@
 		706D330F0854A7B900D7DC8F /* organism.smt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 706D330E0854A7B900D7DC8F /* organism.smt */; };
 		706D33280854A90D00D7DC8F /* inst_set.smt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 706D33270854A90D00D7DC8F /* inst_set.smt */; };
 		70B0865908F4974300FC65FE /* cLandscape.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865108F4974300FC65FE /* cLandscape.cc */; };
-		70B0865A08F4974300FC65FE /* cLineage.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865208F4974300FC65FE /* cLineage.cc */; };
-		70B0865B08F4974300FC65FE /* cLineageControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865308F4974300FC65FE /* cLineageControl.cc */; };
 		70B0865C08F4974300FC65FE /* cLocalMutations.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865408F4974300FC65FE /* cLocalMutations.cc */; };
 		70B0865D08F4974300FC65FE /* cMutation.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865508F4974300FC65FE /* cMutation.cc */; };
 		70B0865E08F4974300FC65FE /* cMutationLib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865608F4974300FC65FE /* cMutationLib.cc */; };
 		70B0865F08F4974300FC65FE /* cMutationRates.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865708F4974300FC65FE /* cMutationRates.cc */; };
 		70B0866108F4974300FC65FE /* cLandscape.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865108F4974300FC65FE /* cLandscape.cc */; };
-		70B0866208F4974300FC65FE /* cLineage.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865208F4974300FC65FE /* cLineage.cc */; };
-		70B0866308F4974300FC65FE /* cLineageControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865308F4974300FC65FE /* cLineageControl.cc */; };
 		70B0866408F4974300FC65FE /* cLocalMutations.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865408F4974300FC65FE /* cLocalMutations.cc */; };
 		70B0866508F4974300FC65FE /* cMutation.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865508F4974300FC65FE /* cMutation.cc */; };
 		70B0866608F4974300FC65FE /* cMutationLib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0865608F4974300FC65FE /* cMutationLib.cc */; };
@@ -111,9 +125,6 @@
 		70B0873508F5E82D00FC65FE /* cResourceLib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872508F5E82D00FC65FE /* cResourceLib.cc */; };
 		70B0873608F5E82D00FC65FE /* cSpatialCountElem.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872608F5E82D00FC65FE /* cSpatialCountElem.cc */; };
 		70B0873708F5E82D00FC65FE /* cSpatialResCount.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872708F5E82D00FC65FE /* cSpatialResCount.cc */; };
-		70B0873808F5E82D00FC65FE /* cSpecies.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872808F5E82D00FC65FE /* cSpecies.cc */; };
-		70B0873908F5E82D00FC65FE /* cSpeciesControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872908F5E82D00FC65FE /* cSpeciesControl.cc */; };
-		70B0873A08F5E82D00FC65FE /* cSpeciesQueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872A08F5E82D00FC65FE /* cSpeciesQueue.cc */; };
 		70B0873B08F5E82D00FC65FE /* cStats.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872B08F5E82D00FC65FE /* cStats.cc */; };
 		70B0873C08F5E82D00FC65FE /* cTaskEntry.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872C08F5E82D00FC65FE /* cTaskEntry.cc */; };
 		70B0873D08F5E82D00FC65FE /* cTaskLib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872D08F5E82D00FC65FE /* cTaskLib.cc */; };
@@ -127,9 +138,6 @@
 		70B0874508F5E82D00FC65FE /* cResourceLib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872508F5E82D00FC65FE /* cResourceLib.cc */; };
 		70B0874608F5E82D00FC65FE /* cSpatialCountElem.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872608F5E82D00FC65FE /* cSpatialCountElem.cc */; };
 		70B0874708F5E82D00FC65FE /* cSpatialResCount.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872708F5E82D00FC65FE /* cSpatialResCount.cc */; };
-		70B0874808F5E82D00FC65FE /* cSpecies.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872808F5E82D00FC65FE /* cSpecies.cc */; };
-		70B0874908F5E82D00FC65FE /* cSpeciesControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872908F5E82D00FC65FE /* cSpeciesControl.cc */; };
-		70B0874A08F5E82D00FC65FE /* cSpeciesQueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872A08F5E82D00FC65FE /* cSpeciesQueue.cc */; };
 		70B0874B08F5E82D00FC65FE /* cStats.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872B08F5E82D00FC65FE /* cStats.cc */; };
 		70B0874C08F5E82D00FC65FE /* cTaskEntry.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872C08F5E82D00FC65FE /* cTaskEntry.cc */; };
 		70B0874D08F5E82D00FC65FE /* cTaskLib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70B0872D08F5E82D00FC65FE /* cTaskLib.cc */; };
@@ -235,34 +243,14 @@
 		70C5BC6709059A970028A785 /* cWorld.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70C5BC6309059A970028A785 /* cWorld.cc */; };
 		70C5BD6B0905CE5F0028A785 /* cHardwareManager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70C5BD690905CE5F0028A785 /* cHardwareManager.cc */; };
 		70C5BD6D0905CE5F0028A785 /* cHardwareManager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70C5BD690905CE5F0028A785 /* cHardwareManager.cc */; };
-		70CA6EC308DB7F8200068AC2 /* cGenebank.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB308DB7F8200068AC2 /* cGenebank.cc */; };
 		70CA6EC408DB7F8200068AC2 /* cGenome.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB408DB7F8200068AC2 /* cGenome.cc */; };
 		70CA6EC508DB7F8200068AC2 /* cGenomeUtil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB508DB7F8200068AC2 /* cGenomeUtil.cc */; };
-		70CA6EC608DB7F8200068AC2 /* cGenotype_BirthData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB608DB7F8200068AC2 /* cGenotype_BirthData.cc */; };
-		70CA6EC708DB7F8200068AC2 /* cGenotype_TestData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB708DB7F8200068AC2 /* cGenotype_TestData.cc */; };
-		70CA6EC808DB7F8200068AC2 /* cGenotype.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB808DB7F8200068AC2 /* cGenotype.cc */; };
-		70CA6EC908DB7F8200068AC2 /* cGenotypeControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB908DB7F8200068AC2 /* cGenotypeControl.cc */; };
-		70CA6ECA08DB7F8200068AC2 /* cInjectGenebank.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBA08DB7F8200068AC2 /* cInjectGenebank.cc */; };
-		70CA6ECB08DB7F8200068AC2 /* cInjectGenotype_BirthData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBB08DB7F8200068AC2 /* cInjectGenotype_BirthData.cc */; };
-		70CA6ECC08DB7F8200068AC2 /* cInjectGenotype.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBC08DB7F8200068AC2 /* cInjectGenotype.cc */; };
-		70CA6ECD08DB7F8200068AC2 /* cInjectGenotypeControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBD08DB7F8200068AC2 /* cInjectGenotypeControl.cc */; };
-		70CA6ECE08DB7F8200068AC2 /* cInjectGenotypeQueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBE08DB7F8200068AC2 /* cInjectGenotypeQueue.cc */; };
 		70CA6ECF08DB7F8200068AC2 /* cInstruction.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBF08DB7F8200068AC2 /* cInstruction.cc */; };
 		70CA6ED008DB7F8200068AC2 /* cInstSet.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EC008DB7F8200068AC2 /* cInstSet.cc */; };
 		70CA6ED108DB7F8200068AC2 /* cInstUtil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EC108DB7F8200068AC2 /* cInstUtil.cc */; };
 		70CA6ED208DB7F8200068AC2 /* cFitnessMatrix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB208DB7F8200068AC2 /* cFitnessMatrix.cc */; };
-		70CA6ED308DB7F8200068AC2 /* cGenebank.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB308DB7F8200068AC2 /* cGenebank.cc */; };
 		70CA6ED408DB7F8200068AC2 /* cGenome.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB408DB7F8200068AC2 /* cGenome.cc */; };
 		70CA6ED508DB7F8200068AC2 /* cGenomeUtil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB508DB7F8200068AC2 /* cGenomeUtil.cc */; };
-		70CA6ED608DB7F8200068AC2 /* cGenotype_BirthData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB608DB7F8200068AC2 /* cGenotype_BirthData.cc */; };
-		70CA6ED708DB7F8200068AC2 /* cGenotype_TestData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB708DB7F8200068AC2 /* cGenotype_TestData.cc */; };
-		70CA6ED808DB7F8200068AC2 /* cGenotype.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB808DB7F8200068AC2 /* cGenotype.cc */; };
-		70CA6ED908DB7F8200068AC2 /* cGenotypeControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB908DB7F8200068AC2 /* cGenotypeControl.cc */; };
-		70CA6EDA08DB7F8200068AC2 /* cInjectGenebank.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBA08DB7F8200068AC2 /* cInjectGenebank.cc */; };
-		70CA6EDB08DB7F8200068AC2 /* cInjectGenotype_BirthData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBB08DB7F8200068AC2 /* cInjectGenotype_BirthData.cc */; };
-		70CA6EDC08DB7F8200068AC2 /* cInjectGenotype.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBC08DB7F8200068AC2 /* cInjectGenotype.cc */; };
-		70CA6EDD08DB7F8200068AC2 /* cInjectGenotypeControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBD08DB7F8200068AC2 /* cInjectGenotypeControl.cc */; };
-		70CA6EDE08DB7F8200068AC2 /* cInjectGenotypeQueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBE08DB7F8200068AC2 /* cInjectGenotypeQueue.cc */; };
 		70CA6EDF08DB7F8200068AC2 /* cInstruction.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EBF08DB7F8200068AC2 /* cInstruction.cc */; };
 		70CA6EE008DB7F8200068AC2 /* cInstSet.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EC008DB7F8200068AC2 /* cInstSet.cc */; };
 		70CA6EE108DB7F8200068AC2 /* cInstUtil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EC108DB7F8200068AC2 /* cInstUtil.cc */; };
@@ -270,6 +258,14 @@
 		70D46935085F61DD004C8409 /* trionan.c in Sources */ = {isa = PBXBuildFile; fileRef = DCC31471076253A1008F7A48 /* trionan.c */; };
 		70D46936085F61DF004C8409 /* triostr.c in Sources */ = {isa = PBXBuildFile; fileRef = DCC31474076253A1008F7A48 /* triostr.c */; };
 		70F7D8CE09254787009E311D /* cFitnessMatrix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70CA6EB208DB7F8200068AC2 /* cFitnessMatrix.cc */; };
+		70F7DAF409290468009E311D /* cClassificationManager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DAF009290468009E311D /* cClassificationManager.cc */; };
+		70F7DCA009293E76009E311D /* cClassificationManager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DAF009290468009E311D /* cClassificationManager.cc */; };
+		70F7DCA109293E77009E311D /* cGenotype.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DC9E09293E6F009E311D /* cGenotype.cc */; };
+		70F7DCA309293E87009E311D /* cGenotype.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DC9E09293E6F009E311D /* cGenotype.cc */; };
+		70F7DE6C09296615009E311D /* cGenotypeControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DE6809296613009E311D /* cGenotypeControl.cc */; };
+		70F7DE6D09296616009E311D /* cSpeciesControl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DE6A09296613009E311D /* cSpeciesControl.cc */; };
+		70F7DE7409296794009E311D /* cGenotype_BirthData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DE700929678E009E311D /* cGenotype_BirthData.cc */; };
+		70F7DE7509296795009E311D /* cGenotype_TestData.cc in Sources */ = {isa = PBXBuildFile; fileRef = 70F7DE720929678E009E311D /* cGenotype_TestData.cc */; };
 		DCC3166107628531008F7A48 /* avida.cc in Sources */ = {isa = PBXBuildFile; fileRef = DCC3109C0762539E008F7A48 /* avida.cc */; };
 /* End PBXBuildFile section */
 
@@ -418,17 +414,31 @@
 		704866D0090B51310048600A /* cZoomScreen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cZoomScreen.h; sourceTree = "<group>"; };
 		704866D1090B51310048600A /* key_chart */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = key_chart; sourceTree = "<group>"; };
 		704866D2090B51310048600A /* viewer.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = viewer.cc; sourceTree = "<group>"; };
+		705332480929764A006BD186 /* cSpecies.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cSpecies.cc; sourceTree = "<group>"; };
+		705332490929764A006BD186 /* cSpecies.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cSpecies.h; sourceTree = "<group>"; };
+		7053324A0929764A006BD186 /* cSpeciesQueue.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cSpeciesQueue.cc; sourceTree = "<group>"; };
+		7053324B0929764A006BD186 /* cSpeciesQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cSpeciesQueue.h; sourceTree = "<group>"; };
+		7053325609297702006BD186 /* nSpecies.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = nSpecies.h; sourceTree = "<group>"; };
+		70533362092A3DF4006BD186 /* cInjectGenotype_BirthData.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInjectGenotype_BirthData.cc; sourceTree = "<group>"; };
+		70533363092A3DF4006BD186 /* cInjectGenotype_BirthData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenotype_BirthData.h; sourceTree = "<group>"; };
+		70533364092A3DF4006BD186 /* cInjectGenotype.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInjectGenotype.cc; sourceTree = "<group>"; };
+		70533365092A3DF4006BD186 /* cInjectGenotype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenotype.h; sourceTree = "<group>"; };
+		70533366092A3DF4006BD186 /* cInjectGenotypeControl.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInjectGenotypeControl.cc; sourceTree = "<group>"; };
+		70533367092A3DF4006BD186 /* cInjectGenotypeControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenotypeControl.h; sourceTree = "<group>"; };
+		70533368092A3DF4006BD186 /* cInjectGenotypeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenotypeElement.h; sourceTree = "<group>"; };
+		70533369092A3DF4006BD186 /* cInjectGenotypeQueue.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInjectGenotypeQueue.cc; sourceTree = "<group>"; };
+		7053336A092A3DF4006BD186 /* cInjectGenotypeQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenotypeQueue.h; sourceTree = "<group>"; };
+		7053336B092A3DF4006BD186 /* nGenotype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = nGenotype.h; sourceTree = "<group>"; };
+		7053336C092A3DF4006BD186 /* nInjectGenotype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = nInjectGenotype.h; sourceTree = "<group>"; };
+		705333E5092A4B7C006BD186 /* cLineage.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cLineage.cc; sourceTree = "<group>"; };
+		705333E6092A4B7C006BD186 /* cLineage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cLineage.h; sourceTree = "<group>"; };
+		7053345E092A4D88006BD186 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
 		70658C59085DF67D00486BED /* libncurses.5.4.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.5.4.dylib; path = /usr/lib/libncurses.5.4.dylib; sourceTree = "<absolute>"; };
 		706D30CC0852328F00D7DC8F /* tInstLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tInstLib.h; sourceTree = "<group>"; };
 		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>"; };
-		70B085D108F48C9400FC65FE /* nSpecies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nSpecies.h; sourceTree = "<group>"; };
-		70B0861508F48E8900FC65FE /* nGenotype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = nGenotype.h; sourceTree = "<group>"; };
-		70B0861608F48E8900FC65FE /* nInjectGenotype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = nInjectGenotype.h; sourceTree = "<group>"; };
 		70B0864808F4972600FC65FE /* cLandscape.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cLandscape.h; sourceTree = "<group>"; };
-		70B0864908F4972600FC65FE /* cLineage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cLineage.h; sourceTree = "<group>"; };
-		70B0864A08F4972600FC65FE /* cLineageControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cLineageControl.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>"; };
 		70B0864D08F4972600FC65FE /* cMutationLib.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cMutationLib.h; sourceTree = "<group>"; };
@@ -436,8 +446,6 @@
 		70B0864F08F4972600FC65FE /* cMxCodeArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cMxCodeArray.h; sourceTree = "<group>"; };
 		70B0865008F4972600FC65FE /* MyCodeArrayLessThan.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyCodeArrayLessThan.h; sourceTree = "<group>"; };
 		70B0865108F4974300FC65FE /* cLandscape.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cLandscape.cc; sourceTree = "<group>"; };
-		70B0865208F4974300FC65FE /* cLineage.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cLineage.cc; sourceTree = "<group>"; };
-		70B0865308F4974300FC65FE /* cLineageControl.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cLineageControl.cc; sourceTree = "<group>"; };
 		70B0865408F4974300FC65FE /* cLocalMutations.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cLocalMutations.cc; sourceTree = "<group>"; };
 		70B0865508F4974300FC65FE /* cMutation.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cMutation.cc; sourceTree = "<group>"; };
 		70B0865608F4974300FC65FE /* cMutationLib.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cMutationLib.cc; sourceTree = "<group>"; };
@@ -465,9 +473,6 @@
 		70B0871508F5E81000FC65FE /* cResourceLib.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cResourceLib.h; sourceTree = "<group>"; };
 		70B0871608F5E81000FC65FE /* cSpatialCountElem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cSpatialCountElem.h; sourceTree = "<group>"; };
 		70B0871708F5E81000FC65FE /* cSpatialResCount.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cSpatialResCount.h; sourceTree = "<group>"; };
-		70B0871808F5E81000FC65FE /* cSpecies.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cSpecies.h; sourceTree = "<group>"; };
-		70B0871908F5E81000FC65FE /* cSpeciesControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cSpeciesControl.h; sourceTree = "<group>"; };
-		70B0871A08F5E81000FC65FE /* cSpeciesQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cSpeciesQueue.h; sourceTree = "<group>"; };
 		70B0871B08F5E81000FC65FE /* cStats.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cStats.h; sourceTree = "<group>"; };
 		70B0871C08F5E81000FC65FE /* cTaskEntry.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cTaskEntry.h; sourceTree = "<group>"; };
 		70B0871D08F5E81000FC65FE /* cTaskLib.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cTaskLib.h; sourceTree = "<group>"; };
@@ -481,9 +486,6 @@
 		70B0872508F5E82D00FC65FE /* cResourceLib.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cResourceLib.cc; sourceTree = "<group>"; };
 		70B0872608F5E82D00FC65FE /* cSpatialCountElem.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cSpatialCountElem.cc; sourceTree = "<group>"; };
 		70B0872708F5E82D00FC65FE /* cSpatialResCount.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cSpatialResCount.cc; sourceTree = "<group>"; };
-		70B0872808F5E82D00FC65FE /* cSpecies.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cSpecies.cc; sourceTree = "<group>"; };
-		70B0872908F5E82D00FC65FE /* cSpeciesControl.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cSpeciesControl.cc; sourceTree = "<group>"; };
-		70B0872A08F5E82D00FC65FE /* cSpeciesQueue.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cSpeciesQueue.cc; sourceTree = "<group>"; };
 		70B0872B08F5E82D00FC65FE /* cStats.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cStats.cc; sourceTree = "<group>"; };
 		70B0872C08F5E82D00FC65FE /* cTaskEntry.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cTaskEntry.cc; sourceTree = "<group>"; };
 		70B0872D08F5E82D00FC65FE /* cTaskLib.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cTaskLib.cc; sourceTree = "<group>"; };
@@ -642,40 +644,31 @@
 		70C5BD690905CE5F0028A785 /* cHardwareManager.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cHardwareManager.cc; sourceTree = "<group>"; };
 		70C5BD6A0905CE5F0028A785 /* cHardwareManager.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cHardwareManager.h; sourceTree = "<group>"; };
 		70CA6EB208DB7F8200068AC2 /* cFitnessMatrix.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cFitnessMatrix.cc; sourceTree = "<group>"; };
-		70CA6EB308DB7F8200068AC2 /* cGenebank.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenebank.cc; sourceTree = "<group>"; };
 		70CA6EB408DB7F8200068AC2 /* cGenome.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenome.cc; sourceTree = "<group>"; };
 		70CA6EB508DB7F8200068AC2 /* cGenomeUtil.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenomeUtil.cc; sourceTree = "<group>"; };
-		70CA6EB608DB7F8200068AC2 /* cGenotype_BirthData.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenotype_BirthData.cc; sourceTree = "<group>"; };
-		70CA6EB708DB7F8200068AC2 /* cGenotype_TestData.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenotype_TestData.cc; sourceTree = "<group>"; };
-		70CA6EB808DB7F8200068AC2 /* cGenotype.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenotype.cc; sourceTree = "<group>"; };
-		70CA6EB908DB7F8200068AC2 /* cGenotypeControl.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenotypeControl.cc; sourceTree = "<group>"; };
-		70CA6EBA08DB7F8200068AC2 /* cInjectGenebank.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInjectGenebank.cc; sourceTree = "<group>"; };
-		70CA6EBB08DB7F8200068AC2 /* cInjectGenotype_BirthData.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInjectGenotype_BirthData.cc; sourceTree = "<group>"; };
-		70CA6EBC08DB7F8200068AC2 /* cInjectGenotype.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInjectGenotype.cc; sourceTree = "<group>"; };
-		70CA6EBD08DB7F8200068AC2 /* cInjectGenotypeControl.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInjectGenotypeControl.cc; sourceTree = "<group>"; };
-		70CA6EBE08DB7F8200068AC2 /* cInjectGenotypeQueue.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInjectGenotypeQueue.cc; sourceTree = "<group>"; };
 		70CA6EBF08DB7F8200068AC2 /* cInstruction.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInstruction.cc; sourceTree = "<group>"; };
 		70CA6EC008DB7F8200068AC2 /* cInstSet.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInstSet.cc; sourceTree = "<group>"; };
 		70CA6EC108DB7F8200068AC2 /* cInstUtil.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cInstUtil.cc; sourceTree = "<group>"; };
 		70CA6EE208DB7F9E00068AC2 /* cFitnessMatrix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cFitnessMatrix.h; sourceTree = "<group>"; };
-		70CA6EE308DB7F9E00068AC2 /* cGenebank.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenebank.h; sourceTree = "<group>"; };
 		70CA6EE408DB7F9E00068AC2 /* cGenome.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenome.h; sourceTree = "<group>"; };
 		70CA6EE608DB7F9E00068AC2 /* cGenomeUtil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenomeUtil.h; sourceTree = "<group>"; };
-		70CA6EE708DB7F9E00068AC2 /* cGenotype_BirthData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenotype_BirthData.h; sourceTree = "<group>"; };
-		70CA6EE808DB7F9E00068AC2 /* cGenotype_TestData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenotype_TestData.h; sourceTree = "<group>"; };
-		70CA6EE908DB7F9E00068AC2 /* cGenotype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenotype.h; sourceTree = "<group>"; };
-		70CA6EEA08DB7F9E00068AC2 /* cGenotypeControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenotypeControl.h; sourceTree = "<group>"; };
-		70CA6EEB08DB7F9E00068AC2 /* cInjectGenebank.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenebank.h; sourceTree = "<group>"; };
-		70CA6EEC08DB7F9E00068AC2 /* cInjectGenotype_BirthData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenotype_BirthData.h; sourceTree = "<group>"; };
-		70CA6EED08DB7F9E00068AC2 /* cInjectGenotype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenotype.h; sourceTree = "<group>"; };
-		70CA6EEE08DB7F9E00068AC2 /* cInjectGenotypeControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenotypeControl.h; sourceTree = "<group>"; };
-		70CA6EEF08DB7F9E00068AC2 /* cInjectGenotypeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenotypeElement.h; sourceTree = "<group>"; };
-		70CA6EF008DB7F9E00068AC2 /* cInjectGenotypeQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInjectGenotypeQueue.h; sourceTree = "<group>"; };
 		70CA6EF108DB7F9E00068AC2 /* cInstLibBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInstLibBase.h; sourceTree = "<group>"; };
 		70CA6EF208DB7F9E00068AC2 /* cInstruction.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInstruction.h; sourceTree = "<group>"; };
 		70CA6EF308DB7F9E00068AC2 /* cInstSet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInstSet.h; sourceTree = "<group>"; };
 		70CA6EF408DB7F9E00068AC2 /* cInstUtil.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cInstUtil.h; sourceTree = "<group>"; };
-		70CA6EF508DB806200068AC2 /* cGenotypeBatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenotypeBatch.h; sourceTree = "<group>"; };
+		70F7DAEF09290468009E311D /* cClassificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cClassificationManager.h; sourceTree = "<group>"; };
+		70F7DAF009290468009E311D /* cClassificationManager.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cClassificationManager.cc; sourceTree = "<group>"; };
+		70F7DC9E09293E6F009E311D /* cGenotype.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenotype.cc; sourceTree = "<group>"; };
+		70F7DC9F09293E6F009E311D /* cGenotype.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenotype.h; sourceTree = "<group>"; };
+		70F7DE6809296613009E311D /* cGenotypeControl.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenotypeControl.cc; sourceTree = "<group>"; };
+		70F7DE6909296613009E311D /* cGenotypeControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenotypeControl.h; sourceTree = "<group>"; };
+		70F7DE6A09296613009E311D /* cSpeciesControl.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cSpeciesControl.cc; sourceTree = "<group>"; };
+		70F7DE6B09296613009E311D /* cSpeciesControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cSpeciesControl.h; sourceTree = "<group>"; };
+		70F7DE700929678E009E311D /* cGenotype_BirthData.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenotype_BirthData.cc; sourceTree = "<group>"; };
+		70F7DE710929678E009E311D /* cGenotype_BirthData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenotype_BirthData.h; sourceTree = "<group>"; };
+		70F7DE720929678E009E311D /* cGenotype_TestData.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cGenotype_TestData.cc; sourceTree = "<group>"; };
+		70F7DE730929678E009E311D /* cGenotype_TestData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenotype_TestData.h; sourceTree = "<group>"; };
+		70F7DE76092967A8009E311D /* cGenotypeBatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cGenotypeBatch.h; sourceTree = "<group>"; };
 		70FB86A908BFAFEC00BDF589 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
 		DCC30F7B0762539D008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
 		DCC30FA90762539D008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
@@ -723,190 +716,6 @@
 		DCC311950762539F008F7A48 /* dummy */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = dummy; sourceTree = "<group>"; };
 		DCC311970762539F008F7A48 /* organism.4stack */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = organism.4stack; sourceTree = "<group>"; };
 		DCC311980762539F008F7A48 /* organism.parasite */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = organism.parasite; sourceTree = "<group>"; };
-		DCC3119E0762539F008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
-		DCC311A70762539F008F7A48 /* unix.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; path = unix.exp; sourceTree = "<group>"; };
-		DCC311B30762539F008F7A48 /* analyze.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = analyze.cfg; sourceTree = "<group>"; };
-		DCC311B40762539F008F7A48 /* environment.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = environment.cfg; sourceTree = "<group>"; };
-		DCC311B50762539F008F7A48 /* events.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = events.cfg; sourceTree = "<group>"; };
-		DCC311B60762539F008F7A48 /* genesis */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = genesis; sourceTree = "<group>"; };
-		DCC311B70762539F008F7A48 /* inst_set.default */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = inst_set.default; sourceTree = "<group>"; };
-		DCC311B80762539F008F7A48 /* md5sum.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; path = md5sum.exp; sourceTree = "<group>"; };
-		DCC311B90762539F008F7A48 /* md5sum.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = md5sum.sh; sourceTree = "<group>"; };
-		DCC311BA0762539F008F7A48 /* organism.default */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = organism.default; sourceTree = "<group>"; };
-		DCC311C70762539F008F7A48 /* analyze.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = analyze.cfg; sourceTree = "<group>"; };
-		DCC311C80762539F008F7A48 /* detail_pop.100.last_line.expected */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = detail_pop.100.last_line.expected; sourceTree = "<group>"; };
-		DCC311C90762539F008F7A48 /* environment.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = environment.cfg; sourceTree = "<group>"; };
-		DCC311CA0762539F008F7A48 /* events.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = events.cfg; sourceTree = "<group>"; };
-		DCC311CB0762539F008F7A48 /* genesis */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = genesis; sourceTree = "<group>"; };
-		DCC311CC0762539F008F7A48 /* inst_set.default */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = inst_set.default; sourceTree = "<group>"; };
-		DCC311CD0762539F008F7A48 /* organism.default */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = organism.default; sourceTree = "<group>"; };
-		DCC311CE0762539F008F7A48 /* tail.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; path = tail.exp; sourceTree = "<group>"; };
-		DCC311CF0762539F008F7A48 /* tail.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = tail.sh; sourceTree = "<group>"; };
-		DCC311DB0762539F008F7A48 /* analyze.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = analyze.cfg; sourceTree = "<group>"; };
-		DCC311DC0762539F008F7A48 /* environment.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = environment.cfg; sourceTree = "<group>"; };
-		DCC311DD0762539F008F7A48 /* events.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = events.cfg; sourceTree = "<group>"; };
-		DCC311DE0762539F008F7A48 /* genesis */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = genesis; sourceTree = "<group>"; };
-		DCC311DF0762539F008F7A48 /* inst_set.default */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = inst_set.default; sourceTree = "<group>"; };
-		DCC311E00762539F008F7A48 /* organism.default */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = organism.default; sourceTree = "<group>"; };
-		DCC311E10762539F008F7A48 /* tail.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; path = tail.exp; sourceTree = "<group>"; };
-		DCC311E20762539F008F7A48 /* tail.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = tail.sh; sourceTree = "<group>"; };
-		DCC311F50762539F008F7A48 /* analyze.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = analyze.cfg; sourceTree = "<group>"; };
-		DCC311F60762539F008F7A48 /* environment.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = environment.cfg; sourceTree = "<group>"; };
-		DCC311F70762539F008F7A48 /* events.cfg */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = events.cfg; sourceTree = "<group>"; };
-		DCC311F80762539F008F7A48 /* genesis */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = genesis; sourceTree = "<group>"; };
-		DCC311F90762539F008F7A48 /* inst_set.default */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = inst_set.default; sourceTree = "<group>"; };
-		DCC311FA0762539F008F7A48 /* organism.default */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = organism.default; sourceTree = "<group>"; };
-		DCC311FB0762539F008F7A48 /* tail.exp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.exports; path = tail.exp; sourceTree = "<group>"; };
-		DCC311FC0762539F008F7A48 /* tail.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = tail.sh; sourceTree = "<group>"; };
-		DCC3128C076253A0008F7A48 /* 4stack_head.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = 4stack_head.t.cc; sourceTree = "<group>"; };
-		DCC3128D076253A0008F7A48 /* analyze.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = analyze.t.cc; sourceTree = "<group>"; };
-		DCC3128E076253A0008F7A48 /* analyze_command.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = analyze_command.t.cc; sourceTree = "<group>"; };
-		DCC3128F076253A0008F7A48 /* analyze_command_def.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = analyze_command_def.t.cc; sourceTree = "<group>"; };
-		DCC31290076253A0008F7A48 /* analyze_command_def_base.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = analyze_command_def_base.t.cc; sourceTree = "<group>"; };
-		DCC31291076253A0008F7A48 /* analyze_flow_command.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = analyze_flow_command.t.cc; sourceTree = "<group>"; };
-		DCC31292076253A0008F7A48 /* analyze_flow_command_def.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = analyze_flow_command_def.t.cc; sourceTree = "<group>"; };
-		DCC31293076253A0008F7A48 /* analyze_function.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = analyze_function.t.cc; sourceTree = "<group>"; };
-		DCC31294076253A0008F7A48 /* analyze_genotype.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = analyze_genotype.t.cc; sourceTree = "<group>"; };
-		DCC31295076253A0008F7A48 /* analyze_util.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = analyze_util.t.cc; sourceTree = "<group>"; };
-		DCC31296076253A0008F7A48 /* avida.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = avida.t.cc; sourceTree = "<group>"; };
-		DCC31297076253A0008F7A48 /* avida_driver_analyze.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = avida_driver_analyze.t.cc; sourceTree = "<group>"; };
-		DCC31298076253A0008F7A48 /* avida_driver_base.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = avida_driver_base.t.cc; sourceTree = "<group>"; };
-		DCC31299076253A0008F7A48 /* avida_driver_population.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = avida_driver_population.t.cc; sourceTree = "<group>"; };
-		DCC3129A076253A0008F7A48 /* avida_triggers.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = avida_triggers.t.cc; sourceTree = "<group>"; };
-		DCC3129B076253A0008F7A48 /* birth_chamber.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = birth_chamber.t.cc; sourceTree = "<group>"; };
-		DCC3129C076253A0008F7A48 /* block_struct.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = block_struct.t.cc; sourceTree = "<group>"; };
-		DCC3129D076253A0008F7A48 /* callback_util.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = callback_util.t.cc; sourceTree = "<group>"; };
-		DCC3129E076253A0008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
-		DCC312A0076253A0008F7A48 /* const_schedule.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = const_schedule.t.cc; sourceTree = "<group>"; };
-		DCC312A1076253A0008F7A48 /* cpu_head.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cpu_head.t.cc; sourceTree = "<group>"; };
-		DCC312A2076253A0008F7A48 /* cpu_memory.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cpu_memory.t.cc; sourceTree = "<group>"; };
-		DCC312A3076253A0008F7A48 /* cpu_stack.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cpu_stack.t.cc; sourceTree = "<group>"; };
-		DCC312A4076253A0008F7A48 /* cpu_test_info.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cpu_test_info.t.cc; sourceTree = "<group>"; };
-		DCC312A5076253A0008F7A48 /* data_entry.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = data_entry.t.cc; sourceTree = "<group>"; };
-		DCC312A6076253A0008F7A48 /* data_file.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = data_file.t.cc; sourceTree = "<group>"; };
-		DCC312A7076253A0008F7A48 /* data_file_manager.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = data_file_manager.t.cc; sourceTree = "<group>"; };
-		DCC312A8076253A0008F7A48 /* data_manager_base.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = data_manager_base.t.cc; sourceTree = "<group>"; };
-		DCC312A9076253A0008F7A48 /* default_message_display.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = default_message_display.t.cc; sourceTree = "<group>"; };
-		DCC312AA076253A0008F7A48 /* environment.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = environment.t.cc; sourceTree = "<group>"; };
-		DCC312AB076253A0008F7A48 /* event.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = event.t.cc; sourceTree = "<group>"; };
-		DCC312AC076253A0008F7A48 /* event_factory.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = event_factory.t.cc; sourceTree = "<group>"; };
-		DCC312AD076253A0008F7A48 /* event_factory_manager.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = event_factory_manager.t.cc; sourceTree = "<group>"; };
-		DCC312AE076253A0008F7A48 /* event_list.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = event_list.t.cc; sourceTree = "<group>"; };
-		DCC312AF076253A0008F7A48 /* event_list_entry.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = event_list_entry.t.cc; sourceTree = "<group>"; };
-		DCC312B0076253A0008F7A48 /* event_list_iterator.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = event_list_iterator.t.cc; sourceTree = "<group>"; };
-		DCC312B1076253A0008F7A48 /* file.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = file.t.cc; sourceTree = "<group>"; };
-		DCC312B2076253A0008F7A48 /* fitness_matrix.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = fitness_matrix.t.cc; sourceTree = "<group>"; };
-		DCC312B3076253A0008F7A48 /* fixed_coords.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = fixed_coords.t.cc; sourceTree = "<group>"; };
-		DCC312B4076253A0008F7A48 /* functions.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = functions.t.cc; sourceTree = "<group>"; };
-		DCC312B5076253A0008F7A48 /* genebank.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = genebank.t.cc; sourceTree = "<group>"; };
-		DCC312B6076253A0008F7A48 /* genesis.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = genesis.t.cc; sourceTree = "<group>"; };
-		DCC312B7076253A0008F7A48 /* genome.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = genome.t.cc; sourceTree = "<group>"; };
-		DCC312B8076253A0008F7A48 /* genome_util.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = genome_util.t.cc; sourceTree = "<group>"; };
-		DCC312B9076253A0008F7A48 /* genotype.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = genotype.t.cc; sourceTree = "<group>"; };
-		DCC312BA076253A0008F7A48 /* genotype_batch.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = genotype_batch.t.cc; sourceTree = "<group>"; };
-		DCC312BB076253A0008F7A48 /* genotype_birth_data.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = genotype_birth_data.t.cc; sourceTree = "<group>"; };
-		DCC312BC076253A0008F7A48 /* genotype_control.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = genotype_control.t.cc; sourceTree = "<group>"; };
-		DCC312BD076253A0008F7A48 /* hardware_4stack.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = hardware_4stack.t.cc; sourceTree = "<group>"; };
-		DCC312BE076253A0008F7A48 /* hardware_4stack_thread.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = hardware_4stack_thread.t.cc; sourceTree = "<group>"; };
-		DCC312BF076253A0008F7A48 /* hardware_base.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = hardware_base.t.cc; sourceTree = "<group>"; };
-		DCC312C0076253A0008F7A48 /* hardware_cpu.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = hardware_cpu.t.cc; sourceTree = "<group>"; };
-		DCC312C1076253A0008F7A48 /* hardware_cpu_thread.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = hardware_cpu_thread.t.cc; sourceTree = "<group>"; };
-		DCC312C2076253A0008F7A48 /* hardware_factory.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = hardware_factory.t.cc; sourceTree = "<group>"; };
-		DCC312C3076253A0008F7A48 /* hardware_util.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = hardware_util.t.cc; sourceTree = "<group>"; };
-		DCC312C4076253A0008F7A48 /* help_alias.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = help_alias.t.cc; sourceTree = "<group>"; };
-		DCC312C5076253A0008F7A48 /* help_entry.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = help_entry.t.cc; sourceTree = "<group>"; };
-		DCC312C6076253A0008F7A48 /* help_full_entry.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = help_full_entry.t.cc; sourceTree = "<group>"; };
-		DCC312C7076253A0008F7A48 /* help_manager.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = help_manager.t.cc; sourceTree = "<group>"; };
-		DCC312C8076253A0008F7A48 /* help_type.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = help_type.t.cc; sourceTree = "<group>"; };
-		DCC312C9076253A0008F7A48 /* histogram.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = histogram.t.cc; sourceTree = "<group>"; };
-		DCC312CA076253A0008F7A48 /* indexed_block_struct.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = indexed_block_struct.t.cc; sourceTree = "<group>"; };
-		DCC312CB076253A0008F7A48 /* init_file.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = init_file.t.cc; sourceTree = "<group>"; };
-		DCC312CC076253A0008F7A48 /* inject_genebank.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inject_genebank.t.cc; sourceTree = "<group>"; };
-		DCC312CD076253A0008F7A48 /* inject_genotype.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inject_genotype.t.cc; sourceTree = "<group>"; };
-		DCC312CE076253A0008F7A48 /* inject_genotype_birth_data.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inject_genotype_birth_data.t.cc; sourceTree = "<group>"; };
-		DCC312CF076253A0008F7A48 /* inject_genotype_control.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inject_genotype_control.t.cc; sourceTree = "<group>"; };
-		DCC312D0076253A0008F7A48 /* inject_genotype_element.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inject_genotype_element.t.cc; sourceTree = "<group>"; };
-		DCC312D1076253A0008F7A48 /* inject_genotype_queue.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inject_genotype_queue.t.cc; sourceTree = "<group>"; };
-		DCC312D2076253A0008F7A48 /* inst_lib_base.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inst_lib_base.t.cc; sourceTree = "<group>"; };
-		DCC312D3076253A0008F7A48 /* inst_set.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inst_set.t.cc; sourceTree = "<group>"; };
-		DCC312D4076253A0008F7A48 /* inst_util.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = inst_util.t.cc; sourceTree = "<group>"; };
-		DCC312D5076253A0008F7A48 /* integrated_schedule.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = integrated_schedule.t.cc; sourceTree = "<group>"; };
-		DCC312D6076253A0008F7A48 /* integrated_schedule_node.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = integrated_schedule_node.t.cc; sourceTree = "<group>"; };
-		DCC312D7076253A0008F7A48 /* landscape.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = landscape.t.cc; sourceTree = "<group>"; };
-		DCC312E7076253A0008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
-		DCC312E8076253A0008F7A48 /* count_tracker.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = count_tracker.t.cc; sourceTree = "<group>"; };
-		DCC312E9076253A0008F7A48 /* cpu_stats.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cpu_stats.t.cc; sourceTree = "<group>"; };
-		DCC312EA076253A0008F7A48 /* double_sum.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = double_sum.t.cc; sourceTree = "<group>"; };
-		DCC312EB076253A0008F7A48 /* event_triggers.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = event_triggers.t.cc; sourceTree = "<group>"; };
-		DCC312EC076253A0008F7A48 /* fixed_block.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = fixed_block.t.cc; sourceTree = "<group>"; };
-		DCC312ED076253A0008F7A48 /* genotype_test_data.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = genotype_test_data.t.cc; sourceTree = "<group>"; };
-		DCC312EE076253A0008F7A48 /* int_sum.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = int_sum.t.cc; sourceTree = "<group>"; };
-		DCC312F0076253A0008F7A48 /* memory_flags.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = memory_flags.t.cc; sourceTree = "<group>"; };
-		DCC312F1076253A0008F7A48 /* merit.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = merit.t.cc; sourceTree = "<group>"; };
-		DCC312F2076253A0008F7A48 /* template.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = template.t.cc; sourceTree = "<group>"; };
-		DCC312FA076253A0008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
-		DCC312FB076253A0008F7A48 /* code_label.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = code_label.t.cc; sourceTree = "<group>"; };
-		DCC312FC076253A0008F7A48 /* instruction.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = instruction.t.cc; sourceTree = "<group>"; };
-		DCC312FE076253A0008F7A48 /* lineage.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lineage.t.cc; sourceTree = "<group>"; };
-		DCC312FF076253A0008F7A48 /* lineage_control.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = lineage_control.t.cc; sourceTree = "<group>"; };
-		DCC31300076253A0008F7A48 /* local_mutations.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = local_mutations.t.cc; sourceTree = "<group>"; };
-		DCC31302076253A0008F7A48 /* message_class.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message_class.t.cc; sourceTree = "<group>"; };
-		DCC31303076253A0008F7A48 /* message_closure.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message_closure.t.cc; sourceTree = "<group>"; };
-		DCC31304076253A0008F7A48 /* message_display.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message_display.t.cc; sourceTree = "<group>"; };
-		DCC31305076253A0008F7A48 /* message_type.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = message_type.t.cc; sourceTree = "<group>"; };
-		DCC31306076253A0008F7A48 /* mutation.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mutation.t.cc; sourceTree = "<group>"; };
-		DCC31307076253A0008F7A48 /* mutation_lib.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mutation_lib.t.cc; sourceTree = "<group>"; };
-		DCC31308076253A0008F7A48 /* mutation_rates.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mutation_rates.t.cc; sourceTree = "<group>"; };
-		DCC31309076253A0008F7A48 /* mx_code_array.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mx_code_array.t.cc; sourceTree = "<group>"; };
-		DCC3130A076253A0008F7A48 /* my_code_array_less_than.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = my_code_array_less_than.t.cc; sourceTree = "<group>"; };
-		DCC3130E076253A0008F7A48 /* org_message.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = org_message.t.cc; sourceTree = "<group>"; };
-		DCC3130F076253A0008F7A48 /* organism.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = organism.t.cc; sourceTree = "<group>"; };
-		DCC31310076253A0008F7A48 /* phenotype.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = phenotype.t.cc; sourceTree = "<group>"; };
-		DCC31311076253A0008F7A48 /* population.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = population.t.cc; sourceTree = "<group>"; };
-		DCC31312076253A0008F7A48 /* population_cell.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = population_cell.t.cc; sourceTree = "<group>"; };
-		DCC31315076253A0008F7A48 /* population_interface.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = population_interface.t.cc; sourceTree = "<group>"; };
-		DCC31316076253A0008F7A48 /* prob_schedule.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = prob_schedule.t.cc; sourceTree = "<group>"; };
-		DCC31317076253A0008F7A48 /* random.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = random.t.cc; sourceTree = "<group>"; };
-		DCC31318076253A0008F7A48 /* reaction.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reaction.t.cc; sourceTree = "<group>"; };
-		DCC31319076253A0008F7A48 /* reaction_lib.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reaction_lib.t.cc; sourceTree = "<group>"; };
-		DCC3131A076253A0008F7A48 /* reaction_process.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reaction_process.t.cc; sourceTree = "<group>"; };
-		DCC3131B076253A0008F7A48 /* reaction_result.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = reaction_result.t.cc; sourceTree = "<group>"; };
-		DCC3131C076253A0008F7A48 /* ref_block.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ref_block.t.cc; sourceTree = "<group>"; };
-		DCC3131D076253A0008F7A48 /* resource.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = resource.t.cc; sourceTree = "<group>"; };
-		DCC3131E076253A0008F7A48 /* resource_count.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = resource_count.t.cc; sourceTree = "<group>"; };
-		DCC3131F076253A0008F7A48 /* resource_lib.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = resource_lib.t.cc; sourceTree = "<group>"; };
-		DCC31320076253A0008F7A48 /* running_average.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = running_average.t.cc; sourceTree = "<group>"; };
-		DCC31321076253A0008F7A48 /* scaled_block.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = scaled_block.t.cc; sourceTree = "<group>"; };
-		DCC31322076253A0008F7A48 /* schedule.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = schedule.t.cc; sourceTree = "<group>"; };
-		DCC31323076253A0008F7A48 /* spatial_count_elem.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = spatial_count_elem.t.cc; sourceTree = "<group>"; };
-		DCC31324076253A0008F7A48 /* spatial_res_count.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = spatial_res_count.t.cc; sourceTree = "<group>"; };
-		DCC31325076253A0008F7A48 /* species.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = species.t.cc; sourceTree = "<group>"; };
-		DCC31326076253A0008F7A48 /* species_control.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = species_control.t.cc; sourceTree = "<group>"; };
-		DCC31327076253A0008F7A48 /* species_queue.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = species_queue.t.cc; sourceTree = "<group>"; };
-		DCC31328076253A0008F7A48 /* stats.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = stats.t.cc; sourceTree = "<group>"; };
-		DCC31329076253A0008F7A48 /* string.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = string.t.cc; sourceTree = "<group>"; };
-		DCC3132A076253A0008F7A48 /* string_iterator.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = string_iterator.t.cc; sourceTree = "<group>"; };
-		DCC3132B076253A0008F7A48 /* string_list.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = string_list.t.cc; sourceTree = "<group>"; };
-		DCC3132C076253A0008F7A48 /* string_util.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = string_util.t.cc; sourceTree = "<group>"; };
-		DCC3132D076253A0008F7A48 /* tArgDataEntry.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tArgDataEntry.t.cc; sourceTree = "<group>"; };
-		DCC3132E076253A0008F7A48 /* tArray.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tArray.t.cc; sourceTree = "<group>"; };
-		DCC3132F076253A0008F7A48 /* task_entry.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = task_entry.t.cc; sourceTree = "<group>"; };
-		DCC31330076253A0008F7A48 /* task_lib.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = task_lib.t.cc; sourceTree = "<group>"; };
-		DCC31331076253A0008F7A48 /* tBuffer.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tBuffer.t.cc; sourceTree = "<group>"; };
-		DCC31332076253A0008F7A48 /* tDataEntry.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tDataEntry.t.cc; sourceTree = "<group>"; };
-		DCC31333076253A0008F7A48 /* tDataEntryBase.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tDataEntryBase.t.cc; sourceTree = "<group>"; };
-		DCC31334076253A0008F7A48 /* tDataEntryCommand.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tDataEntryCommand.t.cc; sourceTree = "<group>"; };
-		DCC31335076253A0008F7A48 /* tDataManager.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tDataManager.t.cc; sourceTree = "<group>"; };
-		DCC31336076253A0008F7A48 /* tDictionary.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tDictionary.t.cc; sourceTree = "<group>"; };
-		DCC31337076253A0008F7A48 /* template.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = template.t.cc; sourceTree = "<group>"; };
-		DCC31338076253A0008F7A48 /* test_cpu.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_cpu.t.cc; sourceTree = "<group>"; };
-		DCC31339076253A0008F7A48 /* test_util.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_util.t.cc; sourceTree = "<group>"; };
-		DCC3133A076253A0008F7A48 /* tList.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tList.t.cc; sourceTree = "<group>"; };
-		DCC3133B076253A0008F7A48 /* tMatrix.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tMatrix.t.cc; sourceTree = "<group>"; };
-		DCC3133C076253A0008F7A48 /* tools.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tools.t.cc; sourceTree = "<group>"; };
-		DCC3133D076253A0008F7A48 /* tVector.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = tVector.t.cc; sourceTree = "<group>"; };
-		DCC3133E076253A0008F7A48 /* uint.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = uint.t.cc; sourceTree = "<group>"; };
-		DCC3133F076253A0008F7A48 /* weighted_index.t.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = weighted_index.t.cc; sourceTree = "<group>"; };
 		DCC31345076253A0008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
 		DCC3143B076253A1008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
 		DCC3143C076253A1008F7A48 /* compare.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = compare.c; sourceTree = "<group>"; };
@@ -941,29 +750,6 @@
 		DCC31473076253A1008F7A48 /* triop.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = triop.h; sourceTree = "<group>"; };
 		DCC31474076253A1008F7A48 /* triostr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = triostr.c; sourceTree = "<group>"; };
 		DCC31475076253A1008F7A48 /* triostr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = triostr.h; sourceTree = "<group>"; };
-		DCC314B7076253A2008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
-		DCC314B8076253A2008F7A48 /* cStringable.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = cStringable.hh; sourceTree = "<group>"; };
-		DCC314B9076253A2008F7A48 /* cTestCase.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cTestCase.cc; sourceTree = "<group>"; };
-		DCC314BA076253A2008F7A48 /* cTestCase.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = cTestCase.hh; sourceTree = "<group>"; };
-		DCC314BB076253A2008F7A48 /* cTestProblem.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cTestProblem.cc; sourceTree = "<group>"; };
-		DCC314BC076253A2008F7A48 /* cTestProblem.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = cTestProblem.hh; sourceTree = "<group>"; };
-		DCC314BD076253A2008F7A48 /* cTestResult.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cTestResult.cc; sourceTree = "<group>"; };
-		DCC314BE076253A2008F7A48 /* cTestResult.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = cTestResult.hh; sourceTree = "<group>"; };
-		DCC314BF076253A2008F7A48 /* cTextTestInterpreter.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cTextTestInterpreter.cc; sourceTree = "<group>"; };
-		DCC314C0076253A2008F7A48 /* cTextTestInterpreter.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = cTextTestInterpreter.hh; sourceTree = "<group>"; };
-		DCC314CA076253A2008F7A48 /* point.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = point.h; sourceTree = "<group>"; };
-		DCC314CB076253A2008F7A48 /* test_case_point.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_case_point.cpp; sourceTree = "<group>"; };
-		DCC314CC076253A2008F7A48 /* test_case_point.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = test_case_point.h; sourceTree = "<group>"; };
-		DCC314CD076253A2008F7A48 /* test_point.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_point.cpp; sourceTree = "<group>"; };
-		DCC314CF076253A2008F7A48 /* stringable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stringable.h; sourceTree = "<group>"; };
-		DCC314D0076253A2008F7A48 /* test_case.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_case.cpp; sourceTree = "<group>"; };
-		DCC314D1076253A2008F7A48 /* test_case.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = test_case.h; sourceTree = "<group>"; };
-		DCC314D2076253A2008F7A48 /* test_problem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_problem.cpp; sourceTree = "<group>"; };
-		DCC314D3076253A2008F7A48 /* test_problem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = test_problem.h; sourceTree = "<group>"; };
-		DCC314D4076253A2008F7A48 /* test_result.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_result.cpp; sourceTree = "<group>"; };
-		DCC314D5076253A2008F7A48 /* test_result.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = test_result.h; sourceTree = "<group>"; };
-		DCC314D6076253A2008F7A48 /* text_test_interpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = text_test_interpreter.cpp; sourceTree = "<group>"; };
-		DCC314D7076253A2008F7A48 /* text_test_interpreter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = text_test_interpreter.h; sourceTree = "<group>"; };
 		DCC31547076253A4008F7A48 /* cCycleCheck.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cCycleCheck.cc; sourceTree = "<group>"; };
 		DCC3154A076253A4008F7A48 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
 		DCC31585076253A4008F7A48 /* recursive_tests_decl_hdrs.hh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; path = recursive_tests_decl_hdrs.hh; sourceTree = "<group>"; };
@@ -1011,6 +797,7 @@
 		70422A1B091B141000A5E67F /* analyze */ = {
 			isa = PBXGroup;
 			children = (
+				70F7DE76092967A8009E311D /* cGenotypeBatch.h */,
 				70422A44091B1B8500A5E67F /* CMakeLists.txt */,
 				70422A1C091B141000A5E67F /* cAnalyze.cc */,
 				70422A1D091B141000A5E67F /* cAnalyze.h */,
@@ -1070,6 +857,37 @@
 		70F7D8C8092546DC009E311D /* classification */ = {
 			isa = PBXGroup;
 			children = (
+				705333E5092A4B7C006BD186 /* cLineage.cc */,
+				705333E6092A4B7C006BD186 /* cLineage.h */,
+				70533362092A3DF4006BD186 /* cInjectGenotype_BirthData.cc */,
+				70533363092A3DF4006BD186 /* cInjectGenotype_BirthData.h */,
+				70533364092A3DF4006BD186 /* cInjectGenotype.cc */,
+				70533365092A3DF4006BD186 /* cInjectGenotype.h */,
+				70533366092A3DF4006BD186 /* cInjectGenotypeControl.cc */,
+				70533367092A3DF4006BD186 /* cInjectGenotypeControl.h */,
+				70533368092A3DF4006BD186 /* cInjectGenotypeElement.h */,
+				70533369092A3DF4006BD186 /* cInjectGenotypeQueue.cc */,
+				7053336A092A3DF4006BD186 /* cInjectGenotypeQueue.h */,
+				7053336B092A3DF4006BD186 /* nGenotype.h */,
+				7053336C092A3DF4006BD186 /* nInjectGenotype.h */,
+				7053325609297702006BD186 /* nSpecies.h */,
+				705332480929764A006BD186 /* cSpecies.cc */,
+				705332490929764A006BD186 /* cSpecies.h */,
+				7053324A0929764A006BD186 /* cSpeciesQueue.cc */,
+				7053324B0929764A006BD186 /* cSpeciesQueue.h */,
+				70F7DE700929678E009E311D /* cGenotype_BirthData.cc */,
+				70F7DE710929678E009E311D /* cGenotype_BirthData.h */,
+				70F7DE720929678E009E311D /* cGenotype_TestData.cc */,
+				70F7DE730929678E009E311D /* cGenotype_TestData.h */,
+				70F7DE6809296613009E311D /* cGenotypeControl.cc */,
+				70F7DE6909296613009E311D /* cGenotypeControl.h */,
+				70F7DE6A09296613009E311D /* cSpeciesControl.cc */,
+				70F7DE6B09296613009E311D /* cSpeciesControl.h */,
+				70F7DC9E09293E6F009E311D /* cGenotype.cc */,
+				70F7DC9F09293E6F009E311D /* cGenotype.h */,
+				70F7DAEF09290468009E311D /* cClassificationManager.h */,
+				70F7DAF009290468009E311D /* cClassificationManager.cc */,
+				7053345E092A4D88006BD186 /* CMakeLists.txt */,
 			);
 			path = classification;
 			sourceTree = "<group>";
@@ -1094,7 +912,6 @@
 				DCC30FD00762539D008F7A48 /* event */,
 				DCC310040762539D008F7A48 /* main */,
 				DCC3113A0762539E008F7A48 /* support */,
-				DCC311990762539F008F7A48 /* testsuites */,
 				DCC31340076253A0008F7A48 /* third-party */,
 				DCC314D8076253A2008F7A48 /* tools */,
 				DCC315B6076253A5008F7A48 /* utils */,
@@ -1200,32 +1017,10 @@
 				702D4EF508DA5328007BA469 /* cEnvironment.h */,
 				70CA6EB208DB7F8200068AC2 /* cFitnessMatrix.cc */,
 				70CA6EE208DB7F9E00068AC2 /* cFitnessMatrix.h */,
-				70CA6EB308DB7F8200068AC2 /* cGenebank.cc */,
-				70CA6EE308DB7F9E00068AC2 /* cGenebank.h */,
 				70CA6EB408DB7F8200068AC2 /* cGenome.cc */,
 				70CA6EE408DB7F9E00068AC2 /* cGenome.h */,
 				70CA6EB508DB7F8200068AC2 /* cGenomeUtil.cc */,
 				70CA6EE608DB7F9E00068AC2 /* cGenomeUtil.h */,
-				70CA6EB608DB7F8200068AC2 /* cGenotype_BirthData.cc */,
-				70CA6EE708DB7F9E00068AC2 /* cGenotype_BirthData.h */,
-				70CA6EB708DB7F8200068AC2 /* cGenotype_TestData.cc */,
-				70CA6EE808DB7F9E00068AC2 /* cGenotype_TestData.h */,
-				70CA6EB808DB7F8200068AC2 /* cGenotype.cc */,
-				70CA6EE908DB7F9E00068AC2 /* cGenotype.h */,
-				70CA6EF508DB806200068AC2 /* cGenotypeBatch.h */,
-				70CA6EB908DB7F8200068AC2 /* cGenotypeControl.cc */,
-				70CA6EEA08DB7F9E00068AC2 /* cGenotypeControl.h */,
-				70CA6EBA08DB7F8200068AC2 /* cInjectGenebank.cc */,
-				70CA6EEB08DB7F9E00068AC2 /* cInjectGenebank.h */,
-				70CA6EBB08DB7F8200068AC2 /* cInjectGenotype_BirthData.cc */,
-				70CA6EEC08DB7F9E00068AC2 /* cInjectGenotype_BirthData.h */,
-				70CA6EBC08DB7F8200068AC2 /* cInjectGenotype.cc */,
-				70CA6EED08DB7F9E00068AC2 /* cInjectGenotype.h */,
-				70CA6EBD08DB7F8200068AC2 /* cInjectGenotypeControl.cc */,
-				70CA6EEE08DB7F9E00068AC2 /* cInjectGenotypeControl.h */,
-				70CA6EEF08DB7F9E00068AC2 /* cInjectGenotypeElement.h */,
-				70CA6EBE08DB7F8200068AC2 /* cInjectGenotypeQueue.cc */,
-				70CA6EF008DB7F9E00068AC2 /* cInjectGenotypeQueue.h */,
 				70CA6EF108DB7F9E00068AC2 /* cInstLibBase.h */,
 				70CA6EBF08DB7F8200068AC2 /* cInstruction.cc */,
 				70CA6EF208DB7F9E00068AC2 /* cInstruction.h */,
@@ -1235,10 +1030,6 @@
 				70CA6EF408DB7F9E00068AC2 /* cInstUtil.h */,
 				70B0865108F4974300FC65FE /* cLandscape.cc */,
 				70B0864808F4972600FC65FE /* cLandscape.h */,
-				70B0865208F4974300FC65FE /* cLineage.cc */,
-				70B0864908F4972600FC65FE /* cLineage.h */,
-				70B0865308F4974300FC65FE /* cLineageControl.cc */,
-				70B0864A08F4972600FC65FE /* cLineageControl.h */,
 				70B0865408F4974300FC65FE /* cLocalMutations.cc */,
 				70B0864B08F4972600FC65FE /* cLocalMutations.h */,
 				70B0865508F4974300FC65FE /* cMutation.cc */,
@@ -1281,12 +1072,6 @@
 				70B0871608F5E81000FC65FE /* cSpatialCountElem.h */,
 				70B0872708F5E82D00FC65FE /* cSpatialResCount.cc */,
 				70B0871708F5E81000FC65FE /* cSpatialResCount.h */,
-				70B0872808F5E82D00FC65FE /* cSpecies.cc */,
-				70B0871808F5E81000FC65FE /* cSpecies.h */,
-				70B0872908F5E82D00FC65FE /* cSpeciesControl.cc */,
-				70B0871908F5E81000FC65FE /* cSpeciesControl.h */,
-				70B0872A08F5E82D00FC65FE /* cSpeciesQueue.cc */,
-				70B0871A08F5E81000FC65FE /* cSpeciesQueue.h */,
 				70B0872B08F5E82D00FC65FE /* cStats.cc */,
 				70B0871B08F5E81000FC65FE /* cStats.h */,
 				70B0872C08F5E82D00FC65FE /* cTaskEntry.cc */,
@@ -1296,12 +1081,9 @@
 				70C5BC6209059A970028A785 /* cWorld.h */,
 				70C5BC6309059A970028A785 /* cWorld.cc */,
 				70B0865008F4972600FC65FE /* MyCodeArrayLessThan.h */,
-				70B0861508F48E8900FC65FE /* nGenotype.h */,
 				70B0875A08F5EC8900FC65FE /* nGeometry.h */,
-				70B0861608F48E8900FC65FE /* nInjectGenotype.h */,
 				70B0867208F499C100FC65FE /* nMutation.h */,
 				70B0875C08F5ECBC00FC65FE /* nReaction.h */,
-				70B085D108F48C9400FC65FE /* nSpecies.h */,
 				DCC311090762539E008F7A48 /* primitive.cc */,
 				DCC310A90762539E008F7A48 /* CMakeLists.txt */,
 			);
@@ -1374,299 +1156,11 @@
 			path = preset_organisms;
 			sourceTree = "<group>";
 		};
-		DCC311990762539F008F7A48 /* testsuites */ = {
-			isa = PBXGroup;
-			children = (
-				DCC3119E0762539F008F7A48 /* CMakeLists.txt */,
-				DCC3119F0762539F008F7A48 /* functional_testsuites */,
-				DCC311FE0762539F008F7A48 /* unit_testsuites */,
-			);
-			path = testsuites;
-			sourceTree = "<group>";
-		};
-		DCC3119F0762539F008F7A48 /* functional_testsuites */ = {
-			isa = PBXGroup;
-			children = (
-				DCC311A30762539F008F7A48 /* config */,
-				DCC311A80762539F008F7A48 /* default.md5sum */,
-				DCC311BB0762539F008F7A48 /* default.tail */,
-				DCC311D00762539F008F7A48 /* default.tail.disabled */,
-				DCC311E30762539F008F7A48 /* demo.md5sum */,
-				DCC311E60762539F008F7A48 /* demo.tail.disabled */,
-				DCC311EA0762539F008F7A48 /* tedious.tail.disabled */,
-			);
-			path = functional_testsuites;
-			sourceTree = "<group>";
-		};
-		DCC311A30762539F008F7A48 /* config */ = {
-			isa = PBXGroup;
-			children = (
-				DCC311A70762539F008F7A48 /* unix.exp */,
-			);
-			path = config;
-			sourceTree = "<group>";
-		};
-		DCC311A80762539F008F7A48 /* default.md5sum */ = {
-			isa = PBXGroup;
-			children = (
-				DCC311B30762539F008F7A48 /* analyze.cfg */,
-				DCC311B40762539F008F7A48 /* environment.cfg */,
-				DCC311B50762539F008F7A48 /* events.cfg */,
-				DCC311B60762539F008F7A48 /* genesis */,
-				DCC311B70762539F008F7A48 /* inst_set.default */,
-				DCC311B80762539F008F7A48 /* md5sum.exp */,
-				DCC311B90762539F008F7A48 /* md5sum.sh */,
-				DCC311BA0762539F008F7A48 /* organism.default */,
-			);
-			path = default.md5sum;
-			sourceTree = "<group>";
-		};
-		DCC311BB0762539F008F7A48 /* default.tail */ = {
-			isa = PBXGroup;
-			children = (
-				DCC311C70762539F008F7A48 /* analyze.cfg */,
-				DCC311C80762539F008F7A48 /* detail_pop.100.last_line.expected */,
-				DCC311C90762539F008F7A48 /* environment.cfg */,
-				DCC311CA0762539F008F7A48 /* events.cfg */,
-				DCC311CB0762539F008F7A48 /* genesis */,
-				DCC311CC0762539F008F7A48 /* inst_set.default */,
-				DCC311CD0762539F008F7A48 /* organism.default */,
-				DCC311CE0762539F008F7A48 /* tail.exp */,
-				DCC311CF0762539F008F7A48 /* tail.sh */,
-			);
-			path = default.tail;
-			sourceTree = "<group>";
-		};
-		DCC311D00762539F008F7A48 /* default.tail.disabled */ = {
-			isa = PBXGroup;
-			children = (
-				DCC311DB0762539F008F7A48 /* analyze.cfg */,
-				DCC311DC0762539F008F7A48 /* environment.cfg */,
-				DCC311DD0762539F008F7A48 /* events.cfg */,
-				DCC311DE0762539F008F7A48 /* genesis */,
-				DCC311DF0762539F008F7A48 /* inst_set.default */,
-				DCC311E00762539F008F7A48 /* organism.default */,
-				DCC311E10762539F008F7A48 /* tail.exp */,
-				DCC311E20762539F008F7A48 /* tail.sh */,
-			);
-			path = default.tail.disabled;
-			sourceTree = "<group>";
-		};
-		DCC311E30762539F008F7A48 /* demo.md5sum */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			path = demo.md5sum;
-			sourceTree = "<group>";
-		};
-		DCC311E60762539F008F7A48 /* demo.tail.disabled */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			path = demo.tail.disabled;
-			sourceTree = "<group>";
-		};
-		DCC311EA0762539F008F7A48 /* tedious.tail.disabled */ = {
-			isa = PBXGroup;
-			children = (
-				DCC311F50762539F008F7A48 /* analyze.cfg */,
-				DCC311F60762539F008F7A48 /* environment.cfg */,
-				DCC311F70762539F008F7A48 /* events.cfg */,
-				DCC311F80762539F008F7A48 /* genesis */,
-				DCC311F90762539F008F7A48 /* inst_set.default */,
-				DCC311FA0762539F008F7A48 /* organism.default */,
-				DCC311FB0762539F008F7A48 /* tail.exp */,
-				DCC311FC0762539F008F7A48 /* tail.sh */,
-			);
-			path = tedious.tail.disabled;
-			sourceTree = "<group>";
-		};
-		DCC311FE0762539F008F7A48 /* unit_testsuites */ = {
-			isa = PBXGroup;
-			children = (
-				DCC3128C076253A0008F7A48 /* 4stack_head.t.cc */,
-				DCC3128D076253A0008F7A48 /* analyze.t.cc */,
-				DCC3128E076253A0008F7A48 /* analyze_command.t.cc */,
-				DCC3128F076253A0008F7A48 /* analyze_command_def.t.cc */,
-				DCC31290076253A0008F7A48 /* analyze_command_def_base.t.cc */,
-				DCC31291076253A0008F7A48 /* analyze_flow_command.t.cc */,
-				DCC31292076253A0008F7A48 /* analyze_flow_command_def.t.cc */,
-				DCC31293076253A0008F7A48 /* analyze_function.t.cc */,
-				DCC31294076253A0008F7A48 /* analyze_genotype.t.cc */,
-				DCC31295076253A0008F7A48 /* analyze_util.t.cc */,
-				DCC31296076253A0008F7A48 /* avida.t.cc */,
-				DCC31297076253A0008F7A48 /* avida_driver_analyze.t.cc */,
-				DCC31298076253A0008F7A48 /* avida_driver_base.t.cc */,
-				DCC31299076253A0008F7A48 /* avida_driver_population.t.cc */,
-				DCC3129A076253A0008F7A48 /* avida_triggers.t.cc */,
-				DCC3129B076253A0008F7A48 /* birth_chamber.t.cc */,
-				DCC3129C076253A0008F7A48 /* block_struct.t.cc */,
-				DCC3129D076253A0008F7A48 /* callback_util.t.cc */,
-				DCC3129E076253A0008F7A48 /* CMakeLists.txt */,
-				DCC312A0076253A0008F7A48 /* const_schedule.t.cc */,
-				DCC312A1076253A0008F7A48 /* cpu_head.t.cc */,
-				DCC312A2076253A0008F7A48 /* cpu_memory.t.cc */,
-				DCC312A3076253A0008F7A48 /* cpu_stack.t.cc */,
-				DCC312A4076253A0008F7A48 /* cpu_test_info.t.cc */,
-				DCC312A5076253A0008F7A48 /* data_entry.t.cc */,
-				DCC312A6076253A0008F7A48 /* data_file.t.cc */,
-				DCC312A7076253A0008F7A48 /* data_file_manager.t.cc */,
-				DCC312A8076253A0008F7A48 /* data_manager_base.t.cc */,
-				DCC312A9076253A0008F7A48 /* default_message_display.t.cc */,
-				DCC312AA076253A0008F7A48 /* environment.t.cc */,
-				DCC312AB076253A0008F7A48 /* event.t.cc */,
-				DCC312AC076253A0008F7A48 /* event_factory.t.cc */,
-				DCC312AD076253A0008F7A48 /* event_factory_manager.t.cc */,
-				DCC312AE076253A0008F7A48 /* event_list.t.cc */,
-				DCC312AF076253A0008F7A48 /* event_list_entry.t.cc */,
-				DCC312B0076253A0008F7A48 /* event_list_iterator.t.cc */,
-				DCC312B1076253A0008F7A48 /* file.t.cc */,
-				DCC312B2076253A0008F7A48 /* fitness_matrix.t.cc */,
-				DCC312B3076253A0008F7A48 /* fixed_coords.t.cc */,
-				DCC312B4076253A0008F7A48 /* functions.t.cc */,
-				DCC312B5076253A0008F7A48 /* genebank.t.cc */,
-				DCC312B6076253A0008F7A48 /* genesis.t.cc */,
-				DCC312B7076253A0008F7A48 /* genome.t.cc */,
-				DCC312B8076253A0008F7A48 /* genome_util.t.cc */,
-				DCC312B9076253A0008F7A48 /* genotype.t.cc */,
-				DCC312BA076253A0008F7A48 /* genotype_batch.t.cc */,
-				DCC312BB076253A0008F7A48 /* genotype_birth_data.t.cc */,
-				DCC312BC076253A0008F7A48 /* genotype_control.t.cc */,
-				DCC312BD076253A0008F7A48 /* hardware_4stack.t.cc */,
-				DCC312BE076253A0008F7A48 /* hardware_4stack_thread.t.cc */,
-				DCC312BF076253A0008F7A48 /* hardware_base.t.cc */,
-				DCC312C0076253A0008F7A48 /* hardware_cpu.t.cc */,
-				DCC312C1076253A0008F7A48 /* hardware_cpu_thread.t.cc */,
-				DCC312C2076253A0008F7A48 /* hardware_factory.t.cc */,
-				DCC312C3076253A0008F7A48 /* hardware_util.t.cc */,
-				DCC312C4076253A0008F7A48 /* help_alias.t.cc */,
-				DCC312C5076253A0008F7A48 /* help_entry.t.cc */,
-				DCC312C6076253A0008F7A48 /* help_full_entry.t.cc */,
-				DCC312C7076253A0008F7A48 /* help_manager.t.cc */,
-				DCC312C8076253A0008F7A48 /* help_type.t.cc */,
-				DCC312C9076253A0008F7A48 /* histogram.t.cc */,
-				DCC312CA076253A0008F7A48 /* indexed_block_struct.t.cc */,
-				DCC312CB076253A0008F7A48 /* init_file.t.cc */,
-				DCC312CC076253A0008F7A48 /* inject_genebank.t.cc */,
-				DCC312CD076253A0008F7A48 /* inject_genotype.t.cc */,
-				DCC312CE076253A0008F7A48 /* inject_genotype_birth_data.t.cc */,
-				DCC312CF076253A0008F7A48 /* inject_genotype_control.t.cc */,
-				DCC312D0076253A0008F7A48 /* inject_genotype_element.t.cc */,
-				DCC312D1076253A0008F7A48 /* inject_genotype_queue.t.cc */,
-				DCC312D2076253A0008F7A48 /* inst_lib_base.t.cc */,
-				DCC312D3076253A0008F7A48 /* inst_set.t.cc */,
-				DCC312D4076253A0008F7A48 /* inst_util.t.cc */,
-				DCC312D5076253A0008F7A48 /* integrated_schedule.t.cc */,
-				DCC312D6076253A0008F7A48 /* integrated_schedule_node.t.cc */,
-				DCC312D7076253A0008F7A48 /* landscape.t.cc */,
-				DCC312D8076253A0008F7A48 /* level_0 */,
-				DCC312F3076253A0008F7A48 /* level_1 */,
-				DCC312FE076253A0008F7A48 /* lineage.t.cc */,
-				DCC312FF076253A0008F7A48 /* lineage_control.t.cc */,
-				DCC31300076253A0008F7A48 /* local_mutations.t.cc */,
-				DCC31302076253A0008F7A48 /* message_class.t.cc */,
-				DCC31303076253A0008F7A48 /* message_closure.t.cc */,
-				DCC31304076253A0008F7A48 /* message_display.t.cc */,
-				DCC31305076253A0008F7A48 /* message_type.t.cc */,
-				DCC31306076253A0008F7A48 /* mutation.t.cc */,
-				DCC31307076253A0008F7A48 /* mutation_lib.t.cc */,
-				DCC31308076253A0008F7A48 /* mutation_rates.t.cc */,
-				DCC31309076253A0008F7A48 /* mx_code_array.t.cc */,
-				DCC3130A076253A0008F7A48 /* my_code_array_less_than.t.cc */,
-				DCC3130B076253A0008F7A48 /* ncurses_viewer */,
-				DCC3130E076253A0008F7A48 /* org_message.t.cc */,
-				DCC3130F076253A0008F7A48 /* organism.t.cc */,
-				DCC31310076253A0008F7A48 /* phenotype.t.cc */,
-				DCC31311076253A0008F7A48 /* population.t.cc */,
-				DCC31312076253A0008F7A48 /* population_cell.t.cc */,
-				DCC31315076253A0008F7A48 /* population_interface.t.cc */,
-				DCC31316076253A0008F7A48 /* prob_schedule.t.cc */,
-				DCC31317076253A0008F7A48 /* random.t.cc */,
-				DCC31318076253A0008F7A48 /* reaction.t.cc */,
-				DCC31319076253A0008F7A48 /* reaction_lib.t.cc */,
-				DCC3131A076253A0008F7A48 /* reaction_process.t.cc */,
-				DCC3131B076253A0008F7A48 /* reaction_result.t.cc */,
-				DCC3131C076253A0008F7A48 /* ref_block.t.cc */,
-				DCC3131D076253A0008F7A48 /* resource.t.cc */,
-				DCC3131E076253A0008F7A48 /* resource_count.t.cc */,
-				DCC3131F076253A0008F7A48 /* resource_lib.t.cc */,
-				DCC31320076253A0008F7A48 /* running_average.t.cc */,
-				DCC31321076253A0008F7A48 /* scaled_block.t.cc */,
-				DCC31322076253A0008F7A48 /* schedule.t.cc */,
-				DCC31323076253A0008F7A48 /* spatial_count_elem.t.cc */,
-				DCC31324076253A0008F7A48 /* spatial_res_count.t.cc */,
-				DCC31325076253A0008F7A48 /* species.t.cc */,
-				DCC31326076253A0008F7A48 /* species_control.t.cc */,
-				DCC31327076253A0008F7A48 /* species_queue.t.cc */,
-				DCC31328076253A0008F7A48 /* stats.t.cc */,
-				DCC31329076253A0008F7A48 /* string.t.cc */,
-				DCC3132A076253A0008F7A48 /* string_iterator.t.cc */,
-				DCC3132B076253A0008F7A48 /* string_list.t.cc */,
-				DCC3132C076253A0008F7A48 /* string_util.t.cc */,
-				DCC3132D076253A0008F7A48 /* tArgDataEntry.t.cc */,
-				DCC3132E076253A0008F7A48 /* tArray.t.cc */,
-				DCC3132F076253A0008F7A48 /* task_entry.t.cc */,
-				DCC31330076253A0008F7A48 /* task_lib.t.cc */,
-				DCC31331076253A0008F7A48 /* tBuffer.t.cc */,
-				DCC31332076253A0008F7A48 /* tDataEntry.t.cc */,
-				DCC31333076253A0008F7A48 /* tDataEntryBase.t.cc */,
-				DCC31334076253A0008F7A48 /* tDataEntryCommand.t.cc */,
-				DCC31335076253A0008F7A48 /* tDataManager.t.cc */,
-				DCC31336076253A0008F7A48 /* tDictionary.t.cc */,
-				DCC31337076253A0008F7A48 /* template.t.cc */,
-				DCC31338076253A0008F7A48 /* test_cpu.t.cc */,
-				DCC31339076253A0008F7A48 /* test_util.t.cc */,
-				DCC3133A076253A0008F7A48 /* tList.t.cc */,
-				DCC3133B076253A0008F7A48 /* tMatrix.t.cc */,
-				DCC3133C076253A0008F7A48 /* tools.t.cc */,
-				DCC3133D076253A0008F7A48 /* tVector.t.cc */,
-				DCC3133E076253A0008F7A48 /* uint.t.cc */,
-				DCC3133F076253A0008F7A48 /* weighted_index.t.cc */,
-			);
-			path = unit_testsuites;
-			sourceTree = "<group>";
-		};
-		DCC312D8076253A0008F7A48 /* level_0 */ = {
-			isa = PBXGroup;
-			children = (
-				DCC312E7076253A0008F7A48 /* CMakeLists.txt */,
-				DCC312E8076253A0008F7A48 /* count_tracker.t.cc */,
-				DCC312E9076253A0008F7A48 /* cpu_stats.t.cc */,
-				DCC312EA076253A0008F7A48 /* double_sum.t.cc */,
-				DCC312EB076253A0008F7A48 /* event_triggers.t.cc */,
-				DCC312EC076253A0008F7A48 /* fixed_block.t.cc */,
-				DCC312ED076253A0008F7A48 /* genotype_test_data.t.cc */,
-				DCC312EE076253A0008F7A48 /* int_sum.t.cc */,
-				DCC312F0076253A0008F7A48 /* memory_flags.t.cc */,
-				DCC312F1076253A0008F7A48 /* merit.t.cc */,
-				DCC312F2076253A0008F7A48 /* template.t.cc */,
-			);
-			path = level_0;
-			sourceTree = "<group>";
-		};
-		DCC312F3076253A0008F7A48 /* level_1 */ = {
-			isa = PBXGroup;
-			children = (
-				DCC312FA076253A0008F7A48 /* CMakeLists.txt */,
-				DCC312FB076253A0008F7A48 /* code_label.t.cc */,
-				DCC312FC076253A0008F7A48 /* instruction.t.cc */,
-			);
-			path = level_1;
-			sourceTree = "<group>";
-		};
-		DCC3130B076253A0008F7A48 /* ncurses_viewer */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			path = ncurses_viewer;
-			sourceTree = "<group>";
-		};
 		DCC31340076253A0008F7A48 /* third-party */ = {
 			isa = PBXGroup;
 			children = (
 				DCC31345076253A0008F7A48 /* CMakeLists.txt */,
 				DCC31429076253A1008F7A48 /* trio */,
-				DCC314A9076253A2008F7A48 /* yaktest */,
 			);
 			path = "third-party";
 			sourceTree = "<group>";
@@ -1727,44 +1221,6 @@
 			path = html;
 			sourceTree = "<group>";
 		};
-		DCC314A9076253A2008F7A48 /* yaktest */ = {
-			isa = PBXGroup;
-			children = (
-				DCC314B7076253A2008F7A48 /* CMakeLists.txt */,
-				DCC314B8076253A2008F7A48 /* cStringable.hh */,
-				DCC314B9076253A2008F7A48 /* cTestCase.cc */,
-				DCC314BA076253A2008F7A48 /* cTestCase.hh */,
-				DCC314BB076253A2008F7A48 /* cTestProblem.cc */,
-				DCC314BC076253A2008F7A48 /* cTestProblem.hh */,
-				DCC314BD076253A2008F7A48 /* cTestResult.cc */,
-				DCC314BE076253A2008F7A48 /* cTestResult.hh */,
-				DCC314BF076253A2008F7A48 /* cTextTestInterpreter.cc */,
-				DCC314C0076253A2008F7A48 /* cTextTestInterpreter.hh */,
-				DCC314C1076253A2008F7A48 /* example */,
-				DCC314CF076253A2008F7A48 /* stringable.h */,
-				DCC314D0076253A2008F7A48 /* test_case.cpp */,
-				DCC314D1076253A2008F7A48 /* test_case.h */,
-				DCC314D2076253A2008F7A48 /* test_problem.cpp */,
-				DCC314D3076253A2008F7A48 /* test_problem.h */,
-				DCC314D4076253A2008F7A48 /* test_result.cpp */,
-				DCC314D5076253A2008F7A48 /* test_result.h */,
-				DCC314D6076253A2008F7A48 /* text_test_interpreter.cpp */,
-				DCC314D7076253A2008F7A48 /* text_test_interpreter.h */,
-			);
-			path = yaktest;
-			sourceTree = "<group>";
-		};
-		DCC314C1076253A2008F7A48 /* example */ = {
-			isa = PBXGroup;
-			children = (
-				DCC314CA076253A2008F7A48 /* point.h */,
-				DCC314CB076253A2008F7A48 /* test_case_point.cpp */,
-				DCC314CC076253A2008F7A48 /* test_case_point.h */,
-				DCC314CD076253A2008F7A48 /* test_point.cpp */,
-			);
-			path = example;
-			sourceTree = "<group>";
-		};
 		DCC314D8076253A2008F7A48 /* tools */ = {
 			isa = PBXGroup;
 			children = (
@@ -2098,24 +1554,12 @@
 				702D4F0708DA5341007BA469 /* cPopulationInterface.cc in Sources */,
 				702D4F4B08DA61FE007BA469 /* cBirthChamber.cc in Sources */,
 				70CA6ED208DB7F8200068AC2 /* cFitnessMatrix.cc in Sources */,
-				70CA6ED308DB7F8200068AC2 /* cGenebank.cc in Sources */,
 				70CA6ED408DB7F8200068AC2 /* cGenome.cc in Sources */,
 				70CA6ED508DB7F8200068AC2 /* cGenomeUtil.cc in Sources */,
-				70CA6ED608DB7F8200068AC2 /* cGenotype_BirthData.cc in Sources */,
-				70CA6ED708DB7F8200068AC2 /* cGenotype_TestData.cc in Sources */,
-				70CA6ED808DB7F8200068AC2 /* cGenotype.cc in Sources */,
-				70CA6ED908DB7F8200068AC2 /* cGenotypeControl.cc in Sources */,
-				70CA6EDA08DB7F8200068AC2 /* cInjectGenebank.cc in Sources */,
-				70CA6EDB08DB7F8200068AC2 /* cInjectGenotype_BirthData.cc in Sources */,
-				70CA6EDC08DB7F8200068AC2 /* cInjectGenotype.cc in Sources */,
-				70CA6EDD08DB7F8200068AC2 /* cInjectGenotypeControl.cc in Sources */,
-				70CA6EDE08DB7F8200068AC2 /* cInjectGenotypeQueue.cc in Sources */,
 				70CA6EDF08DB7F8200068AC2 /* cInstruction.cc in Sources */,
 				70CA6EE008DB7F8200068AC2 /* cInstSet.cc in Sources */,
 				70CA6EE108DB7F8200068AC2 /* cInstUtil.cc in Sources */,
 				70B0866108F4974300FC65FE /* cLandscape.cc in Sources */,
-				70B0866208F4974300FC65FE /* cLineage.cc in Sources */,
-				70B0866308F4974300FC65FE /* cLineageControl.cc in Sources */,
 				70B0866408F4974300FC65FE /* cLocalMutations.cc in Sources */,
 				70B0866508F4974300FC65FE /* cMutation.cc in Sources */,
 				70B0866608F4974300FC65FE /* cMutationLib.cc in Sources */,
@@ -2136,9 +1580,6 @@
 				70B0874508F5E82D00FC65FE /* cResourceLib.cc in Sources */,
 				70B0874608F5E82D00FC65FE /* cSpatialCountElem.cc in Sources */,
 				70B0874708F5E82D00FC65FE /* cSpatialResCount.cc in Sources */,
-				70B0874808F5E82D00FC65FE /* cSpecies.cc in Sources */,
-				70B0874908F5E82D00FC65FE /* cSpeciesControl.cc in Sources */,
-				70B0874A08F5E82D00FC65FE /* cSpeciesQueue.cc in Sources */,
 				70B0874B08F5E82D00FC65FE /* cStats.cc in Sources */,
 				70B0874C08F5E82D00FC65FE /* cTaskEntry.cc in Sources */,
 				70B0874D08F5E82D00FC65FE /* cTaskLib.cc in Sources */,
@@ -2194,6 +1635,19 @@
 				70422A28091B141000A5E67F /* cAnalyze.cc in Sources */,
 				70422A30091B141000A5E67F /* cAnalyzeGenotype.cc in Sources */,
 				70422A32091B141000A5E67F /* cAnalyzeUtil.cc in Sources */,
+				70F7DCA009293E76009E311D /* cClassificationManager.cc in Sources */,
+				70F7DCA109293E77009E311D /* cGenotype.cc in Sources */,
+				70533479092A4F4D006BD186 /* cGenotype_BirthData.cc in Sources */,
+				7053347A092A4F4F006BD186 /* cGenotype_TestData.cc in Sources */,
+				7053347B092A4F50006BD186 /* cGenotypeControl.cc in Sources */,
+				7053347C092A4F52006BD186 /* cInjectGenotype.cc in Sources */,
+				7053347D092A4F53006BD186 /* cInjectGenotype_BirthData.cc in Sources */,
+				7053347E092A4F55006BD186 /* cInjectGenotypeControl.cc in Sources */,
+				70533480092A4F59006BD186 /* cInjectGenotypeQueue.cc in Sources */,
+				70533481092A4F5B006BD186 /* cLineage.cc in Sources */,
+				70533482092A4F5D006BD186 /* cSpecies.cc in Sources */,
+				70533483092A4F5F006BD186 /* cSpeciesControl.cc in Sources */,
+				70533484092A4F60006BD186 /* cSpeciesQueue.cc in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2230,24 +1684,12 @@
 				702D4F0108DA5341007BA469 /* cEnvironment.cc in Sources */,
 				702D4F0208DA5341007BA469 /* cPopulationInterface.cc in Sources */,
 				702D4F4508DA61FE007BA469 /* cBirthChamber.cc in Sources */,
-				70CA6EC308DB7F8200068AC2 /* cGenebank.cc in Sources */,
 				70CA6EC408DB7F8200068AC2 /* cGenome.cc in Sources */,
 				70CA6EC508DB7F8200068AC2 /* cGenomeUtil.cc in Sources */,
-				70CA6EC608DB7F8200068AC2 /* cGenotype_BirthData.cc in Sources */,
-				70CA6EC708DB7F8200068AC2 /* cGenotype_TestData.cc in Sources */,
-				70CA6EC808DB7F8200068AC2 /* cGenotype.cc in Sources */,
-				70CA6EC908DB7F8200068AC2 /* cGenotypeControl.cc in Sources */,
-				70CA6ECA08DB7F8200068AC2 /* cInjectGenebank.cc in Sources */,
-				70CA6ECB08DB7F8200068AC2 /* cInjectGenotype_BirthData.cc in Sources */,
-				70CA6ECC08DB7F8200068AC2 /* cInjectGenotype.cc in Sources */,
-				70CA6ECD08DB7F8200068AC2 /* cInjectGenotypeControl.cc in Sources */,
-				70CA6ECE08DB7F8200068AC2 /* cInjectGenotypeQueue.cc in Sources */,
 				70CA6ECF08DB7F8200068AC2 /* cInstruction.cc in Sources */,
 				70CA6ED008DB7F8200068AC2 /* cInstSet.cc in Sources */,
 				70CA6ED108DB7F8200068AC2 /* cInstUtil.cc in Sources */,
 				70B0865908F4974300FC65FE /* cLandscape.cc in Sources */,
-				70B0865A08F4974300FC65FE /* cLineage.cc in Sources */,
-				70B0865B08F4974300FC65FE /* cLineageControl.cc in Sources */,
 				70B0865C08F4974300FC65FE /* cLocalMutations.cc in Sources */,
 				70B0865D08F4974300FC65FE /* cMutation.cc in Sources */,
 				70B0865E08F4974300FC65FE /* cMutationLib.cc in Sources */,
@@ -2267,9 +1709,6 @@
 				70B0873508F5E82D00FC65FE /* cResourceLib.cc in Sources */,
 				70B0873608F5E82D00FC65FE /* cSpatialCountElem.cc in Sources */,
 				70B0873708F5E82D00FC65FE /* cSpatialResCount.cc in Sources */,
-				70B0873808F5E82D00FC65FE /* cSpecies.cc in Sources */,
-				70B0873908F5E82D00FC65FE /* cSpeciesControl.cc in Sources */,
-				70B0873A08F5E82D00FC65FE /* cSpeciesQueue.cc in Sources */,
 				70B0873B08F5E82D00FC65FE /* cStats.cc in Sources */,
 				70B0873C08F5E82D00FC65FE /* cTaskEntry.cc in Sources */,
 				70B0873D08F5E82D00FC65FE /* cTaskLib.cc in Sources */,
@@ -2313,6 +1752,19 @@
 				70422A3C091B141000A5E67F /* cAnalyzeGenotype.cc in Sources */,
 				70422A3E091B141000A5E67F /* cAnalyzeUtil.cc in Sources */,
 				70F7D8CE09254787009E311D /* cFitnessMatrix.cc in Sources */,
+				70F7DAF409290468009E311D /* cClassificationManager.cc in Sources */,
+				70F7DCA309293E87009E311D /* cGenotype.cc in Sources */,
+				70F7DE6C09296615009E311D /* cGenotypeControl.cc in Sources */,
+				70F7DE6D09296616009E311D /* cSpeciesControl.cc in Sources */,
+				70F7DE7409296794009E311D /* cGenotype_BirthData.cc in Sources */,
+				70F7DE7509296795009E311D /* cGenotype_TestData.cc in Sources */,
+				7053324C0929764C006BD186 /* cSpecies.cc in Sources */,
+				7053324D0929764E006BD186 /* cSpeciesQueue.cc in Sources */,
+				7053336D092A3DF9006BD186 /* cInjectGenotype.cc in Sources */,
+				7053336E092A3DFB006BD186 /* cInjectGenotype_BirthData.cc in Sources */,
+				7053336F092A3DFC006BD186 /* cInjectGenotypeControl.cc in Sources */,
+				70533371092A3E00006BD186 /* cInjectGenotypeQueue.cc in Sources */,
+				705333E7092A4B7F006BD186 /* cLineage.cc in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: development/CMakeLists.txt
===================================================================
--- development/CMakeLists.txt	2005-11-15 17:22:29 UTC (rev 398)
+++ development/CMakeLists.txt	2005-11-15 18:05:29 UTC (rev 399)
@@ -225,6 +225,7 @@
 SET(THIRDPARTY_SRC_DIR ${PROJECT_SOURCE_DIR}/source/third-party)
 SET(TOOLS_SRC_DIR ${PROJECT_SOURCE_DIR}/source/tools)
 SET(ANALYZE_SRC_DIR ${PROJECT_SOURCE_DIR}/source/analyze)
+SET(CLASSIFICATION_SRC_DIR ${PROJECT_SOURCE_DIR}/source/classification)
 SET(CPU_SRC_DIR ${PROJECT_SOURCE_DIR}/source/cpu)
 SET(EVENT_SRC_DIR ${PROJECT_SOURCE_DIR}/source/event)
 SET(MAIN_SRC_DIR ${PROJECT_SOURCE_DIR}/source/main)
@@ -233,6 +234,7 @@
 SET(THIRDPARTY_BLD_DIR ${PROJECT_BINARY_DIR}/source/third-party)
 SET(TOOLS_BLD_DIR ${PROJECT_BINARY_DIR}/source/tools)
 SET(ANALYZE_BLD_DIR ${PROJECT_BINARY_DIR}/source/analyze)
+SET(CLASSSIFICATION_BLD_DIR ${PROJECT_BINARY_DIR}/source/classification)
 SET(CPU_BLD_DIR ${PROJECT_BINARY_DIR}/source/cpu)
 SET(EVENT_BLD_DIR ${PROJECT_BINARY_DIR}/source/event)
 SET(MAIN_BLD_DIR ${PROJECT_BINARY_DIR}/source/main)
@@ -242,6 +244,7 @@
 SET(ALL_INC_DIRS
   ${TOOLS_SRC_DIR}
   ${ANALYZE_SRC_DIR}
+  ${CLASSIFICATION_SRC_DIR}
   ${CPU_SRC_DIR}
   ${EVENT_SRC_DIR}
   ${EVENT_BLD_DIR}
@@ -254,6 +257,7 @@
 SET(ALL_LIB_DIRS
   ${TOOLS_BLD_DIR}
   ${ANALYZE_BLD_DIR}
+  ${CLASSIFICATION_BLD_DIR}
   ${CPU_BLD_DIR}
   ${EVENT_BLD_DIR}
   ${MAIN_BLD_DIR}

Modified: development/source/CMakeLists.txt
===================================================================
--- development/source/CMakeLists.txt	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/CMakeLists.txt	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,5 +1,5 @@
 
-SUBDIRS(analyze cpu event main third-party tools support utils/task_events)
+SUBDIRS(analyze classification cpu event main third-party tools support utils/task_events)
 IF(AVD_GUI_NCURSES)
   SUBDIRS(viewer)
 ENDIF(AVD_GUI_NCURSES)

Modified: development/source/analyze/cAnalyze.cc
===================================================================
--- development/source/analyze/cAnalyze.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/analyze/cAnalyze.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1438,7 +1438,7 @@
   if (verbose >= nAnalyze::VERBOSE_ON) cout << "Printing batch " << cur_batch << endl;
   else cout << "Printing organisms..." << endl;
   
-  cString directory = PopDirectory(cur_string, "genebank/");
+  cString directory = PopDirectory(cur_string, "archive/");
   
   tListIterator<cAnalyzeGenotype> batch_it(batch[cur_batch].List());
   cAnalyzeGenotype * genotype = NULL;
@@ -1466,7 +1466,7 @@
   int words = cur_string.CountNumWords();
   
   cString dir = cur_string.PopWord();
-  cString defaultDirectory = "genebank/";
+  cString defaultDirectory = "archive/";
   cString directory = PopDirectory(dir, defaultDirectory);
   
   int useResources = 0;
@@ -3662,7 +3662,7 @@
       exit(1);
     }
     // Add mapping to located instruction. 
-    ko_inst_set.Add2(lib_null_inst.GetOp());
+    ko_inst_set.AddInst(lib_null_inst.GetOp());
   }
   const cInstruction null_inst = ko_inst_set.GetInst("NULL");
   
@@ -4032,7 +4032,7 @@
         exit(1);
       }
       // Add mapping to located instruction. 
-      map_inst_set.Add2(inst_lib_null_inst.GetOp());
+      map_inst_set.AddInst(inst_lib_null_inst.GetOp());
     }
     const cInstruction null_inst = map_inst_set.GetInst("NULL");
     
@@ -4289,7 +4289,7 @@
             exit(1);
           }
           // Add mapping to located instruction. 
-          map_inst_set.Add2(inst_lib_null_inst.GetOp());
+          map_inst_set.AddInst(inst_lib_null_inst.GetOp());
         }
         const cInstruction null_inst = map_inst_set.GetInst("NULL");
         
@@ -4600,7 +4600,7 @@
         exit(1);
       }
       // Add mapping to located instruction. 
-      map_inst_set.Add2(inst_lib_null_inst.GetOp());
+      map_inst_set.AddInst(inst_lib_null_inst.GetOp());
     }
     const cInstruction null_inst = map_inst_set.GetInst("NULL");
     
@@ -5321,7 +5321,7 @@
   // Start up again at update zero...
   fp << "0 ";
   
-  // Setup the genebank sizes of lists to all be zero.
+  // Setup the archive sizes of lists to all be zero.
   fp << MAX_CREATURE_SIZE << " ";
   for (int i = 0; i < MAX_CREATURE_SIZE; i++) {
     fp << "0 ";

Modified: development/source/analyze/cAnalyzeGenotype.cc
===================================================================
--- development/source/analyze/cAnalyzeGenotype.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/analyze/cAnalyzeGenotype.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -197,7 +197,7 @@
       exit(1);
     }
     // Add mapping to located instruction. 
-    ko_inst_set.Add2(lib_null_inst.GetOp());
+    ko_inst_set.AddInst(lib_null_inst.GetOp());
   }
   const cInstruction null_inst = ko_inst_set.GetInst("NULL");
   
@@ -321,7 +321,7 @@
   test_info.TestThreads();
   // test_info.TraceTaskOrder();
 
-  // DDD - This does some 'interesting' things with the instruction set
+  // @DMB - This does some 'interesting' things with the instruction set
   
   // Use the inst lib for this genotype... and syncrhonize environment
   

Modified: development/source/analyze/cAnalyzeUtil.cc
===================================================================
--- development/source/analyze/cAnalyzeUtil.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/analyze/cAnalyzeUtil.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -9,7 +9,7 @@
 
 #include "defs.h"
 #include "cEnvironment.h"
-#include "cGenebank.h"
+#include "cClassificationManager.h"
 #include "cGenome.h"
 #include "cGenomeUtil.h"
 #include "cGenotype.h"
@@ -187,18 +187,17 @@
 
 void cAnalyzeUtil::CalcConsensus(cWorld* world, int lines_saved)
 {
-  cPopulation* population = &world->GetPopulation();
   const int num_inst = world->GetHardwareManager().GetInstSet().GetSize();
   const int update = world->GetStats().GetUpdate();
-  cGenebank & genebank = population->GetGenebank();
+  cClassificationManager& classmgr = world->GetClassificationManager();
   
   // Setup the histogtams...
   cHistogram * inst_hist = new cHistogram[MAX_CREATURE_SIZE];
   for (int i = 0; i < MAX_CREATURE_SIZE; i++) inst_hist[i].Resize(num_inst,-1);
   
   // Loop through all of the genotypes adding them to the histograms.
-  cGenotype * cur_genotype = genebank.GetBestGenotype();
-  for (int i = 0; i < genebank.GetSize(); i++) {
+  cGenotype * cur_genotype = classmgr.GetBestGenotype();
+  for (int i = 0; i < classmgr.GetGenotypeCount(); i++) {
     const int num_organisms = cur_genotype->GetNumOrganisms();
     const int length = cur_genotype->GetLength();
     const cGenome & genome = cur_genotype->GetGenome();
@@ -265,9 +264,9 @@
   // --- Study the consensus genome ---
   
   // Loop through genotypes again, and determine the average genetic distance.
-  cur_genotype = genebank.GetBestGenotype();
+  cur_genotype = classmgr.GetBestGenotype();
   cDoubleSum distance_sum;
-  for (int i = 0; i < genebank.GetSize(); i++) {
+  for (int i = 0; i < classmgr.GetGenotypeCount(); i++) {
     const int num_organisms = cur_genotype->GetNumOrganisms();
     const int cur_dist =
       cGenomeUtil::FindEditDistance(con_genome, cur_genotype->GetGenome());
@@ -278,16 +277,16 @@
   }
   
   // Finally, gather last bits of data and print the results.
-  cGenotype * con_genotype = genebank.FindGenotype(con_genome, -1);
+  cGenotype * con_genotype = classmgr.FindGenotype(con_genome, -1);
   const int best_dist = cGenomeUtil::FindEditDistance(con_genome,
-                                                      genebank.GetBestGenotype()->GetGenome());
+                                                      classmgr.GetBestGenotype()->GetGenome());
   
   const double ave_dist = distance_sum.Average();
   const double var_dist = distance_sum.Variance();
   const double complexity_base = (double) con_genome.GetSize() - total_entropy;
   
   cString con_name;
-  con_name.Set("genebank/%03d-consensus-u%i.gen", con_genome.GetSize(),update);
+  con_name.Set("classmgr/%03d-consensus-u%i.gen", con_genome.GetSize(),update);
   cTestUtil::PrintGenome(world, con_genome, con_name());
   
   
@@ -406,7 +405,7 @@
     else fp << endl;
     if ( save_genotype ){
       char filename[40];
-      sprintf( filename, "genebank/%s", creature_name() );
+      sprintf( filename, "classmgr/%s", creature_name() );
       cTestUtil::PrintGenome(world, genome, filename);
     }
   }
@@ -428,7 +427,7 @@
  * @param histo_testCPU_fp A stream into which the fitness histogram as
  * determined exclusively from the test-CPU should be written.
  * @param save_max_f_genotype A bool that determines whether the genotype
- * with the maximum fitness should be saved into the genebank.
+ * with the maximum fitness should be saved into the classmgr.
  * @param print_fitness_histo A bool that determines whether fitness
  * histograms should be written.
  * @param hist_fmax The maximum fitness value to be taken into account
@@ -524,7 +523,7 @@
   
   if (save_max_f_genotype) {
     char filename[40];
-    sprintf( filename, "genebank/%s", max_f_name() );
+    sprintf( filename, "classmgr/%s", max_f_name() );
     cTestUtil::PrintGenome(world, max_f_genotype->GetGenome(), filename);
   }
   
@@ -562,13 +561,12 @@
  * @param fp The stream into which the data should be saved.
  * @param reference_genome The reference genome.
  * @param save_creatures A bool that indicates whether creatures should be
- * saved into the genebank or not.
+ * saved into the classmgr or not.
  **/
 
 void cAnalyzeUtil::PrintGeneticDistanceData(cWorld* world, ofstream& fp,
                                             const char * creature_name)
 {
-  cPopulation* pop = &world->GetPopulation();
   double hamming_m1 = 0;
   double hamming_m2 = 0;
   int count = 0;
@@ -578,14 +576,14 @@
   cGenome reference_genome(cInstUtil::LoadGenome(creature_name, world->GetHardwareManager().GetInstSet()));
   
   // get the info for the dominant genotype
-  cGenotype * cur_genotype = pop->GetGenebank().GetBestGenotype();
+  cGenotype * cur_genotype = world->GetClassificationManager().GetBestGenotype();
   cGenome genome = cur_genotype->GetGenome();
   dom_dist = cGenomeUtil::FindHammingDistance( reference_genome, genome );
   hamming_m1 += dom_dist;
   hamming_m2 += dom_dist*dom_dist;
   count += cur_genotype->GetNumOrganisms();
   // now cycle over the remaining genotypes
-  for (int i = 1; i < pop->GetGenebank().GetSize(); i++) {
+  for (int i = 1; i < world->GetClassificationManager().GetGenotypeCount(); i++) {
     cur_genotype = cur_genotype->GetNext();
     cGenome genome = cur_genotype->GetGenome();
     
@@ -603,7 +601,7 @@
     << sqrt( ( hamming_m2 - hamming_m1*hamming_m1 ) / (double) count )
     << " "  // std. error
     << cGenomeUtil::FindHammingDistance( reference_genome,
-                                         pop->GetGenebank().GetBestGenotype()->GetGenome() ) << " "
+                                         world->GetClassificationManager().GetBestGenotype()->GetGenome() ) << " "
     << endl;
 }
 
@@ -617,13 +615,12 @@
  * @param fp The stream into which the data should be saved.
  * @param reference_genome The reference genome.
  * @param save_creatures A bool that indicates whether creatures should be
- * saved into the genebank or not.
+ * saved into the classmgr or not.
  **/
 
 void cAnalyzeUtil::GeneticDistancePopDump(cWorld* world, ofstream& fp,
                                           const char * creature_name, bool save_creatures)
 {
-  cPopulation* pop = &world->GetPopulation();
   double sum_fitness = 0;
   int sum_num_organisms = 0;
   
@@ -635,8 +632,8 @@
   fp << "# reference genome is the START_CREATURE" << endl;
   
   // cycle over all genotypes
-  cGenotype * cur_genotype = pop->GetGenebank().GetBestGenotype();
-  for (int i = 0; i < pop->GetGenebank().GetSize(); i++) {
+  cGenotype * cur_genotype = world->GetClassificationManager().GetBestGenotype();
+  for (int i = 0; i < world->GetClassificationManager().GetGenotypeCount(); i++) {
     const cGenome & genome = cur_genotype->GetGenome();
     const int num_orgs = cur_genotype->GetNumOrganisms();
     
@@ -653,10 +650,10 @@
       << genome.AsString()()             << " "  // 6 genome
       << endl;
     
-    // save into genebank
+    // save into classmgr
     if (save_creatures) {
       char filename[40];
-      sprintf( filename, "genebank/%s", cur_genotype->GetName()() );
+      sprintf( filename, "classmgr/%s", cur_genotype->GetName()() );
       cTestUtil::PrintGenome(world, genome, filename);
     }
     
@@ -766,7 +763,7 @@
   const int num_tasks = world->GetNumTasks();
   cPopulation* pop = &world->GetPopulation();
   
-  static vector<int> tasks(num_tasks);
+  vector<int> tasks(num_tasks);
   vector<int>::iterator it;
   
   // clear task vector
@@ -788,11 +785,11 @@
 }
 
 
-void cAnalyzeUtil::PrintTreeDepths(cPopulation * pop, ofstream& fp)
+void cAnalyzeUtil::PrintTreeDepths(cWorld* world, ofstream& fp)
 {
   // cycle over all genotypes
-  cGenotype * genotype = pop->GetGenebank().GetBestGenotype();
-  for (int i = 0; i < pop->GetGenebank().GetSize(); i++) {
+  cGenotype* genotype = world->GetClassificationManager().GetBestGenotype();
+  for (int i = 0; i < world->GetClassificationManager().GetGenotypeCount(); i++) {
     fp << genotype->GetID() << " "             // 1
     << genotype->GetTestFitness() << " "    // 2
     << genotype->GetNumOrganisms() << " "   // 3
@@ -807,7 +804,6 @@
 
 void cAnalyzeUtil::PrintDepthHistogram(cWorld* world, ofstream& fp)
 {
-  cPopulation* pop = &world->GetPopulation();
   // Output format:    update  min  max  histogram_values...
   int min = INT_MAX;
   int max = 0;
@@ -816,9 +812,9 @@
   // Two pass method
   
   // Loop through all genotypes getting min and max values
-  cGenebank & genebank = pop->GetGenebank();
-  cGenotype * cur_genotype = genebank.GetBestGenotype();
-  for (int i = 0; i < genebank.GetSize(); i++) {
+  cClassificationManager& classmgr = world->GetClassificationManager();
+  cGenotype * cur_genotype = classmgr.GetBestGenotype();
+  for (int i = 0; i < classmgr.GetGenotypeCount(); i++) {
     if (cur_genotype->GetDepth() < min) min = cur_genotype->GetDepth();
     if (cur_genotype->GetDepth() > max) max = cur_genotype->GetDepth();
     cur_genotype = cur_genotype->GetNext();
@@ -830,8 +826,8 @@
   for (int i = 0; i < max - min + 1; i++) n[i] = 0;
   
   // Loop through all genotypes binning the values
-  cur_genotype = genebank.GetBestGenotype();
-  for (int i = 0; i < genebank.GetSize(); i++) {
+  cur_genotype = classmgr.GetBestGenotype();
+  for (int i = 0; i < classmgr.GetGenotypeCount(); i++) {
     n[cur_genotype->GetDepth() - min] += cur_genotype->GetNumOrganisms();
     cur_genotype = cur_genotype->GetNext();
   }
@@ -848,16 +844,15 @@
 
 void cAnalyzeUtil::PrintGenotypeAbundanceHistogram(cWorld* world, ofstream& fp)
 {
-  cPopulation* pop = &world->GetPopulation();
   assert(fp.good());
   
   // Allocate array for the histogram & zero it
-  tArray <int> hist(pop->GetGenebank().GetBestGenotype()->GetNumOrganisms());
+  tArray <int> hist(world->GetClassificationManager().GetBestGenotype()->GetNumOrganisms());
   for (int i = 0; i < hist.GetSize(); i++) hist[i] = 0;
   
   // Loop through all genotypes binning the values
-  cGenotype * cur_genotype = pop->GetGenebank().GetBestGenotype();
-  for (int i = 0; i < pop->GetGenebank().GetSize(); i++) {
+  cGenotype * cur_genotype = world->GetClassificationManager().GetBestGenotype();
+  for (int i = 0; i < world->GetClassificationManager().GetGenotypeCount(); i++) {
     assert( cur_genotype->GetNumOrganisms() - 1 >= 0 );
     assert( cur_genotype->GetNumOrganisms() - 1 < hist.GetSize() );
     hist[cur_genotype->GetNumOrganisms() - 1]++;
@@ -873,14 +868,13 @@
 
 void cAnalyzeUtil::PrintSpeciesAbundanceHistogram(cWorld* world, ofstream& fp)
 {
-  cPopulation* pop = &world->GetPopulation();
   int max = 0;
   assert(fp.good());
   
   // Find max species abundance...
-  cGenebank & genebank = pop->GetGenebank();
-  cSpecies * cur_species = genebank.GetFirstSpecies();
-  for (int i = 0; i < genebank.GetNumSpecies(); i++) {
+  cClassificationManager& classmgr = world->GetClassificationManager();
+  cSpecies * cur_species = classmgr.GetFirstSpecies();
+  for (int i = 0; i < classmgr.GetNumSpecies(); i++) {
     if (max < cur_species->GetNumOrganisms()) {
       max = cur_species->GetNumOrganisms();
     }
@@ -892,8 +886,8 @@
   for (int i = 0; i < hist.GetSize(); i++)  hist[i] = 0;
   
   // Loop through all species binning the values
-  cur_species = genebank.GetFirstSpecies();
-  for (int i = 0; i < genebank.GetNumSpecies(); i++) {
+  cur_species = classmgr.GetFirstSpecies();
+  for (int i = 0; i < classmgr.GetNumSpecies(); i++) {
     assert( cur_species->GetNumOrganisms() - 1 >= 0 );
     assert( cur_species->GetNumOrganisms() - 1 < hist.GetSize() );
     hist[cur_species->GetNumOrganisms() -1]++;

Modified: development/source/analyze/cAnalyzeUtil.h
===================================================================
--- development/source/analyze/cAnalyzeUtil.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/analyze/cAnalyzeUtil.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -60,7 +60,7 @@
   static void TaskSnapshot(cWorld* world, std::ofstream& fp);
   static void TaskGrid(cWorld* world, std::ofstream& fp);
   static void PrintViableTasksData(cWorld* world, std::ofstream& fp);
-  static void PrintTreeDepths(cPopulation * pop, std::ofstream& fp);
+  static void PrintTreeDepths(cWorld* world, std::ofstream& fp);
 
   static void PrintDepthHistogram(cWorld* world, std::ofstream& fp);
   static void PrintGenotypeAbundanceHistogram(cWorld* world, std::ofstream& fp);

Copied: development/source/analyze/cGenotypeBatch.h (from rev 392, development/source/main/cGenotypeBatch.h)

Added: development/source/classification/cClassificationManager.cc
===================================================================
--- development/source/classification/cClassificationManager.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/classification/cClassificationManager.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,1367 @@
+/*
+ *  cClassificationManager.cc
+ *  Avida
+ *
+ *  Created by David on 11/14/05.
+ *  Copyright 2005 Michigan State University. All rights reserved.
+ *  Copyright 1993-2003 California Institute of Technology.
+ *
+ */
+
+#include "cClassificationManager.h"
+
+#include "cDataFile.h"
+#include "cGenome.h"
+#include "cGenotype.h"
+#include "cInjectGenotype.h"
+#include "cLineage.h"
+#include "cOrganism.h"
+#include "cSpecies.h"
+#include "cStats.h"
+#include "cStringList.h"
+#include "cTestUtil.h"
+#include "cWorld.h"
+
+using namespace std;
+
+cClassificationManager::cClassificationManager(cWorld* world)
+  : m_world(world)
+  , m_genotype_ctl(new cGenotypeControl(world))
+  , m_genotype_next_id(1)
+  , m_genotype_dom_time(0)
+  , m_genotype_prev_dom(-1)
+  , m_species_ctl(new cSpeciesControl(world))
+  , m_species_next_id(0)
+  , m_inject_ctl(new cInjectGenotypeControl(world))
+  , m_inject_next_id(1)
+  , m_inject_dom_time(0)
+  , m_inject_prev_dom(-1)
+  , m_best_lineage(NULL)
+  , m_max_fitness_lineage(NULL)
+  , m_dominant_lineage(NULL)
+  , m_lineage_next_id(0)
+{
+  for (int i = 0; i < MAX_CREATURE_SIZE; i++) {
+    m_genotype_count[i] = 0;
+    m_inject_count[i] = 0;
+  }
+}
+
+cClassificationManager::~cClassificationManager()
+{
+  delete m_genotype_ctl;
+  delete m_species_ctl;
+  delete m_inject_ctl;
+}
+
+void cClassificationManager::UpdateReset()
+{
+  cGenotype* best_genotype = GetBestGenotype();
+  
+  m_species_ctl->Purge(m_world->GetStats());
+  if (best_genotype && best_genotype->GetID() != m_genotype_prev_dom) {
+    m_genotype_dom_time = 0;
+    m_genotype_prev_dom = best_genotype->GetID();
+  }
+  else {
+    m_genotype_dom_time++;
+    if (m_genotype_dom_time == m_world->GetConfig().GENOTYPE_PRINT_DOM.Get()) {
+      cString filename;
+      filename.Set("archive/%s", best_genotype->GetName()());
+      cTestUtil::PrintGenome(m_world, best_genotype->GetGenome(), 
+                             filename, best_genotype, m_world->GetStats().GetUpdate());
+    }
+  }
+  
+
+  cInjectGenotype* best_inject_genotype = GetBestInjectGenotype();
+  
+  if (best_inject_genotype && best_inject_genotype->GetID() != m_inject_prev_dom) {
+    m_inject_dom_time = 0;
+    m_inject_prev_dom = best_inject_genotype->GetID();
+  }
+  else {
+    m_inject_dom_time++;
+    if (m_inject_dom_time == m_world->GetConfig().GENOTYPE_PRINT_DOM.Get()) {
+      cString filename;
+      filename.Set("archive/%s", best_inject_genotype->GetName()());
+      cTestUtil::PrintGenome(m_world, best_inject_genotype, best_inject_genotype->GetGenome(), 
+                             filename, m_world->GetStats().GetUpdate());
+    }
+  }
+}
+
+void cClassificationManager::AddGenotype(cGenotype* in_genotype, int list_num)
+{
+  assert( in_genotype != 0 );
+  
+  if (list_num < 0) list_num = FindCRC(in_genotype->GetGenome());
+  
+  m_active_genotypes[list_num].Push(in_genotype);
+  m_genotype_ctl->Insert(*in_genotype);
+  m_world->GetStats().AddGenotype();
+  
+  // Speciation... If we are creating a new genotype here, we must
+  // initilize it to the species of its parent genotype.
+  
+  cSpecies* parent_species = NULL;
+  if ( in_genotype->GetParentGenotype() != NULL) {
+    parent_species = in_genotype->GetParentGenotype()->GetSpecies();
+  }
+  
+  in_genotype->SetSpecies(parent_species);
+  if (parent_species != NULL) parent_species->AddGenotype();
+}
+
+
+// Add a new genotype to the archive.  Take in parent genotypes to track
+// phylogenies (the second genotype is in the case of sexual organisms)
+cGenotype* cClassificationManager::GetGenotype(const cGenome& in_genome, cGenotype* parent1, cGenotype* parent2)
+{
+  // Make sure we dont have a NULL parent -- if we do, we should be calling
+  // GetGenotypeInjected().
+  // @DMB - cPopulation::ActivateOrganism calls this with NULL,NULL...   not sure if this is correct.
+  //assert (parent1 != NULL);
+  
+  int list_num = FindCRC(in_genome);
+  cGenotype* found_genotype = FindGenotype(in_genome, parent1->GetLineageLabel(), list_num);
+  
+  if (!found_genotype) {
+    found_genotype = new cGenotype(m_world, m_world->GetStats().GetUpdate(), m_genotype_next_id++);
+    found_genotype->SetGenome(in_genome);
+    found_genotype->SetParent(parent1, parent2);    
+    AddGenotype(found_genotype, list_num);
+  }
+  
+  return found_genotype;
+}
+
+
+// Add a new genotype that has been injected from the outside to the archive.
+//  Take in a lineage label to track clades.
+cGenotype* cClassificationManager::GetGenotypeInjected(const cGenome& in_genome, int lineage_label)
+{
+  int list_num = FindCRC(in_genome);
+  cGenotype* found_genotype = FindGenotype(in_genome, lineage_label, list_num);
+  
+  if (!found_genotype) {
+    found_genotype = new cGenotype(m_world, m_world->GetStats().GetUpdate(), m_genotype_next_id++);
+    found_genotype->SetGenome(in_genome);
+    found_genotype->SetParent(NULL, NULL);
+    found_genotype->SetLineageLabel(lineage_label);
+    AddGenotype(found_genotype, list_num);
+  }
+  
+  return found_genotype;
+}
+
+// Add a new genotype that has been injected from the outside to the archive.
+//  Take in a lineage label to track clades.
+cGenotype* cClassificationManager::GetGenotypeLoaded(const cGenome& in_genome, int update_born, int id_num)
+{
+  if (id_num >= 0) m_genotype_next_id = id_num;
+
+  cGenotype* genotype = new cGenotype(m_world, update_born, m_genotype_next_id++);
+  genotype->SetGenome(in_genome);
+  genotype->SetParent(NULL, NULL);
+  AddGenotype(genotype);
+  
+  return genotype;
+}
+
+const cGenotype* cClassificationManager::FindGenotype(const cGenome & in_genome,
+                                          int lineage_label, int list_num) const
+{
+  if (list_num < 0) list_num = FindCRC(in_genome);
+  
+  tConstListIterator<cGenotype> list_it(m_active_genotypes[list_num]);
+  
+  // If the lineage label is -1, match any lineage...
+  if (lineage_label == -1) {
+    while (list_it.Next() != NULL) {
+      if (list_it.GetConst()->GetGenome() == in_genome) break;
+    }
+  }
+  
+  // Otherwise, only match a genotype of the same lineage.
+  else {
+    while (list_it.Next() != NULL) {
+      if (list_it.GetConst()->GetGenome() == in_genome &&
+          list_it.GetConst()->GetLineageLabel() == lineage_label) break;
+    }
+  }
+  
+  return list_it.GetConst();
+}
+
+cGenotype* cClassificationManager::FindGenotype(const cGenome & in_genome,
+                                    int lineage_label, int list_num)
+{
+  if (list_num < 0) list_num = FindCRC(in_genome);
+  
+  tListIterator<cGenotype> list_it(m_active_genotypes[list_num]);
+  // If the lineage label is -1, match any lineage...
+  if (lineage_label == -1) {
+    while (list_it.Next() != NULL) {
+      if (list_it.Get()->GetGenome() == in_genome) break;
+    }
+  }
+  
+  // Otherwise, only match a genotype of the same lineage.
+  else {
+    while (list_it.Next() != NULL) {
+      if (list_it.Get()->GetGenome() == in_genome &&
+          list_it.Get()->GetLineageLabel() == lineage_label) break;
+    }
+  }
+  return list_it.Get();
+}
+
+void cClassificationManager::RemoveGenotype(cGenotype & in_genotype)
+{
+  // If we are supposed to defer analysis of this genotype, do so...
+  if (in_genotype.GetDeferAdjust() == true) return;
+  
+  // If this genotype is still active, mark it no longer active and
+  // take it out of the hash table so it doesn't have any new organisms
+  // assigned to it.
+  
+  if (in_genotype.GetActive() == true) {
+    int list_num = FindCRC(in_genotype.GetGenome());
+    m_active_genotypes[list_num].Remove(&in_genotype);
+    m_genotype_ctl->Remove(in_genotype);
+    in_genotype.Deactivate(m_world->GetStats().GetUpdate());
+    if (m_world->GetConfig().TRACK_MAIN_LINEAGE.Get()) {
+      m_genotype_ctl->InsertHistoric(in_genotype);
+    }
+  }
+  
+  // If we are tracking the main lineage, we only want to delete a
+  // genotype when all of its decendents have also died out.
+  
+  const int lineage_type = m_world->GetConfig().TRACK_MAIN_LINEAGE.Get();
+  if (lineage_type > 0) {
+    // If  there are more offspring genotypes, hold off on deletion...
+    if (in_genotype.GetNumOffspringGenotypes() != 0) return;
+    
+    // If this is a dead end, delete it and recurse up...
+    cGenotype * parent = in_genotype.GetParentGenotype();
+    cGenotype * parent2 = in_genotype.GetParent2Genotype();
+    
+    if (parent != NULL) {
+      parent->RemoveOffspringGenotype();
+      
+      // Test to see if we need to update the coalescent genotype.
+      const int new_coal = m_genotype_ctl->UpdateCoalescent();
+      m_world->GetStats().SetCoalescentGenotypeDepth(new_coal);
+      // cout << "Set coalescent to " << found_gen->GetDepth() << endl;
+      
+      if (parent->GetNumOrganisms() == 0) {
+        // Regardless, run RemoveGenotype on the parent.
+        RemoveGenotype(*parent);
+      }
+    }
+    
+    if (lineage_type == 2 && parent2 != NULL) {
+      parent2->RemoveOffspringGenotype();
+      
+      // Test to see if we need to update the coalescent genotype.
+      const int new_coal = m_genotype_ctl->UpdateCoalescent();
+      m_world->GetStats().SetCoalescentGenotypeDepth(new_coal);
+      // cout << "Set coalescent to " << found_gen->GetDepth() << endl;
+      
+      if (parent2->GetNumOrganisms() == 0) {
+        // Regardless, run RemoveGenotype on the parent.
+        RemoveGenotype(*parent2);
+      }
+    }
+    
+    m_genotype_ctl->RemoveHistoric(in_genotype);
+  }
+  
+  // Handle the relevent statistics...
+  m_world->GetStats().RemoveGenotype(in_genotype.GetID(),
+                                     in_genotype.GetParentID(), in_genotype.GetParentDistance(),
+                                     in_genotype.GetDepth(), in_genotype.GetTotalOrganisms(),
+                                     in_genotype.GetTotalParasites(),
+                                     m_world->GetStats().GetUpdate() - in_genotype.GetUpdateBorn(),
+                                     in_genotype.GetLength());
+  if (in_genotype.GetThreshold()) {
+    m_world->GetStats().RemoveThreshold(in_genotype.GetID());
+  }
+  
+  
+  // Speciation...  If a Threshold genotype was removed, the position of this
+  // species in the active list will at least shift, and it is possible that
+  // the species is made inactive, or removed all-togeather.  If it is a non-
+  // threshold genotype, then the species will only be effected if this was
+  // the last genotype of that species.
+  
+  cSpecies * cur_species = in_genotype.GetSpecies();
+  if (cur_species) {
+    
+    // First, re-adjust the species.
+    
+    cur_species->RemoveGenotype();
+    
+    // Then, check to see how this species changes if it is a threshold.
+    
+    if (in_genotype.GetThreshold()) {
+      cur_species->RemoveThreshold(in_genotype);
+      
+      // If we are out of thresholds, move this species to the inactive
+      // list for now.  Otherwise, just adjust it.
+      
+      if (cur_species->GetNumThreshold() == 0) {
+        m_species_ctl->SetInactive(*cur_species);
+      }
+      else {
+        m_species_ctl->Adjust(*cur_species);
+      }
+    }
+    
+    // Finally, remove the species completely if it has no genotypes left.
+    
+    if (!cur_species->GetNumGenotypes()) {
+      m_species_ctl->SetGarbage(*cur_species);
+    }
+  }
+  
+  
+  delete &in_genotype;
+}
+
+void cClassificationManager::ThresholdGenotype(cGenotype & in_genotype)
+{
+  cSpecies * found_species = NULL;
+  
+  in_genotype.SetName( GetLabel(in_genotype.GetLength(), m_genotype_count[in_genotype.GetLength()]++) );
+  in_genotype.SetThreshold();
+  
+  // If speciation is on, assign a species to the genotype now that it is
+  // threshold.
+  
+  if (m_world->GetConfig().SPECIES_RECORDING.Get()) {
+    // Record the old species to know if it changes.
+    cSpecies * old_species = in_genotype.GetSpecies();
+    
+    // Determine the "proper" species.
+    found_species = m_species_ctl->Find(in_genotype,
+                                          m_world->GetConfig().SPECIES_RECORDING.Get());
+    
+    // If no species was found, create a new one.
+    if (!found_species) {
+      found_species = new cSpecies(m_world, in_genotype.GetGenome(), m_world->GetStats().GetUpdate(), m_species_next_id++);
+      if (in_genotype.GetSpecies())
+        found_species->SetParentID(in_genotype.GetSpecies()->GetID());
+      m_species_ctl->SetActive(*found_species);
+      m_world->GetStats().AddSpecies(found_species->GetID());
+      
+      // Since this is a new species, see if we should be printing it.
+      
+      if (m_world->GetConfig().SPECIES_PRINT.Get()) {
+        cString filename;
+        filename.Set("archive/spec-%04d", found_species->GetID());
+        cTestUtil::PrintGenome(m_world, in_genotype.GetGenome(), filename,
+                               &in_genotype, m_world->GetStats().GetUpdate());
+      }
+    } else {
+      // If we are not creating a new species, but are adding a threshold
+      // to one which is currently in-active, make sure to move it back to
+      // the active list.
+      
+      if (found_species->GetNumThreshold() == 0) {
+        m_species_ctl->SetActive(*found_species);
+      }
+    }
+    
+    // Now that we know for sure what the species is, and that it is in
+    // the proper list, setup both the species and the genotype.
+    
+    in_genotype.SetSpecies(found_species);
+    found_species->AddThreshold(in_genotype);
+    
+    // Finally test to see if the species has been changed, and adjust
+    // accordingly.
+    
+    if (found_species != old_species) {
+      found_species->AddGenotype();
+      if (old_species) {
+        old_species->RemoveGenotype();
+        if (old_species->GetNumGenotypes() == 0)
+          m_species_ctl->SetGarbage(*old_species);
+      }
+    }
+    else {
+      if (found_species->GetNumThreshold() > 1) {
+        m_species_ctl->Adjust(*found_species);
+      }
+    }
+  }
+  
+  // Do the relevent statistics...
+  if (m_world->GetConfig().SPECIES_RECORDING.Get()) {
+    m_world->GetStats().AddThreshold(in_genotype.GetID(), in_genotype.GetName()(),
+                                     found_species->GetID());
+  } else {
+    m_world->GetStats().AddThreshold(in_genotype.GetID(), in_genotype.GetName()());
+  }
+  
+  // Print the genotype?
+  if (m_world->GetConfig().GENOTYPE_PRINT.Get()) {
+    cString filename;
+    filename.Set("archive/%s", in_genotype.GetName()());
+    cTestUtil::PrintGenome(m_world, in_genotype.GetGenome(), filename,
+                           &in_genotype, m_world->GetStats().GetUpdate());
+  }
+}
+
+bool cClassificationManager::AdjustGenotype(cGenotype & in_genotype)
+{
+  if (!m_genotype_ctl->Adjust(in_genotype)) return false;
+  
+  if ((in_genotype.GetNumOrganisms() >= m_world->GetConfig().THRESHOLD.Get() ||
+       &in_genotype == m_genotype_ctl->GetBest()) &&
+      !(in_genotype.GetThreshold())) {
+    ThresholdGenotype(in_genotype);
+  }
+  
+  return true;
+}
+
+bool cClassificationManager::SaveClone(ofstream& fp)
+{
+  // This method just save the counts at each size-class of genotypes.
+  // The rest is reconstructable.
+  
+  // Save the numbers of organisms we're up to at each size.
+  fp << MAX_CREATURE_SIZE << " ";
+  for (int i = 0; i < MAX_CREATURE_SIZE; i++) {
+    fp << m_genotype_count[i] << " ";
+  }
+  
+  // Save the numbers of organisms we're up to at each size.
+  fp << MAX_CREATURE_SIZE << " ";
+  for (int i = 0; i < MAX_CREATURE_SIZE; i++) {
+    fp << m_inject_count[i] << " ";
+  }
+  return true;
+}
+
+bool cClassificationManager::LoadClone(ifstream & fp)
+{
+  // This method just restores the counts at each size-class of genotypes.
+  // The rest of the loading process should be handled elsewhere.
+  
+  // Load the numbers of organisms we're up to at each size.
+  int max_size;
+  fp >> max_size;
+  assert (max_size <= MAX_CREATURE_SIZE); // MAX_CREATURE_SIZE too small
+  for (int i = 0; i < max_size && i < MAX_CREATURE_SIZE; i++) {
+    fp >> m_genotype_count[i];
+  }
+  
+  fp >> max_size;
+  assert (max_size <= MAX_CREATURE_SIZE); // MAX_CREATURE_SIZE too small
+  for (int i = 0; i < max_size && i < MAX_CREATURE_SIZE; i++) {
+    fp >> m_inject_count[i];
+  }
+
+  return true;
+}
+
+bool cClassificationManager::DumpTextSummary(ofstream& fp)
+{
+  m_genotype_ctl->Reset(0);
+  for (int i = 0; i < m_genotype_ctl->GetSize(); i++) {
+    cGenotype * genotype = m_genotype_ctl->Get(0);
+    fp << genotype->GetGenome().AsString() << " "
+      << genotype->GetNumOrganisms() << " "
+      << genotype->GetID() << endl;
+    m_genotype_ctl->Next(0);
+  }
+  
+  return true;
+}
+
+bool cClassificationManager::PrintGenotypes(ofstream& fp, cString & data_fields,
+                               int historic)
+{
+  bool print_id = false;
+  bool print_parent_id = false;
+  bool print_parent2_id = false;
+  bool print_parent_dist = false;
+  bool print_num_cpus = false;
+  bool print_total_cpus = false;
+  bool print_length = false;
+  bool print_merit = false;
+  bool print_gest_time = false;
+  bool print_fitness = false;
+  bool print_update_born = false;
+  bool print_update_dead = false;
+  bool print_depth = false;
+  bool print_lineage = false;
+  bool print_sequence = false;
+  
+  cStringList fields(data_fields, ',');
+  if (fields.HasString("id") == true) print_id = true;
+  if (fields.HasString("parent_id") == true) print_parent_id = true;
+  if (fields.HasString("parent2_id") == true) print_parent2_id = true;
+  if (fields.HasString("parent_dist") == true) print_parent_dist = true;
+  if (fields.HasString("num_cpus") == true) print_num_cpus = true;
+  if (fields.HasString("total_cpus") == true) print_total_cpus = true;
+  if (fields.HasString("length") == true) print_length = true;
+  if (fields.HasString("merit") == true) print_merit = true;
+  if (fields.HasString("gest_time") == true) print_gest_time = true;
+  if (fields.HasString("fitness") == true) print_fitness = true;
+  if (fields.HasString("update_born") == true) print_update_born = true;
+  if (fields.HasString("update_dead") == true) print_update_dead = true;
+  if (fields.HasString("depth") == true) print_depth = true;
+  if (fields.HasString("lineage") == true) print_lineage = true;
+  if (fields.HasString("sequence") == true) print_sequence = true;
+  if (fields.HasString("all") == true) {
+    print_id = print_parent_id = print_parent2_id = print_parent_dist = true;
+    print_num_cpus = print_total_cpus = print_length = print_merit = true;
+    print_gest_time = print_fitness = print_update_born = true;
+    print_update_dead = print_depth = print_lineage = print_sequence = true;
+  }
+  
+  // Print all of the header information...
+  fp << "#filetype genotype_data" << endl
+    << "#format ";
+  
+  if (print_id == true) fp << "id ";
+  if (print_parent_id == true) fp << "parent_id ";
+  if (print_parent2_id == true) fp << "parent2_id ";
+  if (print_parent_dist == true) fp << "parent_dist ";
+  if (print_num_cpus == true) fp << "num_cpus ";
+  if (print_total_cpus == true) fp << "total_cpus ";
+  if (print_length == true) fp << "length ";
+  if (print_merit == true) fp << "merit ";
+  if (print_gest_time == true) fp << "gest_time ";
+  if (print_fitness == true) fp << "fitness ";
+  if (print_update_born == true) fp << "update_born ";
+  if (print_update_dead == true) fp << "update_dead ";
+  if (print_depth == true) fp << "depth ";
+  if (print_lineage == true) fp << "lineage ";
+  if (print_sequence == true) fp << "sequence ";  
+  fp << endl;
+  
+  // Print extra information about what data is in this file...
+  fp << "# Output is genotypes at update " << m_world->GetStats().GetUpdate();
+  if (historic == -1) fp << " including ALL ancestors";
+  else if (historic > 0) fp << " including ancestors for " 
+    << historic << " updates.";
+  fp << endl;
+  
+  // And give some information about what columns are available.
+  int cur_col = 1;
+  if (print_id) fp << "# " << cur_col++ << ": ID" << endl;
+  if (print_parent_id) fp << "# " << cur_col++ << ": parent ID" << endl;
+  if (print_parent2_id) fp << "# " << cur_col++ << ": parent2 ID" << endl;
+  if (print_parent_dist) fp << "# " << cur_col++ << ": parent distance" << endl;
+  if (print_num_cpus) fp << "# " << cur_col++ << ": number of orgranisms currently alive" << endl;
+  if (print_total_cpus) fp << "# " << cur_col++ << ": total number of organisms that ever existed" << endl;
+  if (print_length) fp << "# " << cur_col++ << ": length of genome" << endl;
+  if (print_merit) fp << "# " << cur_col++ << ": merit" << endl;
+  if (print_gest_time) fp << "# " << cur_col++ << ": gestation time" << endl;
+  if (print_fitness) fp << "# " << cur_col++ << ": fitness" << endl;
+  if (print_update_born) fp << "# " << cur_col++ << ": update born" << endl;
+  if (print_update_dead) fp << "# " << cur_col++ << ": update deactivated" << endl;
+  if (print_depth) fp << "# " << cur_col++ << ": depth in phylogentic tree" << endl;
+  if (print_lineage) fp << "# " << cur_col++ << ": lineage label of genotype" << endl;
+  if (print_sequence) fp << "# " << cur_col++ << ": genome of genotype" << endl;
+  fp << endl;
+  
+  // Print the current population....
+  m_genotype_ctl->Reset(0);
+  for (int i = 0; i < m_genotype_ctl->GetSize(); i++) {
+    cGenotype * genotype = m_genotype_ctl->Get(0);
+    
+    if (print_id)          fp << genotype->GetID() << " ";
+    if (print_parent_id)   fp << genotype->GetParentID() << " ";
+    if (print_parent2_id)  fp << genotype->GetAncestorID(1) << " ";
+    if (print_parent_dist) fp << genotype->GetParentDistance() << " ";
+    if (print_num_cpus)    fp << genotype->GetNumOrganisms() << " ";
+    if (print_total_cpus)  fp << genotype->GetTotalOrganisms() << " ";
+    if (print_length)      fp << genotype->GetLength() << " ";
+    if (print_merit)       fp << genotype->GetMerit() << " ";
+    if (print_gest_time)   fp << genotype->GetGestationTime() << " ";
+    if (print_fitness)     fp << genotype->GetFitness() << " ";
+    if (print_update_born) fp << genotype->GetUpdateBorn() << " ";
+    if (print_update_dead) fp << genotype->GetUpdateDeactivated() << " ";
+    if (print_depth)       fp << genotype->GetDepth() << " ";
+    if (print_lineage)     fp << genotype->GetLineageLabel() << " "; 
+    if (print_sequence)    fp << genotype->GetGenome().AsString() << " ";
+    fp << endl;
+    m_genotype_ctl->Next(0);
+  }
+  
+  // Print the historic population if we are supposed to.
+  if (historic == 0) return true;
+  
+  // Start by calculating the update we should start printing from...
+  int start_update = 0;
+  if (historic > 0) start_update = m_world->GetStats().GetUpdate() - historic;
+  
+  // Now loop through the remaining genotypes...
+  m_genotype_ctl->ResetHistoric(0);
+  for (int i = 0; i < m_genotype_ctl->GetHistoricCount(); i++) {
+    // Get the next genotype.  Only print it if its in range...
+    cGenotype * genotype = m_genotype_ctl->Get(0);
+    if (genotype->GetUpdateDeactivated() < start_update) {
+      m_genotype_ctl->Next(0);
+      continue;
+    }
+    
+    if (print_id)          fp << genotype->GetID() << " ";
+    if (print_parent_id)   fp << genotype->GetParentID() << " ";
+    if (print_parent2_id)  fp << genotype->GetAncestorID(1) << " ";
+    if (print_parent_dist) fp << genotype->GetParentDistance() << " ";
+    if (print_num_cpus)    fp << genotype->GetNumOrganisms() << " ";
+    if (print_total_cpus)  fp << genotype->GetTotalOrganisms() << " ";
+    if (print_length)      fp << genotype->GetLength() << " ";
+    if (print_merit)       fp << genotype->GetMerit() << " ";
+    if (print_gest_time)   fp << genotype->GetGestationTime() << " ";
+    if (print_fitness)     fp << genotype->GetFitness() << " ";
+    if (print_update_born) fp << genotype->GetUpdateBorn() << " ";
+    if (print_update_dead) fp << genotype->GetUpdateDeactivated() << " ";
+    if (print_depth)       fp << genotype->GetDepth() << " ";
+    if (print_lineage)     fp << genotype->GetLineageLabel() << " "; 
+    if (print_sequence)    fp << genotype->GetGenome().AsString() << " ";
+    fp << endl;
+    
+    // Move to the next genotype...
+    m_genotype_ctl->Next(0);
+  }
+  
+  
+  return true;
+}
+
+bool cClassificationManager::DumpDetailedSummary(ofstream& fp)
+{
+  m_genotype_ctl->Reset(0);
+  DumpDetailHeading(fp);
+  for (int i = 0; i < m_genotype_ctl->GetSize(); i++) {
+    DumpDetailedEntry(m_genotype_ctl->Get(0), fp);
+    m_genotype_ctl->Next(0);
+  }
+  
+  return true;
+}
+
+bool cClassificationManager::DumpHistoricSummary(ofstream& fp, int back_dist)
+{
+  // Calculate the update we should start printing from...
+  int start_update = 0;
+  if (back_dist > 0) start_update = m_world->GetStats().GetUpdate() - back_dist;
+  
+  // Loop through all defunct genotypes that we're saving.
+  DumpDetailHeading(fp);
+  m_genotype_ctl->ResetHistoric(0);
+  for (int i = 0; i < m_genotype_ctl->GetHistoricCount(); i++) {
+    // Get the next genotype.  Only print it if its in range...
+    cGenotype * cur_genotype = m_genotype_ctl->Get(0);
+    if (cur_genotype->GetUpdateDeactivated() < start_update) {
+      m_genotype_ctl->Next(0);
+      continue;
+    }
+    DumpDetailedEntry(cur_genotype, fp);
+    
+    // Move to the next genotype...
+    m_genotype_ctl->Next(0);
+  }
+  
+  return true;
+}
+
+bool cClassificationManager::DumpDetailedSexSummary(ofstream& fp)
+{
+  m_genotype_ctl->Reset(0);
+  DumpDetailSexHeading(fp);
+  for (int i = 0; i < m_genotype_ctl->GetSize(); i++) {
+    DumpDetailedSexEntry(m_genotype_ctl->Get(0), fp);
+    m_genotype_ctl->Next(0);
+  }
+  
+  return true;
+}
+
+bool cClassificationManager::DumpHistoricSexSummary(ofstream& fp)
+{
+  m_genotype_ctl->ResetHistoric(0);
+  DumpDetailSexHeading(fp);
+  for (int i = 0; i < m_genotype_ctl->GetHistoricCount(); i++) {
+    DumpDetailedSexEntry(m_genotype_ctl->Get(0), fp);
+    m_genotype_ctl->Next(0);
+  }
+  
+  return true;
+}
+
+void cClassificationManager::DumpDetailHeading (ofstream& fp)
+{
+  fp << "#filetype genotype_data" << endl
+  << "#format id parent_id parent_dist num_cpus total_cpus length merit gest_time fitness update_born update_dead depth sequence" << endl
+  << endl
+  << "#  1: ID" << endl
+  << "#  2: parent ID" << endl
+  << "#  3: parent distance" << endl
+  << "#  4: number of orgranisms currently alive" << endl
+  << "#  5: total number of organisms that ever existed" << endl
+  << "#  6: length of genome" << endl
+  << "#  7: merit" << endl
+  << "#  8: gestation time" << endl
+  << "#  9: fitness" << endl
+  << "# 10: update born" << endl
+  << "# 11: update deactivated" << endl
+  << "# 12: depth in phylogentic tree" << endl
+  << "# 13: genome of organism" << endl << endl;
+}
+
+void cClassificationManager::DumpDetailSexHeading (ofstream& fp)
+{
+  fp << "#filetype genotype_data" << endl
+  << "#format id parent_id parent2_id parent_dist num_cpus total_cpus length merit gest_time fitness update_born update_dead depth sequence" << endl
+  << endl
+  << "#  1: ID" << endl
+  << "#  2: parent 1 ID " << endl
+  << "#  3: parent 2 ID" << endl
+  << "#  4: parent 1 distance" << endl
+  << "#  5: number of orgranisms currently alive" << endl
+  << "#  6: total number of organisms that ever existed" << endl
+  << "#  7: length of genome" << endl
+  << "#  8: merit" << endl
+  << "#  9: gestation time" << endl
+  << "# 10: fitness" << endl
+  << "# 11: update born" << endl
+  << "# 12: update deactivated" << endl
+  << "# 13: depth in phylogentic tree" << endl
+  << "# 14: genome of organism" << endl << endl;
+}
+
+void cClassificationManager::DumpDetailedEntry(cGenotype* genotype, ofstream& fp)
+{
+  fp << genotype->GetID() << " "                //  1
+  << genotype->GetParentID() << " "          //  2
+                                             // << genotype->GetAncestorID(1) << " "          //  2b
+  << genotype->GetParentDistance() << " "    //  3
+  << genotype->GetNumOrganisms() << " "      //  4
+  << genotype->GetTotalOrganisms() << " "    //  5
+  << genotype->GetLength() << " "            //  6
+  << genotype->GetMerit() << " "             //  7
+  << genotype->GetGestationTime() << " "     //  8
+  << genotype->GetFitness() << " "           //  9
+  << genotype->GetUpdateBorn() << " "        // 10
+  << genotype->GetUpdateDeactivated() << " " // 11
+  << genotype->GetDepth() << " "             // 12
+  << genotype->GetGenome().AsString() << " " // 13
+  << endl;
+}
+
+void cClassificationManager::DumpDetailedSexEntry(cGenotype * genotype, ofstream& fp)
+{
+  fp << genotype->GetID() << " "                //  1
+  << genotype->GetAncestorID(0) << " "       //  2
+  << genotype->GetAncestorID(1) << " "       //  3
+  << genotype->GetParentDistance() << " "    //  4
+  << genotype->GetNumOrganisms() << " "      //  5
+  << genotype->GetTotalOrganisms() << " "    //  6
+  << genotype->GetLength() << " "            //  7
+  << genotype->GetMerit() << " "             //  8
+  << genotype->GetGestationTime() << " "     //  9
+  << genotype->GetFitness() << " "           // 10
+  << genotype->GetUpdateBorn() << " "        // 11
+  << genotype->GetUpdateDeactivated() << " " // 12
+  << genotype->GetDepth() << " "             // 13
+  << genotype->GetGenome().AsString() << " " // 14
+  << endl;
+}
+
+
+
+void cClassificationManager::AddInjectGenotype(cInjectGenotype* in_inject_genotype, int in_list_num)
+{
+  assert( in_inject_genotype != 0 );
+  
+  if ( in_list_num < 0 )
+    in_list_num = FindCRC(in_inject_genotype->GetGenome()) % nInjectGenotype::HASH_SIZE;
+  
+  m_active_inject[in_list_num].Insert(*in_inject_genotype);
+  m_inject_ctl->Insert(*in_inject_genotype);
+}
+
+
+cInjectGenotype* cClassificationManager::GetInjectGenotype(const cGenome& in_genome, cInjectGenotype* parent_genotype)
+{
+  int list_num = FindCRC(in_genome) % nInjectGenotype::HASH_SIZE;
+  cInjectGenotype * found_genotype;
+  
+  found_genotype = m_active_inject[list_num].Find(in_genome);
+  
+  if (!found_genotype) {
+    found_genotype = new cInjectGenotype(m_world, m_world->GetStats().GetUpdate(), m_inject_next_id++);
+    found_genotype->SetGenome(in_genome);
+    found_genotype->SetParent(parent_genotype);
+    if(parent_genotype!=NULL)
+    {
+      parent_genotype->SetCanReproduce();
+    }
+    AddInjectGenotype( found_genotype, list_num );
+  }
+  return found_genotype;
+}
+
+cInjectGenotype* cClassificationManager::FindInjectGenotype(const cGenome& in_genome) const
+{
+  int list_num = FindCRC(in_genome) % nInjectGenotype::HASH_SIZE;
+  return m_active_inject[list_num].Find(in_genome);
+}
+
+void cClassificationManager::RemoveInjectGenotype(cInjectGenotype& in_inject_genotype)
+{
+  // If this genotype is still active, mark it no longer active and
+  // take it out of the hash table so it doesn't have any new organisms
+  // assigned to it.
+  
+  if (in_inject_genotype.GetActive() == true) {
+    int list_num = FindCRC(in_inject_genotype.GetGenome()) % nInjectGenotype::HASH_SIZE;
+    m_active_inject[list_num].Remove(in_inject_genotype);
+    m_inject_ctl->Remove(in_inject_genotype);
+    //in_inject_genotype.Deactivate(stats.GetUpdate());
+    if (m_world->GetConfig().TRACK_MAIN_LINEAGE.Get()) {
+      m_inject_ctl->InsertHistoric(in_inject_genotype);
+    }
+  }
+  
+  delete &in_inject_genotype;
+}
+
+void cClassificationManager::ThresholdInjectGenotype(cInjectGenotype& in_inject_genotype)
+{
+  in_inject_genotype.SetName( GetLabel(in_inject_genotype.GetLength(),
+                                       m_inject_count[in_inject_genotype.GetLength()]++) );
+  in_inject_genotype.SetThreshold();
+}
+
+bool cClassificationManager::AdjustInjectGenotype(cInjectGenotype& in_inject_genotype)
+{
+  if (!m_inject_ctl->Adjust(in_inject_genotype)) return false;
+  
+  if ((in_inject_genotype.GetNumInjected() >= m_world->GetConfig().THRESHOLD.Get() ||
+       &in_inject_genotype == m_inject_ctl->GetBest()) &&
+      !(in_inject_genotype.GetThreshold())) {
+    ThresholdInjectGenotype(in_inject_genotype);
+  }
+  
+  return true;
+}
+
+bool cClassificationManager::DumpInjectTextSummary(ofstream& fp)
+{
+  m_inject_ctl->Reset(0);
+  for (int i = 0; i < m_inject_ctl->GetSize(); i++) {
+    cInjectGenotype * genotype = m_inject_ctl->Get(0);
+    fp << genotype->GetGenome().AsString() << " "
+      << genotype->GetNumInjected() << " "
+      << genotype->GetID() << endl;
+    m_inject_ctl->Next(0);
+  }
+  
+  return true;
+}
+
+bool cClassificationManager::DumpInjectDetailedSummary(const cString & file, int update)
+{
+  m_inject_ctl->Reset(0);
+  for (int i = 0; i < m_inject_ctl->GetSize(); i++) {
+    DumpInjectDetailedEntry(m_inject_ctl->Get(0), file, update);
+    m_inject_ctl->Next(0);
+  }
+  return true;
+}
+
+void cClassificationManager::DumpInjectDetailedEntry(cInjectGenotype * genotype, const cString & filename, int update)
+{
+  cDataFile & df = m_world->GetDataFile(filename);
+  
+  df.WriteComment( "Avida parasite dump data" );
+  df.WriteTimeStamp();
+  
+  df.Write( genotype->GetID(),                 "parasite genotype ID");
+  df.Write( genotype->GetName(),              "parasite genotype name");
+  df.Write( genotype->GetParentID(),           "parasite parent ID");
+  df.Write( genotype->GetNumInjected(),        "current number of injected creatures with this genotype");
+  df.Write( genotype->GetTotalInjected(),      "total number of injected creatures with this genotype");
+  df.Write( genotype->GetLength(),             "genotype length");
+  df.Write( genotype->GetUpdateBorn(),         "update this genotype was born");
+  df.Write( genotype->CanReproduce(),          "has this genotype reproduced?");
+  df.Write( genotype->GetGenome().AsString(),  "genome of this genotype");
+  df.Endl();
+}
+
+
+cLineage* cClassificationManager::AddLineage(double start_fitness, int parent_lin_id, int id, double lineage_stat1, double lineage_stat2)
+{
+  if (id < 0) id = m_lineage_next_id++;
+  if (id >= m_lineage_next_id) m_lineage_next_id = id + 1;
+  
+  cLineage* new_lineage = new cLineage(start_fitness, parent_lin_id, id,
+                                       m_world->GetStats().GetUpdate(), m_world->GetStats().GetGeneration(), lineage_stat1, lineage_stat2);
+
+  // the best/ dominant lineage are automatically corrected
+  // when a creature is added to this lineage
+  m_lineage_list.push_back(new_lineage);  
+  m_world->GetStats().AddLineage();
+  
+  return new_lineage;
+}
+
+
+void cClassificationManager::UpdateLineages()
+{
+  m_best_lineage = NULL;
+  m_dominant_lineage = NULL;
+  m_max_fitness_lineage = NULL;
+  
+  list<cLineage *>::iterator it = m_lineage_list.begin();
+  list<cLineage *>::iterator del_it;
+  
+  while( it != m_lineage_list.end() ){
+    bool del = false;
+    
+    // mark the lineage for removal if empty
+    if ( (*it)->GetNumCreatures() == 0 ){
+      del_it = it;
+      del = true;
+    }
+    else { // otherwise it is a candidate for the best/ dominant/... lineage
+      if ( !m_best_lineage ||
+           (*it)->GetAveFitness() > m_best_lineage->GetAveFitness() )
+        m_best_lineage = (*it);
+      
+      if ( !m_dominant_lineage ||
+           (*it)->GetNumCreatures() > m_dominant_lineage->GetNumCreatures() )
+        m_dominant_lineage = (*it);
+      
+      if ( !m_max_fitness_lineage ||
+           (*it)->GetMaxFitness() > m_max_fitness_lineage->GetMaxFitness() )
+        m_max_fitness_lineage = (*it);
+      
+    }
+    // proceed to the next lineage
+    it++;
+    
+    // now do the removal if necessary
+    if ( del ){
+      delete (*del_it); // delete the lineage
+      m_lineage_list.erase( del_it ); // and remove its reference
+    }
+  }
+  
+#ifdef DEBUG
+  if ( !m_lineage_list.empty() ){
+    assert( m_dominant_lineage != 0 );
+    assert( m_best_lineage != 0 );
+    assert( m_max_fitness_lineage != 0 );
+  }
+#endif
+}
+
+
+cLineage* cClassificationManager::GetLineage(cGenotype* child_genotype, cGenotype* parent_genotype, cLineage* parent_lineage, int parent_lin_id)
+{
+  // Collect any information we can about the parent.
+  double parent_fitness = 0.0;
+  //  int parent_lin_id = 0;
+  
+  // at this point, the cpu has still the lineage from the
+  // parent
+  //  cLineage * parent_lineage = cpu->GetLineage();
+  
+#ifdef DEBUG
+  if (parent_lineage != NULL){
+    assert( parent_lin_id == parent_lineage->GetID() );
+  }
+#endif
+  
+  if (parent_genotype != NULL) {
+    assert( parent_genotype->GetNumOrganisms() > 0 );
+    parent_fitness = parent_genotype->GetTestColonyFitness();
+  }
+  double child_fitness = child_genotype->GetTestColonyFitness();
+  cLineage * child_lineage = parent_lineage;
+  bool create_lineage = false;
+  double lineage_stat1 = child_fitness;
+  double lineage_stat2 = child_fitness;
+  
+  // if we don't have a child lineage, we are probably dealing
+  // with manual assignement of the lineage label
+  if (child_lineage == NULL) {
+    child_lineage = FindLineage( parent_lin_id );
+    // lineage doesn't exist...
+    if (child_lineage == NULL) {
+      // create it
+      cout << "Creating new lineage 'by hand'!\nRequested lineage label: " << parent_lin_id;
+      child_lineage = AddLineage(child_fitness, -1, parent_lin_id, 0, 0);
+      cout << ", actual lineage label: " << child_lineage->GetID() << endl;
+    }
+  }
+  // otherwise, check for conditions that cause the creation of a new lineage
+  else {
+    switch ( m_world->GetConfig().LINEAGE_CREATION_METHOD.Get() ) {
+      case 0: // manual creation only
+        break;
+      case 1: // new lineage whenever a parent has offspring of greater fitness
+        if ( child_fitness > parent_fitness ){
+          create_lineage = true;
+          lineage_stat1 = parent_fitness;
+          lineage_stat2 = 0;
+        }
+        break;
+      case 2: // new lineage whenever a new child exceeds the
+              // currently highest fitness in the population
+        if ( child_fitness > m_max_fitness_lineage->GetMaxFitness() ){
+          create_lineage = true;
+          lineage_stat1 = m_max_fitness_lineage->GetMaxFitness();
+          lineage_stat2 = 0;
+        }
+        break;
+      case 3: // new lineage whenever a new child exceeds the
+              // highest fitness, or when it is a child of the
+              // of the dominant lineage and exceeds that highest fitness
+        if ( child_fitness > m_max_fitness_lineage->GetMaxFitness() ||
+             ( parent_lineage == m_dominant_lineage
+               && child_fitness > m_dominant_lineage->GetMaxFitness() ) ){
+          create_lineage = true;
+          lineage_stat1 = m_max_fitness_lineage->GetMaxFitness();
+          lineage_stat2 = m_dominant_lineage->GetMaxFitness();
+        }
+        break;
+      case 4: // new lineage whenever a new child exceeds the
+              // fitness of the dominant creature (and the fitness of its own lineage)
+        if (child_fitness > m_world->GetClassificationManager().GetBestGenotype()->GetTestColonyFitness()
+            && child_fitness > parent_lineage->GetMaxFitness() ){
+          create_lineage = true;
+          lineage_stat1=m_world->GetClassificationManager().GetBestGenotype()->GetTestColonyFitness();
+          lineage_stat2=parent_lineage->GetMaxFitness();
+        }
+        break;
+      case 5: // new lineage whenever a new child exceeds the
+              // fitness of the dominant lineage (and the fitness of its own lineage)
+        if ( child_fitness > m_dominant_lineage->GetMaxFitness()
+             && child_fitness > parent_lineage->GetMaxFitness() ){
+          create_lineage = true;
+          lineage_stat1=m_dominant_lineage->GetMaxFitness();
+          lineage_stat2=parent_lineage->GetMaxFitness();
+        }
+        break;
+      case 6: // new lineage whenever a new child exceeds the
+              // fitness of its own lineage
+        if ( child_fitness > parent_lineage->GetMaxFitness() ){
+          create_lineage = true;
+          lineage_stat1=parent_lineage->GetMaxFitness();
+          lineage_stat2 = 0;
+        }
+        break;
+      case 7: // new lineage whenever a new child exceeds the
+              // maximum fitness ever attained by its parent lineage
+        if (child_fitness > parent_lineage->GetMaxFitnessEver() ) {
+          create_lineage = true;
+          lineage_stat1 = parent_lineage->GetMaxFitnessEver();
+          lineage_stat2 = 0;
+        }
+        break;
+    }
+  }
+  if (create_lineage) {
+    child_lineage = AddLineage(child_fitness, parent_lin_id, -1, lineage_stat1, lineage_stat2);
+  }
+  
+  // add to the lineage
+  child_lineage->AddCreature( child_genotype );
+  
+  // This would be nice, but the current Avida code doesn't allow for it.
+  // Try to implement it in a new version...
+  // update the cpu
+  //  cpu->SetLineage( lineage );
+  //  cpu->SetLineageLabel( lineage->GetID() );
+  
+  // test whether this makes the new lineage the best
+  if (!m_best_lineage || child_lineage->GetAveFitness() > m_best_lineage->GetAveFitness())
+    m_best_lineage = child_lineage;
+  
+  // test whether this makes the new lineage the dominant
+  if (!m_dominant_lineage || child_lineage->GetNumCreatures() > m_dominant_lineage->GetNumCreatures())
+    m_dominant_lineage = child_lineage;
+  
+  // test whether this makes the new lineage the one with the maximum fitness
+  if (!m_max_fitness_lineage || child_lineage->GetMaxFitness() > m_max_fitness_lineage->GetMaxFitness())
+    m_max_fitness_lineage = child_lineage;
+  
+  return child_lineage;
+}
+
+
+void cClassificationManager::RemoveLineageOrganism(cOrganism* org)
+{
+  cLineage* cur_lineage = org->GetLineage();
+  
+  if (cur_lineage) {
+    // remove the creature
+    if ( cur_lineage->RemoveCreature(org->GetGenotype())
+         || cur_lineage == m_dominant_lineage
+         || cur_lineage == m_best_lineage ) {
+      // If this lineage no longer exists, tell stats...
+      if (cur_lineage->GetNumCreatures() == 0) {
+        m_world->GetStats().RemoveLineage( cur_lineage->GetID(),
+                                           cur_lineage->GetParentID(),
+                                           cur_lineage->GetUpdateBorn(),
+                                           cur_lineage->GetGenerationBorn(),
+                                           cur_lineage->GetTotalCreatures(),
+                                           cur_lineage->GetTotalGenotypes(),
+                                           cur_lineage->GetStartFitness(),
+                                           cur_lineage->GetLineageStat1(),
+                                           cur_lineage->GetLineageStat2() );
+      }
+    }
+    
+    // recalc the best/dominant lineage if necessary
+    UpdateLineages();
+    org->SetLineage( 0 );
+    org->SetLineageLabel( -1 );
+  }  
+}
+
+
+cLineage* cClassificationManager::FindLineage(int lineage_id) const
+{
+  list<cLineage *>::const_iterator it = m_lineage_list.begin();
+  
+  for (; it != m_lineage_list.end(); it++ ) if ( (*it)->GetID() == lineage_id ) break;
+  
+  if (it == m_lineage_list.end()) {
+    cout << "Lineage " << lineage_id << " not found." << endl;
+    return NULL;
+  }
+  
+  return ( *it );
+}
+
+
+void cClassificationManager::PrintLineageTotals(const cString &filename, bool verbose)
+{
+  ofstream& fp = m_world->GetDataFileOFStream(filename);
+  assert(fp.good());
+  
+  fp << m_world->GetStats().GetUpdate();
+  const list<cLineage *> & lineage_list = GetLineageList();
+  
+  if (verbose) { // in verbose format, we print only those
+                  // lineages that are actually present, but
+                  // we print much more info
+    fp << ": " << m_world->GetStats().SumGeneration().Average() << "\n";
+    
+    // let's calculate the average fitness in the population also
+    double fitness_sum = 0;
+    double fitness = 0;
+    int total_num_organisms = 0;
+    int num_organisms = 0;
+    
+    
+    list<cLineage *>::const_iterator it = lineage_list.begin();
+    for ( ; it != lineage_list.end(); it++ ){
+      num_organisms = (*it)->GetNumCreatures();
+      fitness = (*it)->GetAveFitness();
+      fitness_sum += fitness * num_organisms;
+      total_num_organisms += num_organisms;
+      fp << " "
+        << (*it)->GetID()           << " "
+        << (*it)->GetParentID()     << " "
+        << (*it)->GetStartFitness() << " "
+        << (*it)->GetMaxFitness()   << " "
+        << fitness                  << " "
+        << num_organisms            << " "
+        << (*it)->GetTotalCreatures()    << "\n";
+    }
+    fp << "#Dom: " << GetDominantLineage()->GetID()
+      << ", Max: " << GetMaxFitnessLineage()->GetID()
+      << ", Best: " << GetBestLineage()->GetID()
+      << "\n#Pop. fitness: " << fitness_sum / (double) total_num_organisms
+      << "\n" << endl;
+  }
+  else {
+    fp << " ";
+    int cur_id = 0;
+    
+    list<cLineage *>::const_iterator it = lineage_list.begin();
+    for ( ; it != lineage_list.end(); it++ ){
+      int next_id = (*it)->GetID();
+      // wind up the current id to the next id
+      for ( ; cur_id < next_id; cur_id++ )
+        fp << "-1 "; // output -1 when we don't have the data
+      fp << (*it)->GetTotalCreatures() << " ";
+      cur_id += 1;
+    }
+    fp << endl;
+  }
+}
+
+
+void cClassificationManager::PrintLineageCurCounts(const cString & filename)
+{
+  ofstream& fp = m_world->GetDataFileOFStream(filename);
+  assert(fp.good());
+  
+  fp << m_world->GetStats().GetUpdate() << " ";
+  const list<cLineage *> & lineage_list = GetLineageList();
+  
+  list<cLineage *>::const_iterator it = lineage_list.begin();
+  int cur_id = 0;
+  for ( ; it != lineage_list.end(); it++ ){
+    int next_id = (*it)->GetID();
+    // wind up the current id to the next id
+    for ( ; cur_id < next_id; cur_id++ )
+      fp << "0 ";
+    fp << (*it)->GetNumCreatures() << " ";
+    cur_id += 1;
+  }	
+  fp << endl;
+}
+
+
+unsigned int cClassificationManager::FindCRC(const cGenome & in_genome) const
+{
+  unsigned int total = 0;
+  
+  for (int i = 0; i < in_genome.GetSize(); i++) {
+    total += (in_genome[i].GetOp() + 3) * i;
+  }
+  
+  return total % nGenotype::HASH_SIZE;
+}
+
+
+unsigned int cClassificationManager::FindInjectCRC(const cGenome & in_genome) const
+{
+  unsigned int total = 13;
+  int i;
+  
+  for (i = 0; i < in_genome.GetSize(); i++) {
+    total *= in_genome[i].GetOp() + 10 + i << 6;
+    total += 3;
+  }
+  
+  return total;
+}
+
+
+cString cClassificationManager::GetLabel(int in_size, int in_num)
+{
+  char alpha[6];
+  char full_name[12];
+  int i;
+  
+  for (i = 4; i >= 0; i--) {
+    alpha[i] = (in_num % 26) + 'a';
+    in_num /= 26;
+  }
+  alpha[5] = '\0';
+  
+  sprintf(full_name, "%03d-%s", in_size, alpha);
+  
+  return full_name;
+}
+
+
+bool cClassificationManager::OK()
+{
+  bool ret_value = true;
+  
+  // Check components...
+  if (!m_genotype_ctl->OK() || !m_species_ctl->OK()) { ret_value = false; }
+  
+  // Now to double check the numbers of genotypes (and threshold) for each
+  // species.  This will only work if debug mode is on.
+  
+#ifdef DEBUG
+  // Initialize debug routines in the species.
+  
+  cSpecies * cur_species = NULL;
+  cSpecies * first_active = m_species_ctl->GetFirst();
+  cSpecies * first_inactive = m_species_ctl->GetFirstInactive();
+  cSpecies * first_garbage = m_species_ctl->GetFirstGarbage();
+  
+  while (cur_species != first_active) {
+    if (!cur_species) cur_species = first_active;
+    cur_species->debug_num_genotypes = 0;
+    cur_species->debug_num_threshold = 0;
+    cur_species = cur_species->GetNext();
+  }
+  
+  cur_species = NULL;
+  while (cur_species != first_inactive) {
+    if (!cur_species) cur_species = first_inactive;
+    cur_species->debug_num_genotypes = 0;
+    cur_species->debug_num_threshold = 0;
+    cur_species = cur_species->GetNext();
+  }
+  
+  cur_species = NULL;
+  while (cur_species != first_garbage) {
+    if (!cur_species) cur_species = first_garbage;
+    cur_species->debug_num_genotypes = 0;
+    cur_species->debug_num_threshold = 0;
+    cur_species = cur_species->GetNext();
+  }
+  
+  
+  // Check the species for each genotype and place results in the species.
+  
+  cGenotype * cur_gen = m_genotype_ctl->GetBest();
+  for (int i = 0; i < m_genotype_ctl->GetSize(); i++) {
+    if (cur_gen->GetSpecies()) {
+      cur_gen->GetSpecies()->debug_num_genotypes++;
+      if (cur_gen->GetThreshold()) {
+        cur_gen->GetSpecies()->debug_num_threshold++;
+      }
+    }
+    cur_gen = cur_gen->GetNext();
+  }
+  
+  // Finally, make sure all the numbers match up.
+  
+  cur_species = NULL;
+  while (cur_species != first_active) {
+    if (!cur_species) cur_species = first_active;
+    assert(cur_species->debug_num_genotypes == cur_species->GetNumGenotypes());
+    assert(cur_species->debug_num_threshold == cur_species->GetNumThreshold());
+    assert(cur_species->debug_num_genotypes >= cur_species->debug_num_threshold);
+    
+    assert (cur_species->debug_num_threshold);
+    cur_species = cur_species->GetNext();
+  }
+  
+  cur_species = NULL;
+  while (cur_species != first_inactive) {
+    if (!cur_species) cur_species = first_inactive;
+    assert(cur_species->debug_num_genotypes == cur_species->GetNumGenotypes());
+    assert(cur_species->debug_num_threshold == cur_species->GetNumThreshold());
+    assert(cur_species->debug_num_threshold);
+    assert(cur_species->debug_num_genotypes);
+  }
+  
+  cur_species = NULL;
+  while (cur_species != first_garbage) {
+    if (!cur_species) cur_species = first_garbage;
+    assert(cur_species->debug_num_genotypes == 0 &&
+           cur_species->debug_num_threshold == 0);
+  }
+  
+#endif
+  
+  assert (ret_value == true);
+  
+  return ret_value;
+}

Added: development/source/classification/cClassificationManager.h
===================================================================
--- development/source/classification/cClassificationManager.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/classification/cClassificationManager.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,189 @@
+/*
+ *  cClassificationManager.h
+ *  Avida
+ *
+ *  Created by David on 11/14/05.
+ *  Copyright 2005 Michigan State University. All rights reserved.
+ *  Copyright 1993-2003 California Institute of Technology.
+ *
+ */
+
+#ifndef cClassificationManager_h
+#define cClassificationManager_h
+
+#include <list>
+
+#ifndef defs_h
+#include "defs.h"
+#endif
+#ifndef cGenotypeControl_h
+#include "cGenotypeControl.h"
+#endif
+#ifndef cInjectGenotypeControl_h
+#include "cInjectGenotypeControl.h"
+#endif
+#ifndef cInjectGenotypeQueue_h
+#include "cInjectGenotypeQueue.h"
+#endif
+#ifndef cSpeciesControl_h
+#include "cSpeciesControl.h"
+#endif
+#ifndef cString_h
+#include "cString.h"
+#endif
+#ifndef tList_h
+#include "tList.h"
+#endif
+
+class cLineage;
+class cOrganism;
+class cWorld;
+
+class cClassificationManager
+{
+private:
+  cWorld* m_world;
+  
+  // Genotype Structures
+  unsigned int m_genotype_count[MAX_CREATURE_SIZE];
+  tList<cGenotype> m_active_genotypes[nGenotype::HASH_SIZE];
+  cGenotypeControl* m_genotype_ctl;
+  int m_genotype_next_id;
+  int m_genotype_dom_time;
+  int m_genotype_prev_dom;
+
+  // Species Structures
+  cSpeciesControl* m_species_ctl;
+  int m_species_next_id;
+
+  // InjectGenotype Structures
+  unsigned int m_inject_count[MAX_CREATURE_SIZE];
+  cInjectGenotypeQueue m_active_inject[nInjectGenotype::HASH_SIZE];
+  cInjectGenotypeControl* m_inject_ctl;
+  int m_inject_next_id;
+  int m_inject_dom_time;
+  int m_inject_prev_dom;
+  
+  // Lineage Structures
+  std::list<cLineage*> m_lineage_list;
+  cLineage* m_best_lineage;  // the lineage with the highest average fitness
+  cLineage* m_max_fitness_lineage; // lineage with the single highest fitness
+  cLineage* m_dominant_lineage; // the lineage with the largest number of creatures.
+  int m_lineage_next_id;
+  
+  
+  // Private Helper Functions
+  void AddGenotype(cGenotype* in_genotype, int list_num = -1);
+  void AddInjectGenotype(cInjectGenotype* in_inject_genotype, int in_list_num = -1);
+  void DumpDetailHeading(std::ofstream& fp);
+  void DumpDetailSexHeading (std::ofstream& fp);
+  unsigned int FindCRC(const cGenome& in_genome) const;
+  unsigned int FindInjectCRC(const cGenome& in_genome) const;
+  cString GetLabel(int in_size, int in_num);
+  cString GetInjectLabel(int in_size, int in_num) { return cString("p") + GetLabel(in_size, in_num); }
+  
+  cLineage* AddLineage(double start_fitness, int parent_lin_id, int id = -1, double lineage_stat1 = 0.0, double lineage_stat2 = 0.0);
+  void UpdateLineages();
+  
+  
+  // Disable Copy Constructor
+  cClassificationManager(const cClassificationManager&);
+
+public:
+  cClassificationManager(cWorld* world);
+  ~cClassificationManager();
+
+  void UpdateReset();
+  
+  
+  // Genotype Manipulation
+  cGenotype* GetGenotype(const cGenome& in_genome, cGenotype* parent1, cGenotype* parent2);
+  cGenotype* GetGenotypeInjected(const cGenome& in_genome, int lineage_label);
+  cGenotype* GetGenotypeLoaded(const cGenome& in_genome, int update_born = 0, int id_num = -1);
+  const cGenotype* FindGenotype(const cGenome& in_genome, int lineage_label, int list_num = -1) const;
+  cGenotype* FindGenotype(const cGenome& in_genome, int lineage_label, int list_num = -1);
+  void RemoveGenotype(cGenotype& in_genotype);
+  void ThresholdGenotype(cGenotype& in_genotype);
+  bool AdjustGenotype(cGenotype& in_genotype);
+  
+  int GetGenotypeCount() const { return m_genotype_ctl->GetSize(); }
+  cGenotype* GetBestGenotype() const { return m_genotype_ctl->GetBest(); }
+  cGenotype* GetCoalescentGenotype() const { return m_genotype_ctl->GetCoalescent(); }
+  
+  cGenotype* GetGenotype(int thread) const { return m_genotype_ctl->Get(thread); }
+  cGenotype* NextGenotype(int thread)
+  {
+    cGenotype* next = m_genotype_ctl->Next(thread);
+    return (next == m_genotype_ctl->GetBest()) ? NULL : next;
+  }
+  cGenotype* ResetThread(int thread) { return m_genotype_ctl->Reset(thread); }
+
+  int FindPos(cGenotype& in_genotype, int max_depth = -1) { return m_genotype_ctl->FindPos(in_genotype, max_depth); }
+  
+  // Genotype Output
+  bool DumpTextSummary(std::ofstream& fp);
+  bool PrintGenotypes(std::ofstream& fp, cString & data_fields, int historic);
+  bool DumpDetailedSummary(std::ofstream& fp);
+  bool DumpDetailedSexSummary(std::ofstream& fp);
+  bool DumpHistoricSummary(std::ofstream& fp, int back_dist);
+  bool DumpHistoricSexSummary(std::ofstream& fp);
+  void DumpDetailedEntry(cGenotype* genotype, std::ofstream& fp);
+  void DumpDetailedSexEntry(cGenotype* genotype, std::ofstream& fp);
+  
+  
+  // InjectGenotype Manipulation
+  cInjectGenotype* GetInjectGenotype(const cGenome& in_genome, cInjectGenotype* parent_inject_genotype = NULL);
+  cInjectGenotype* FindInjectGenotype(const cGenome& in_genome) const;
+  void RemoveInjectGenotype(cInjectGenotype & in_inject_genotype);
+  void ThresholdInjectGenotype(cInjectGenotype & in_inject_genotype);
+  bool AdjustInjectGenotype(cInjectGenotype & in_inject_genotype);  
+  
+  int GetInjectGenotypeCount() const { return m_inject_ctl->GetSize(); }
+  cInjectGenotype* GetBestInjectGenotype() const { return m_inject_ctl->GetBest(); }
+  cInjectGenotype* GetCoalescentInjectGenotype() const { return m_inject_ctl->GetCoalescent(); }
+  
+  cInjectGenotype* GetInjectGenotype(int thread) const { return m_inject_ctl->Get(thread); }
+  cInjectGenotype* NextInjectGenotype(int thread)
+  {
+    cInjectGenotype* next = m_inject_ctl->Next(thread);
+    return (next == m_inject_ctl->GetBest()) ? NULL : next; 
+  }
+  cInjectGenotype* ResetInjectThread(int thread) { return m_inject_ctl->Reset(thread); }
+  
+  int FindPos(cInjectGenotype& inject, int max_depth = -1) { return m_inject_ctl->FindPos(inject, max_depth); }
+    
+  // InjectGenotype Output
+  bool DumpInjectTextSummary(std::ofstream& fp);
+  bool DumpInjectDetailedSummary(const cString & file, int update);
+  void DumpInjectDetailedEntry(cInjectGenotype * inject_genotype, const cString & file, int update);
+  
+
+  // Species Accessors
+  cSpecies* GetFirstSpecies() const { return m_species_ctl->GetFirst(); }
+  int GetNumSpecies() const { return m_species_ctl->GetSize(); }
+  int CountSpecies() { return m_species_ctl->OK(); }
+  int FindPos(cSpecies& in_species, int max_depth = -1) { return m_species_ctl->FindPos(in_species, max_depth); }  
+
+
+  // Lineage Manipulators
+  cLineage* GetLineage(cGenotype* child_genotype, cGenotype* parent_genotype, cLineage* parent_lineage, int parent_lin_id);
+  void RemoveLineageOrganism(cOrganism* org);  
+  cLineage* FindLineage(int lineage_id) const;
+  cLineage* GetMaxFitnessLineage() const { return m_max_fitness_lineage; }
+  cLineage* GetBestLineage() const { return m_best_lineage; }
+  cLineage* GetDominantLineage() const { return m_dominant_lineage; }
+  int GetLineageCount() const { return m_lineage_list.size(); }
+  const std::list<cLineage*>& GetLineageList() const { return m_lineage_list; }
+
+  // Lineage Output
+  void PrintLineageTotals(const cString& filename, bool verbose=false);
+  void PrintLineageCurCounts(const cString& filename);
+  
+
+  // Utility Functions
+  bool SaveClone(std::ofstream& fp);
+  bool LoadClone(std::ifstream & fp);
+  bool OK();  
+};
+
+#endif

Copied: development/source/classification/cGenotype.cc (from rev 392, development/source/main/cGenotype.cc)
===================================================================
--- development/source/main/cGenotype.cc	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cGenotype.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,362 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 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 "cGenotype.h"
+
+#include "cCPUTestInfo.h"
+#include "cGenomeUtil.h"
+#include "cMerit.h"
+#include "cOrganism.h"
+#include "cPhenotype.h"
+#include "cTestCPU.h"
+#include "cTools.h"
+#include "cWorld.h"
+
+using namespace std;
+
+class cSpecies;
+
+///////////////////////////
+//  cGenotype
+///////////////////////////
+
+cGenotype::cGenotype(cWorld* world, int in_update_born, int in_id)
+  : m_world(world)
+  , genome(1)
+  , name("001-no_name")
+  , flag_threshold(false)
+  , is_active(true)
+  , defer_adjust(0)
+  , id_num(in_id)
+  , symbol(0)
+  , birth_data(in_update_born)
+  , num_organisms(0)
+  , last_num_organisms(0)
+  , total_organisms(0)
+  , total_parasites(0)
+  , species(NULL)
+  , next(NULL)
+  , prev(NULL)
+{
+}
+
+cGenotype::~cGenotype()
+{
+  // Reset some of the variables to make sure program will crash if a deleted
+  // cell is read!
+  symbol = '!';
+
+  num_organisms = -1;
+  total_organisms = -1;
+
+  next = NULL;
+  prev = NULL;
+}
+
+bool cGenotype::SaveClone(ofstream& fp)
+{
+  fp << id_num         << " ";
+  fp << genome.GetSize() << " ";
+
+  for (int i = 0; i < genome.GetSize(); i++) {
+    fp << ((int) genome[i].GetOp()) << " ";
+  }
+
+  return true;
+}
+
+cGenotype* cGenotype::LoadClone(cWorld* world, ifstream& fp)
+{
+  int tmp_id = -1;
+  int genome_size = 0;
+
+  fp >> tmp_id;
+  fp >> genome_size;
+
+  cGenotype* ret = new cGenotype(world, 0, tmp_id);
+  ret->genome = cGenome(genome_size);
+  for (int i = 0; i < genome_size; i++) {
+    cInstruction temp_inst;
+    int inst_op;
+    fp >> inst_op;
+    temp_inst.SetOp((UCHAR) inst_op);
+    ret->genome[i] = temp_inst;
+    // @CAO add something here to load arguments for instructions.
+  }
+  
+  return ret;
+}
+
+bool cGenotype::OK()
+{
+  bool ret_value = true;
+
+  // Check the components...
+
+  if (!genome.OK()) ret_value = false;
+
+  // And the statistics
+  assert( id_num >= 0 && num_organisms >= 0 && total_organisms >= 0 );
+  assert( birth_data.update_born >= -1 && birth_data.parent_distance >= -1 );
+  assert( sum_copied_size.Sum() >= 0 && sum_exe_size.Sum() >= 0 );
+  assert( sum_gestation_time.Sum() >= 0 && sum_repro_rate.Sum() >= 0 );
+  assert( sum_merit.Sum() >= 0 && sum_fitness.Sum() >= 0 );
+  assert( tmp_sum_copied_size.Sum() >= 0 && tmp_sum_exe_size.Sum() >= 0 );
+  assert( tmp_sum_gestation_time.Sum() >= 0 && tmp_sum_repro_rate.Sum() >= 0 );
+  assert( tmp_sum_merit.Sum() >= 0 && tmp_sum_fitness.Sum() >= 0 );
+
+  return ret_value;
+}
+
+void cGenotype::SetParent(cGenotype * parent, cGenotype * parent2)
+{
+  birth_data.parent_genotype = parent;
+  birth_data.parent2_genotype = parent2;
+
+  // If we have a real parent genotype, collect other data about parent.
+  if (parent == NULL) return;
+  birth_data.ancestor_ids[0] = parent->GetID();
+  birth_data.ancestor_ids[2] = parent->GetAncestorID(0);
+  birth_data.ancestor_ids[3] = parent->GetAncestorID(1);
+  if (parent2 != NULL) {
+    birth_data.ancestor_ids[1] = parent2->GetID();
+    birth_data.ancestor_ids[4] = parent2->GetAncestorID(0);
+    birth_data.ancestor_ids[5] = parent2->GetAncestorID(1);    
+  }
+
+  birth_data.parent_distance =
+    cGenomeUtil::FindEditDistance(genome, parent->genome);
+  birth_data.parent_species = parent->GetSpecies();
+  birth_data.gene_depth = parent->GetDepth() + 1;
+  birth_data.lineage_label = parent->GetLineageLabel();
+  parent->AddOffspringGenotype();
+  if (parent2 != NULL && m_world->GetConfig().TRACK_MAIN_LINEAGE.Get() == 2) {
+    parent2->AddOffspringGenotype();
+  }
+
+  // Initialize all stats to those of the parent genotype....
+  tmp_sum_copied_size.Add(    parent->GetCopiedSize());
+  tmp_sum_exe_size.Add(       parent->GetExecutedSize());
+  tmp_sum_gestation_time.Add( parent->GetGestationTime());
+  tmp_sum_repro_rate.Add(   1/parent->GetGestationTime());
+  tmp_sum_merit.Add(          parent->GetMerit());
+  tmp_sum_fitness.Add(        parent->GetFitness());
+}
+
+void cGenotype::Mutate()  // Check each location to be mutated.
+{
+  int i;
+
+  for (i = 0; i < genome.GetSize(); i++) {
+    if (true) { // m_world->GetRandom().GetUInt()) {     //@CAO always true!
+      genome[i].SetOp(m_world->GetRandom().GetUInt(m_world->GetNumInstructions()));
+      // Flag command as having been mutated? @CAO
+    }
+  }
+}
+
+void cGenotype::UpdateReset()
+{
+  last_num_organisms = num_organisms;
+  birth_data.birth_track.Next();
+  birth_data.death_track.Next();
+  birth_data.breed_out_track.Next();
+  birth_data.breed_true_track.Next();
+  birth_data.breed_in_track.Next();
+}
+
+void cGenotype::SetGenome(const cGenome & in_genome)
+{
+  genome = in_genome;
+  // Zero Stats
+  sum_copied_size.Clear();
+  sum_exe_size.Clear();
+  sum_gestation_time.Clear();
+  sum_repro_rate.Clear();
+  sum_merit.Clear();
+  sum_fitness.Clear();
+  tmp_sum_copied_size.Clear();
+  tmp_sum_exe_size.Clear();
+  tmp_sum_gestation_time.Clear();
+  tmp_sum_repro_rate.Clear();
+  tmp_sum_merit.Clear();
+  tmp_sum_fitness.Clear();
+
+  name.Set("%03d-no_name", genome.GetSize());
+}
+
+void cGenotype::CalcTestStats() const
+{
+  //  cerr << ".......Calculating test stats..." << endl;
+
+  cCPUTestInfo test_info;
+  m_world->GetTestCPU().TestGenome(test_info, genome);
+  test_data.is_viable = test_info.IsViable();
+
+  // Setup all possible test values.
+  cPhenotype & phenotype = test_info.GetTestOrganism()->GetPhenotype();
+  test_data.fitness = test_info.GetGenotypeFitness();
+  test_data.merit = phenotype.GetMerit().GetDouble();
+  test_data.gestation_time = phenotype.GetGestationTime();
+  test_data.executed_size = phenotype.GetExecutedSize();
+  test_data.copied_size = phenotype.GetCopiedSize();
+  test_data.colony_fitness = test_info.GetColonyFitness();
+  test_data.generations = test_info.GetMaxDepth();
+}
+
+
+bool cGenotype::GetTestViable() const {
+  if (test_data.fitness == -1) CalcTestStats();
+  return test_data.is_viable;
+}
+
+
+double cGenotype::GetTestFitness() const {
+  if (test_data.fitness == -1) CalcTestStats();
+  return test_data.fitness;
+}
+
+
+double cGenotype::GetTestMerit() const {
+  if (test_data.fitness == -1) CalcTestStats();
+  return test_data.merit;
+}
+
+
+int cGenotype::GetTestGestationTime() const {
+  if (test_data.fitness == -1) CalcTestStats();
+  return test_data.gestation_time;
+}
+
+
+int cGenotype::GetTestExecutedSize() const {
+  if (test_data.fitness == -1) CalcTestStats();
+  return test_data.executed_size;
+}
+
+
+int cGenotype::GetTestCopiedSize() const {
+  if (test_data.fitness == -1) CalcTestStats();
+  return test_data.copied_size;
+}
+
+
+double cGenotype::GetTestColonyFitness() const {
+  if (test_data.fitness == -1) CalcTestStats();
+  return test_data.colony_fitness;
+}
+
+
+int cGenotype::GetTestGenerations() const {
+  if (test_data.fitness == -1) CalcTestStats();
+  return test_data.generations;
+}
+
+void cGenotype::SetSpecies(cSpecies * in_species)
+{
+  species = in_species;
+}
+
+void cGenotype::AddMerit(const cMerit & in)
+{
+  sum_merit.Add(in.GetDouble());
+}
+
+void cGenotype::RemoveMerit(const cMerit & in)
+{
+  sum_merit.Subtract(in.GetDouble());
+}
+
+void cGenotype::Deactivate(int update)
+{
+  is_active = false;
+  birth_data.update_deactivated = update;
+}
+
+int cGenotype::GetPhyloDistance(cGenotype * test_genotype)
+{
+  if (GetID() == test_genotype->GetID()) {
+    return 0;
+  }
+  if (GetID() == test_genotype->GetAncestorID(0) ||  // Parent of test
+      GetID() == test_genotype->GetAncestorID(1) ||  // Parent of test
+      test_genotype->GetID() == GetAncestorID(0) ||  // Child of test
+      test_genotype->GetID() == GetAncestorID(1)     // Child of test
+      ) {
+    return 1;
+  }
+  if (GetID() == test_genotype->GetAncestorID(2) ||  // Grandparent of test
+      GetID() == test_genotype->GetAncestorID(3) ||  // Grandparent of test
+      GetID() == test_genotype->GetAncestorID(4) ||  // Grandparent of test
+      GetID() == test_genotype->GetAncestorID(5) ||  // Grandparent of test
+      test_genotype->GetID() == GetAncestorID(2) ||  // Grandchild of test
+      test_genotype->GetID() == GetAncestorID(3) ||  // Grandchild of test
+      test_genotype->GetID() == GetAncestorID(4) ||  // Grandchild of test
+      test_genotype->GetID() == GetAncestorID(5) ||  // Grandchild of test
+      GetAncestorID(0) == test_genotype->GetAncestorID(0) || // Sibling of test
+      GetAncestorID(0) == test_genotype->GetAncestorID(1) || // Sibling of test
+      GetAncestorID(1) == test_genotype->GetAncestorID(0) || // Sibling of test
+      GetAncestorID(1) == test_genotype->GetAncestorID(1)    // Sibling of test
+      ) {
+    return 2;
+  }
+  if (GetAncestorID(0) == test_genotype->GetAncestorID(2) || // Uncle of test
+      GetAncestorID(0) == test_genotype->GetAncestorID(3) || // Uncle of test
+      GetAncestorID(0) == test_genotype->GetAncestorID(4) || // Uncle of test
+      GetAncestorID(0) == test_genotype->GetAncestorID(5) || // Uncle of test
+      GetAncestorID(1) == test_genotype->GetAncestorID(2) || // Uncle of test
+      GetAncestorID(1) == test_genotype->GetAncestorID(3) || // Uncle of test
+      GetAncestorID(1) == test_genotype->GetAncestorID(4) || // Uncle of test
+      GetAncestorID(1) == test_genotype->GetAncestorID(5) || // Uncle of test
+      test_genotype->GetAncestorID(0) == GetAncestorID(2) || // Nephew of test
+      test_genotype->GetAncestorID(0) == GetAncestorID(3) || // Nephew of test
+      test_genotype->GetAncestorID(0) == GetAncestorID(4) || // Nephew of test
+      test_genotype->GetAncestorID(0) == GetAncestorID(5) || // Nephew of test
+      test_genotype->GetAncestorID(1) == GetAncestorID(2) || // Nephew of test
+      test_genotype->GetAncestorID(1) == GetAncestorID(3) || // Nephew of test
+      test_genotype->GetAncestorID(1) == GetAncestorID(4) || // Nephew of test
+      test_genotype->GetAncestorID(1) == GetAncestorID(5)    // Nephew of test
+      ) {
+    return 3;
+  }
+
+  if (GetAncestorID(2) == test_genotype->GetAncestorID(2) || // First Cousins
+      GetAncestorID(2) == test_genotype->GetAncestorID(3) ||
+      GetAncestorID(2) == test_genotype->GetAncestorID(4) ||
+      GetAncestorID(2) == test_genotype->GetAncestorID(5) ||
+      GetAncestorID(3) == test_genotype->GetAncestorID(2) ||
+      GetAncestorID(3) == test_genotype->GetAncestorID(3) ||
+      GetAncestorID(3) == test_genotype->GetAncestorID(4) ||
+      GetAncestorID(3) == test_genotype->GetAncestorID(5) ||
+      GetAncestorID(4) == test_genotype->GetAncestorID(2) ||
+      GetAncestorID(4) == test_genotype->GetAncestorID(3) ||
+      GetAncestorID(4) == test_genotype->GetAncestorID(4) ||
+      GetAncestorID(4) == test_genotype->GetAncestorID(5) ||
+      GetAncestorID(5) == test_genotype->GetAncestorID(2) ||
+      GetAncestorID(5) == test_genotype->GetAncestorID(3) ||
+      GetAncestorID(5) == test_genotype->GetAncestorID(4) ||
+      GetAncestorID(5) == test_genotype->GetAncestorID(5)
+      ) {
+    return 4;
+  }
+  
+  return 5;
+}
+
+
+int cGenotype::AddOrganism()
+{
+  total_organisms++;
+  return num_organisms++;
+}
+
+int cGenotype::RemoveOrganism()
+{
+  birth_data.death_track.Inc();
+  return num_organisms--;
+}
+

Copied: development/source/classification/cGenotype.h (from rev 392, development/source/main/cGenotype.h)
===================================================================
--- development/source/main/cGenotype.h	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cGenotype.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,249 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 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 GENOTYPE_HH
+#define GENOTYPE_HH
+
+#include <fstream>
+
+#ifndef DOUBLE_SUM_HH
+#include "cDoubleSum.h"
+#endif
+#ifndef GENOME_HH
+#include "cGenome.h"
+#endif
+#ifndef GENOTYPE_BIRTH_DATA_HH
+#include "cGenotype_BirthData.h"
+#endif
+#ifndef GENOTYPE_TEST_DATA_HH
+#include "cGenotype_TestData.h"
+#endif
+#ifndef STRING_HH
+#include "cString.h"
+#endif
+
+class cSpecies;
+class cMerit;
+class cWorld;
+
+class cGenotype {
+private:
+  friend class cClassificationManager;
+
+  cWorld* m_world;
+  cGenome genome;
+  cString name;
+  bool flag_threshold;
+  bool is_active;      // Is this genotype still alive?
+  int defer_adjust;    // Don't adjust in the archive until all are cleared.
+
+  int id_num;
+  char symbol;
+
+  mutable cGenotype_TestData test_data;
+  cGenotype_BirthData birth_data;
+
+  // Statistical info
+
+  int num_organisms;
+  int last_num_organisms;
+  int total_organisms;
+  int total_parasites;
+
+  cSpecies * species;
+
+  // Data Structure stuff...
+  cGenotype * next;
+  cGenotype * prev;
+
+
+  ////// Statistical info //////
+
+  // Collected on Divides
+  cDoubleSum sum_copied_size;
+  cDoubleSum sum_exe_size;
+
+  cDoubleSum sum_gestation_time;
+  cDoubleSum sum_repro_rate;  // should make gestation obsolete (not new)
+
+  cDoubleSum sum_merit;
+  cDoubleSum sum_fitness;
+
+  // Temporary (Approx stats used before any divides done)
+  // Set in "SetParent"
+  cDoubleSum tmp_sum_copied_size;
+  cDoubleSum tmp_sum_exe_size;
+
+  cDoubleSum tmp_sum_gestation_time;
+  cDoubleSum tmp_sum_repro_rate;
+
+  cDoubleSum tmp_sum_merit;
+  cDoubleSum tmp_sum_fitness;
+
+  void CalcTestStats() const;
+  cGenotype(cWorld* world, int in_update_born, int in_id);
+  
+  // Disable No-Argument Constructor
+  cGenotype();
+
+public:
+  ~cGenotype();
+
+  bool SaveClone(std::ofstream& fp);
+  static cGenotype* LoadClone(cWorld* world, std::ifstream& fp);
+  bool OK();
+  void Mutate();
+  void UpdateReset();
+
+  void SetGenome(const cGenome & in_genome);
+  void SetSpecies(cSpecies * in_species);
+
+  // Test CPU info -- only used with limited options on.
+  bool GetTestViable() const;
+  double GetTestFitness() const;
+  double GetTestMerit() const;
+  int GetTestGestationTime() const;
+  int GetTestExecutedSize() const;
+  int GetTestCopiedSize() const;
+  double GetTestColonyFitness() const;
+  int GetTestGenerations() const;
+
+  void SetParent(cGenotype * parent, cGenotype * parent2);
+  void SetName(cString in_name)     { name = in_name; }
+  void SetNext(cGenotype * in_next) { next = in_next; }
+  void SetPrev(cGenotype * in_prev) { prev = in_prev; }
+  void SetSymbol(char in_symbol) { symbol = in_symbol; }
+  inline void SetThreshold();
+  void IncDeferAdjust() { defer_adjust++; }
+  void DecDeferAdjust() { defer_adjust--; assert(defer_adjust >= 0); }
+  void SetLineageLabel(int in_label) { birth_data.lineage_label = in_label; }
+
+  // Setting New Stats
+  void AddCopiedSize      (int in)   { sum_copied_size.Add(in); }
+  void AddExecutedSize         (int in)   { sum_exe_size.Add(in); }
+  void AddGestationTime   (int in)   { sum_gestation_time.Add(in);
+                                       sum_repro_rate.Add(1/(double)in); }
+  void AddMerit      (const cMerit & in);
+  void RemoveMerit   (const cMerit & in);
+  void AddFitness    (double in){
+    assert(in >= 0.0);
+    sum_fitness.Add(in);
+  }
+  void RemoveFitness (double in){
+    assert(in >= 0.0);
+    sum_fitness.Subtract(in);
+  }
+
+  //// Properties Native to Genotype ////
+  cGenome & GetGenome()             { return genome; }
+  const cGenome & GetGenome() const { return genome; }
+  int GetLength()             const { return genome.GetSize(); }
+
+  int GetBirths()    const { return birth_data.birth_track.GetTotal(); }
+  int GetBreedOut()  const { return birth_data.breed_out_track.GetTotal(); }
+  int GetBreedTrue() const { return birth_data.breed_true_track.GetTotal(); }
+  int GetBreedIn()   const { return birth_data.breed_in_track.GetTotal(); }
+
+  int GetThisBirths()    const { return birth_data.birth_track.GetCur(); }
+  int GetThisBreedOut()  const { return birth_data.breed_out_track.GetCur(); }
+  int GetThisBreedTrue() const { return birth_data.breed_true_track.GetCur(); }
+  int GetThisBreedIn()   const { return birth_data.breed_in_track.GetCur(); }
+
+  int GetThisDeaths() const { return birth_data.death_track.GetCur(); }
+
+  int GetLastNumOrganisms() const { return last_num_organisms; }
+  int GetLastBirths()    const { return birth_data.birth_track.GetLast(); }
+  int GetLastBreedOut()  const { return birth_data.breed_out_track.GetLast(); }
+  int GetLastBreedTrue() const { return birth_data.breed_true_track.GetLast();}
+  int GetLastBreedIn()   const { return birth_data.breed_in_track.GetLast(); }
+
+  inline void SetBreedStats(cGenotype & daughter); // called by ActivateChild
+
+  //// Properties Averaged Over Creatues ////
+  double GetCopiedSize()    const { return (sum_copied_size.Count()>0) ?
+	   sum_copied_size.Average() : tmp_sum_copied_size.Average(); }
+  double GetExecutedSize()  const { return (sum_exe_size.Count()>0) ?
+	   sum_exe_size.Average() : tmp_sum_exe_size.Average(); }
+  double GetGestationTime() const { return (sum_gestation_time.Count()>0) ?
+	   sum_gestation_time.Average() : tmp_sum_gestation_time.Average(); }
+  double GetReproRate()     const { return (sum_repro_rate.Count()>0) ?
+	   sum_repro_rate.Average() : tmp_sum_repro_rate.Average(); }
+  double GetMerit()         const { return (sum_merit.Count()>0) ?
+	   sum_merit.Average() : tmp_sum_merit.Average(); }
+  double GetFitness()       const { return (sum_fitness.Count()>0) ?
+	   sum_fitness.Average() : tmp_sum_fitness.Average(); }
+
+
+  // For tracking the genotype line back to the ancestor...
+  cGenotype * GetParentGenotype() { return birth_data.parent_genotype; }
+  cGenotype * GetParent2Genotype() { return birth_data.parent2_genotype; }
+  int GetNumOffspringGenotypes() const
+    { return birth_data.num_offspring_genotypes; }
+  void AddOffspringGenotype() { birth_data.num_offspring_genotypes++; }
+  void RemoveOffspringGenotype() { birth_data.num_offspring_genotypes--; }
+  bool GetActive() const { return is_active; }
+  bool GetDeferAdjust() const { return defer_adjust > 0; }
+  int GetUpdateDeactivated() { return birth_data.update_deactivated; }
+  void Deactivate(int update);
+
+  int GetUpdateBorn() const     { return birth_data.update_born; }
+  int GetParentID() const       { return birth_data.ancestor_ids[0]; }
+  int GetAncestorID(int anc) const { return birth_data.ancestor_ids[anc]; }
+  int GetParentDistance() const { return birth_data.parent_distance; }
+  int GetDepth() const          { return birth_data.gene_depth; }
+  int GetLineageLabel() const   { return birth_data.lineage_label; }
+  cString & GetName()           { return name; }
+  cSpecies * GetSpecies()       { return species; }
+  cSpecies * GetParentSpecies() { return birth_data.parent_species; }
+  cGenotype * GetNext()         { return next; }
+  cGenotype * GetPrev()         { return prev; }
+  bool GetThreshold() const     { return flag_threshold; }
+  int GetID() const             { return id_num; }
+  char GetSymbol() const        { return symbol; }
+
+  // Calculate a crude phylogentic distance based off of tracking parents
+  // and grand-parents, including sexual tracking.
+  int GetPhyloDistance(cGenotype * test_genotype);
+
+  int AddOrganism();
+  int RemoveOrganism();
+  int AddParasite()        { return ++total_parasites; }
+  void SwapOrganism()      { total_organisms++; }
+  int GetNumOrganisms()    { return num_organisms; }
+  int GetTotalOrganisms()  { return total_organisms; }
+  int GetTotalParasites()  { return total_parasites; }
+};
+
+// The genotype pointer template...
+
+
+
+// All the inline stuff...
+
+  ////////////////
+ //  cGenotype //
+////////////////
+
+inline void cGenotype::SetThreshold()
+{
+  flag_threshold = true;
+  if (symbol == '.') symbol = '+';
+}
+
+
+inline void cGenotype::SetBreedStats(cGenotype & daughter)
+{
+  birth_data.birth_track.Inc();
+  if (daughter.id_num == id_num) {
+    birth_data.breed_true_track.Inc();
+  } else {
+    birth_data.breed_out_track.Inc();
+    daughter.birth_data.breed_in_track.Inc();
+  }
+}
+
+#endif

Copied: development/source/classification/cGenotypeControl.cc (from rev 392, development/source/main/cGenotypeControl.cc)
===================================================================
--- development/source/main/cGenotypeControl.cc	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cGenotypeControl.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,277 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 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 "cGenotypeControl.h"
+
+#include "defs.h"
+#include "cClassificationManager.h"
+#include "cGenotype.h"
+#include "cWorld.h"
+
+cGenotypeControl::cGenotypeControl(cWorld* world) : m_world(world)
+{
+  size = 0;
+  best = NULL;
+  coalescent = NULL;
+  for (int i = 0; i < nGenotype::THREADS; i++) threads[i] = NULL;
+
+  historic_list = NULL;
+  historic_count = 0;
+}
+
+cGenotypeControl::~cGenotypeControl()
+{
+}
+
+bool cGenotypeControl::OK()
+{
+  int ret_value = true;
+
+  // Cycle through the list, making sure all connections are proper, size
+  // is correct, and all genotypes are OK().
+
+  cGenotype * cur_pos = best;
+  for (int i = 0; i < size; i++) {
+    if (!cur_pos->OK()) ret_value = false;
+    assert (cur_pos->GetNext()->GetPrev() == cur_pos);
+    cur_pos = cur_pos->GetNext();
+  }
+
+  assert (cur_pos == best);
+
+  return ret_value;
+}
+
+void cGenotypeControl::Insert(cGenotype & in_genotype, cGenotype * prev_genotype)
+{
+  if (prev_genotype == NULL) {
+    assert(size == 0); // Destroying a full genotype queue...
+
+    best = &in_genotype;
+    best->SetNext(best);
+    best->SetPrev(best);
+  }
+  else {
+    in_genotype.SetPrev(prev_genotype);
+    in_genotype.SetNext(prev_genotype->GetNext());
+    prev_genotype->SetNext(&in_genotype);
+    in_genotype.GetNext()->SetPrev(&in_genotype);
+  }
+
+  size++;
+}
+
+void cGenotypeControl::Remove(cGenotype & in_genotype)
+{
+  if (size == 1) {
+    best = NULL;
+  }
+  if (&in_genotype == best) {
+    best = best->GetNext();
+  }
+
+  in_genotype.GetNext()->SetPrev(in_genotype.GetPrev());
+  in_genotype.GetPrev()->SetNext(in_genotype.GetNext());
+  in_genotype.SetNext(NULL);
+  in_genotype.SetPrev(NULL);
+
+  size--;
+}
+
+void cGenotypeControl::RemoveHistoric(cGenotype & in_genotype)
+{
+  if (historic_count == 1) {
+    historic_list = NULL;
+  }
+  if (&in_genotype == historic_list) {
+    historic_list = historic_list->GetNext();
+  }
+
+  in_genotype.GetNext()->SetPrev(in_genotype.GetPrev());
+  in_genotype.GetPrev()->SetNext(in_genotype.GetNext());
+  in_genotype.SetNext(NULL);
+  in_genotype.SetPrev(NULL);
+
+  historic_count--;
+}
+
+void cGenotypeControl::InsertHistoric(cGenotype & in_genotype)
+{
+  if (historic_count == 0) {
+    in_genotype.SetNext(&in_genotype);
+    in_genotype.SetPrev(&in_genotype);
+  }
+  else {
+    in_genotype.SetPrev(historic_list->GetPrev());
+    in_genotype.SetNext(historic_list);
+    historic_list->GetPrev()->SetNext(&in_genotype);
+    historic_list->SetPrev(&in_genotype);
+  }
+
+  historic_list = &in_genotype;
+  historic_count++;
+}
+
+
+int cGenotypeControl::UpdateCoalescent()
+{
+  // Test to see if any updating needs to be done...
+  // Don't update active coalescent genotype, or if there is more than
+  // one offspring.
+  if (coalescent != NULL &&
+      (coalescent->GetNumOrganisms() > 0 ||
+       coalescent->GetNumOffspringGenotypes() > 1)) {
+    return coalescent->GetDepth();
+  }
+
+  // If there is no best, there is nothing to search through...
+  if (best == NULL) return -1;
+
+  // Find the new point...
+  cGenotype * test_gen = best;
+  cGenotype * found_gen = best;
+  cGenotype * parent_gen = best->GetParentGenotype();
+
+  while (parent_gen != NULL) {
+    // See if this genotype should be the new found genotype...
+    if (test_gen->GetNumOrganisms() > 0 ||
+	test_gen->GetNumOffspringGenotypes() > 1) {
+      found_gen = test_gen;
+    }
+
+    // Move to the next genotype...
+    test_gen = parent_gen;
+    parent_gen = test_gen->GetParentGenotype();
+  }
+
+  coalescent = found_gen;
+
+  return coalescent->GetDepth();
+}
+
+
+bool cGenotypeControl::CheckPos(cGenotype & in_genotype)
+{
+  int next_OK = false;
+  int prev_OK = false;
+
+  if (in_genotype.GetNumOrganisms() >= in_genotype.GetNext()->GetNumOrganisms()) {
+    next_OK =true;
+  }
+  if (in_genotype.GetNumOrganisms() <= in_genotype.GetPrev()->GetNumOrganisms()) {
+    prev_OK =true;
+  }
+
+  if ( (next_OK && prev_OK) ||
+       (&in_genotype == best && next_OK) ||
+       (&in_genotype == best->GetPrev() && prev_OK)) {
+    return true;
+  }
+
+  return false;
+}
+
+void cGenotypeControl::Insert(cGenotype & new_genotype)
+{
+  // If there is nothing in the list, add this.
+
+  if (size == 0) {
+    Insert(new_genotype, NULL);
+  }
+
+  // Otherwise tack it on the end.
+
+  else {
+    Insert(new_genotype, best->GetPrev());
+  }
+}
+
+bool cGenotypeControl::Adjust(cGenotype & in_genotype)
+{
+  cGenotype * cur_genotype = in_genotype.GetPrev();
+
+  // Check to see if this genotype should be removed completely.
+
+  if (in_genotype.GetNumOrganisms() == 0 &&
+      in_genotype.GetDeferAdjust() == false) {
+    m_world->GetClassificationManager().RemoveGenotype(in_genotype);
+    return false;
+  }
+
+  // Do not adjust the position of this genotype if it was and still is the
+  // best genotype, or if it is otherwise in the proper spot...
+
+  if (CheckPos(in_genotype)) {
+    return true;
+  }
+
+  // Otherwise, remove it from the queue (for just the moment).
+
+  Remove(in_genotype);
+
+  // If this genotype is the best, put it there.
+
+  if (in_genotype.GetNumOrganisms() > best->GetNumOrganisms()) {
+    Insert(in_genotype, best->GetPrev());
+    best = &in_genotype;
+    return true;
+  }
+
+  // Finally, find out where this genotype *does* go.
+
+  while (cur_genotype->GetNumOrganisms() >= in_genotype.GetNumOrganisms() &&
+	 cur_genotype != best->GetPrev()) {
+    cur_genotype = cur_genotype->GetNext();
+  }
+  while (cur_genotype->GetNumOrganisms() < in_genotype.GetNumOrganisms() &&
+	 cur_genotype != best) {
+    cur_genotype = cur_genotype->GetPrev();
+  }
+
+  Insert(in_genotype, cur_genotype);
+
+  return true;
+}
+
+
+cGenotype * cGenotypeControl::Find(const cGenome & in_genome) const
+{
+  int i;
+  cGenotype * cur_genotype = best;
+
+  for (i = 0; i < size; i++) {
+    if (in_genome == cur_genotype->GetGenome()) {
+      return cur_genotype;
+    }
+    cur_genotype = cur_genotype->GetNext();
+  }
+
+  return NULL;
+}
+
+int cGenotypeControl::FindPos(cGenotype & in_genotype, int max_depth)
+{
+  cGenotype * temp_genotype = best;
+  if (max_depth < 0 || max_depth > size) max_depth = size;
+
+  for (int i = 0; i < max_depth; i++) {
+    if (temp_genotype == &in_genotype) return i;
+    temp_genotype = temp_genotype->GetNext();
+  }
+
+  return -1;
+}
+
+cGenotype * cGenotypeControl::Next(int thread)
+{
+  return threads[thread] = threads[thread]->GetNext();
+}
+
+cGenotype * cGenotypeControl::Prev(int thread)
+{
+  return threads[thread] = threads[thread]->GetPrev();
+}

Copied: development/source/classification/cGenotypeControl.h (from rev 392, development/source/main/cGenotypeControl.h)
===================================================================
--- development/source/main/cGenotypeControl.h	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cGenotypeControl.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,63 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 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 cGenotypeControl_h
+#define cGenotypeControl_h
+
+#ifndef nGenotype_h
+#include "nGenotype.h"
+#endif
+
+class cGenome;
+class cGenotype;
+class cWorld;
+
+class cGenotypeControl {
+private:
+  cWorld* m_world;
+  int size;
+  cGenotype* best;
+  cGenotype* coalescent;
+  cGenotype* threads[nGenotype::THREADS];
+
+  cGenotype * historic_list;
+  int historic_count;
+
+  void Insert(cGenotype & in_genotype, cGenotype * prev_genotype);
+  bool CheckPos(cGenotype & in_genotype);
+public:
+  cGenotypeControl(cWorld* world);
+  ~cGenotypeControl();
+
+  bool OK();
+  void Remove(cGenotype & in_genotype);
+  void Insert(cGenotype & new_genotype);
+  bool Adjust(cGenotype & in_genotype);
+
+  void RemoveHistoric(cGenotype & in_genotype);
+  void InsertHistoric(cGenotype & in_genotype);
+  int GetHistoricCount() { return historic_count; }
+
+  int UpdateCoalescent();
+
+  inline int GetSize() const { return size; }
+  inline cGenotype * GetBest() const { return best; }
+  inline cGenotype * GetCoalescent() const { return coalescent; }
+
+  cGenotype * Find(const cGenome & in_genome) const;
+  int FindPos(cGenotype & in_genotype, int max_depth = -1);
+
+  inline cGenotype * Get(int thread) const { return threads[thread]; }
+  inline cGenotype * Reset(int thread)
+    { return threads[thread] = best; }
+  inline cGenotype * ResetHistoric(int thread)
+    { return threads[thread] = historic_list; }
+  cGenotype * Next(int thread);
+  cGenotype * Prev(int thread);
+};
+
+#endif

Copied: development/source/classification/cGenotype_BirthData.cc (from rev 392, development/source/main/cGenotype_BirthData.cc)

Copied: development/source/classification/cGenotype_BirthData.h (from rev 392, development/source/main/cGenotype_BirthData.h)

Copied: development/source/classification/cGenotype_TestData.cc (from rev 392, development/source/main/cGenotype_TestData.cc)

Copied: development/source/classification/cGenotype_TestData.h (from rev 392, development/source/main/cGenotype_TestData.h)

Copied: development/source/classification/cInjectGenotype.cc (from rev 392, development/source/main/cInjectGenotype.cc)
===================================================================
--- development/source/main/cInjectGenotype.cc	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cInjectGenotype.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,148 @@
+/*
+ *  cInjectGenotype.cc
+ *  Avida
+ *
+ *  Created by David on 11/15/05.
+ *  Copyright 2005 Michigan State University. All rights reserved.
+ *  Copyright 1993-2003 California Institute of Technology.
+ *
+ */
+
+#include "cInjectGenotype.h"
+
+#include "cTools.h"
+#include "cWorld.h"
+
+using namespace std;
+
+cInjectGenotype::cInjectGenotype(cWorld* world, int in_update_born, int in_id)
+  : m_world(world)
+  , genome(1)
+  , name("p001-no_name")
+  , flag_threshold(false)
+  , is_active(true)
+      , can_reproduce(false)
+  , defer_adjust(0)
+  , symbol(0)
+  , birth_data(in_update_born)
+  , num_injected(0)
+  , last_num_injected(0)
+  , total_injected(0)
+  , next(NULL)
+  , prev(NULL)
+{
+}
+
+cInjectGenotype::~cInjectGenotype()
+{
+  // Reset some of the variables to make sure program will crash if a deleted
+  // cell is read!
+  symbol = '!';
+
+  num_injected = -1;
+  total_injected = -1;
+
+  next = NULL;
+  prev = NULL;
+}
+
+bool cInjectGenotype::SaveClone(ofstream& fp)
+{
+  fp << id_num         << " ";
+  fp << genome.GetSize() << " ";
+
+  for (int i = 0; i < genome.GetSize(); i++) {
+    fp << ((int) genome[i].GetOp()) << " ";
+  }
+
+  return true;
+}
+
+bool cInjectGenotype::LoadClone(ifstream & fp)
+{
+  int genome_size = 0;
+
+  fp >> id_num;
+  fp >> genome_size;
+
+  genome = cGenome(genome_size);
+  for (int i = 0; i < genome_size; i++) {
+    cInstruction temp_inst;
+    int inst_op;
+    fp >> inst_op;
+    temp_inst.SetOp((UCHAR) inst_op);
+    genome[i] = temp_inst;
+    // @CAO add something here to load arguments for instructions.
+  }
+
+  return true;
+}
+
+bool cInjectGenotype::OK()
+{
+  bool ret_value = true;
+
+  // Check the components...
+
+  if (!genome.OK()) ret_value = false;
+
+  // And the statistics
+  assert( id_num >= 0 && num_injected >= 0 && total_injected >= 0 );
+  assert( birth_data.update_born >= -1);
+
+  return ret_value;
+}
+
+void cInjectGenotype::SetParent(cInjectGenotype * parent)
+{
+  birth_data.parent_genotype = parent;
+
+  // If we have a real parent genotype, collect other data about parent.
+  if (parent == NULL) return;
+  birth_data.parent_id = parent->GetID();
+  birth_data.gene_depth = parent->GetDepth() + 1;
+  parent->AddOffspringGenotype();
+}
+
+void cInjectGenotype::Mutate()  // Check each location to be mutated.
+{
+  int i;
+
+  for (i = 0; i < genome.GetSize(); i++) {
+      genome[i].SetOp(m_world->GetRandom().GetUInt(m_world->GetNumInstructions()));
+    }
+  
+}
+
+void cInjectGenotype::UpdateReset()
+{
+  last_num_injected = num_injected;
+  birth_data.birth_track.Next();
+  birth_data.death_track.Next();
+}
+
+void cInjectGenotype::SetGenome(const cGenome & in_genome)
+{
+  genome = in_genome;
+
+  name.Set("p%03d-no_name", genome.GetSize());
+}
+
+void cInjectGenotype::Deactivate(int update)
+{
+  is_active = false;
+  birth_data.update_deactivated = update;
+}
+
+int cInjectGenotype::AddParasite()
+{
+  total_injected++;
+  return num_injected++;
+}
+
+int cInjectGenotype::RemoveParasite()
+{
+  //birth_data.death_track.Inc();
+  return num_injected--;
+}
+

Copied: development/source/classification/cInjectGenotype.h (from rev 392, development/source/main/cInjectGenotype.h)
===================================================================
--- development/source/main/cInjectGenotype.h	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cInjectGenotype.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,122 @@
+/*
+ *  cInjectGenotype.h
+ *  Avida
+ *
+ *  Created by David on 11/15/05.
+ *  Copyright 2005 Michigan State University. All rights reserved.
+ *  Copyright 1993-2003 California Institute of Technology.
+ *
+ */
+
+#ifndef cInjectGenotype_h
+#define cInjectGenotype_h
+
+#include <fstream>
+
+#ifndef cGenome_h
+#include "cGenome.h"
+#endif
+#ifndef cInjectGenotype_BirthData_h
+#include "cInjectGenotype_BirthData.h"
+#endif
+#ifndef cString_h
+#include "cString.h"
+#endif
+
+class cWorld;
+
+class cInjectGenotype {
+private:
+  friend class cClassificationManager;
+  
+  cWorld* m_world;
+  cGenome genome;
+  cString name;
+  bool flag_threshold;
+  bool is_active;      // Is this genotype still alive?
+  bool can_reproduce;  // Can this genotype reproduce?
+  int defer_adjust;    // Don't adjust in the archive until all are cleared.
+
+  int id_num;
+  char symbol;
+
+  cInjectGenotype_BirthData birth_data;
+
+  // Statistical info
+  int num_injected;
+  int last_num_injected;
+  int total_injected;
+
+  // Data Structure stuff...
+  cInjectGenotype * next;
+  cInjectGenotype * prev;
+
+  void CalcTestStats() const;
+
+  // Private Constructor
+  cInjectGenotype(cWorld* world, int in_update_born = 0, int in_id = -1);
+  
+  // Disable Default Constructor
+  cInjectGenotype();
+  
+public:
+  ~cInjectGenotype();
+
+  bool SaveClone(std::ofstream& fp);
+  bool LoadClone(std::ifstream & fp);
+  bool OK();
+  void Mutate();
+  void UpdateReset();
+
+  void SetGenome(const cGenome & in_genome);
+
+  void SetParent(cInjectGenotype * parent);
+  void SetUpdateBorn (int update) { birth_data.update_born = update; }
+  void SetName(cString in_name)     { name = in_name; }
+  void SetNext(cInjectGenotype * in_next) { next = in_next; }
+  void SetPrev(cInjectGenotype * in_prev) { prev = in_prev; }
+  void SetSymbol(char in_symbol) { symbol = in_symbol; }
+  void SetCanReproduce() { can_reproduce = true; }
+  inline void SetThreshold();
+  void IncDeferAdjust() { defer_adjust++; }
+  void DecDeferAdjust() { defer_adjust--; assert(defer_adjust >= 0); }
+  
+  //// Properties Native to Genotype ////
+  cGenome & GetGenome()             { return genome; }
+  const cGenome & GetGenome() const { return genome; }
+  int GetLength()             const { return genome.GetSize(); }
+  
+  // For tracking the genotype line back to the ancestor...
+  cInjectGenotype * GetParentGenotype() { return birth_data.parent_genotype; }
+  int GetNumOffspringGenotypes() const { return birth_data.num_offspring_genotypes; }
+  void AddOffspringGenotype() { birth_data.num_offspring_genotypes++; }
+  void RemoveOffspringGenotype() { birth_data.num_offspring_genotypes--; }
+  bool GetActive() const { return is_active; }
+  int GetUpdateDeactivated() { return birth_data.update_deactivated; }
+  void Deactivate(int update);
+
+  bool CanReproduce()           { return can_reproduce; }
+  int GetUpdateBorn()           { return birth_data.update_born; }
+  int GetParentID()             { return birth_data.parent_id; }
+  int GetDepth()                { return birth_data.gene_depth; }
+  cString & GetName()           { return name; }
+  cInjectGenotype * GetNext()         { return next; }
+  cInjectGenotype * GetPrev()         { return prev; }
+  bool GetThreshold() const     { return flag_threshold; }
+  int GetID() const             { return id_num; }
+  char GetSymbol() const        { return symbol; }
+
+  int AddParasite();
+  int RemoveParasite();
+  int GetNumInjected()    { return num_injected; }
+  int GetTotalInjected()  { return total_injected; }
+};
+
+
+inline void cInjectGenotype::SetThreshold()
+{
+  flag_threshold = true;
+  if (symbol == '.') symbol = '+';
+}
+
+#endif

Copied: development/source/classification/cInjectGenotypeControl.cc (from rev 392, development/source/main/cInjectGenotypeControl.cc)
===================================================================
--- development/source/main/cInjectGenotypeControl.cc	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cInjectGenotypeControl.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,280 @@
+/*
+ *  cInjectGenotypeControl.cc
+ *  Avida
+ *
+ *  Created by David on 11/15/05.
+ *  Copyright 2005 Michigan State University. All rights reserved.
+ *  Copyright 1993-2003 California Institute of Technology.
+ *
+ */
+
+#include "cInjectGenotypeControl.h"
+
+#include "defs.h"
+#include "cClassificationManager.h"
+#include "cInjectGenotype.h"
+#include "cWorld.h"
+
+cInjectGenotypeControl::cInjectGenotypeControl(cWorld* world) : m_world(world)
+{
+  size = 0;
+  best = NULL;
+  coalescent = NULL;
+  for (int i = 0; i < nInjectGenotype::THREADS; i++) threads[i] = NULL;
+
+  historic_list = NULL;
+  historic_count = 0;
+}
+
+cInjectGenotypeControl::~cInjectGenotypeControl()
+{
+}
+
+bool cInjectGenotypeControl::OK()
+{
+  int ret_value = true;
+
+  // Cycle through the list, making sure all connections are proper, size
+  // is correct, and all genotypes are OK().
+
+  cInjectGenotype * cur_pos = best;
+  for (int i = 0; i < size; i++) {
+    if (!cur_pos->OK()) ret_value = false;
+    assert (cur_pos->GetNext()->GetPrev() == cur_pos);
+    cur_pos = cur_pos->GetNext();
+  }
+
+  assert (cur_pos == best);
+
+  return ret_value;
+}
+
+void cInjectGenotypeControl::Insert(cInjectGenotype & in_inject_genotype, cInjectGenotype * prev_genotype)
+{
+  if (prev_genotype == NULL) {
+    assert(size == 0); // Destroying a full genotype queue...
+
+    best = &in_inject_genotype;
+    best->SetNext(best);
+    best->SetPrev(best);
+  }
+  else {
+    in_inject_genotype.SetPrev(prev_genotype);
+    in_inject_genotype.SetNext(prev_genotype->GetNext());
+    prev_genotype->SetNext(&in_inject_genotype);
+    in_inject_genotype.GetNext()->SetPrev(&in_inject_genotype);
+  }
+
+  size++;
+}
+
+void cInjectGenotypeControl::Remove(cInjectGenotype & in_inject_genotype)
+{
+  if (size == 1) {
+    best = NULL;
+  }
+  if (&in_inject_genotype == best) {
+    best = best->GetNext();
+  }
+
+  in_inject_genotype.GetNext()->SetPrev(in_inject_genotype.GetPrev());
+  in_inject_genotype.GetPrev()->SetNext(in_inject_genotype.GetNext());
+  in_inject_genotype.SetNext(NULL);
+  in_inject_genotype.SetPrev(NULL);
+
+  size--;
+}
+
+void cInjectGenotypeControl::RemoveHistoric(cInjectGenotype & in_inject_genotype)
+{
+  if (historic_count == 1) {
+    historic_list = NULL;
+  }
+  if (&in_inject_genotype == historic_list) {
+    historic_list = historic_list->GetNext();
+  }
+
+  in_inject_genotype.GetNext()->SetPrev(in_inject_genotype.GetPrev());
+  in_inject_genotype.GetPrev()->SetNext(in_inject_genotype.GetNext());
+  in_inject_genotype.SetNext(NULL);
+  in_inject_genotype.SetPrev(NULL);
+
+  historic_count--;
+}
+
+void cInjectGenotypeControl::InsertHistoric(cInjectGenotype & in_inject_genotype)
+{
+  if (historic_count == 0) {
+    in_inject_genotype.SetNext(&in_inject_genotype);
+    in_inject_genotype.SetPrev(&in_inject_genotype);
+  }
+  else {
+    in_inject_genotype.SetPrev(historic_list->GetPrev());
+    in_inject_genotype.SetNext(historic_list);
+    historic_list->GetPrev()->SetNext(&in_inject_genotype);
+    historic_list->SetPrev(&in_inject_genotype);
+  }
+
+  historic_list = &in_inject_genotype;
+  historic_count++;
+}
+
+/*int cInjectGenotypeControl::UpdateCoalescent()
+{
+  // Test to see if any updating needs to be done...
+  // Don't update active coalescent genotype, or if there is more than
+  // one offspring.
+  if (coalescent != NULL &&
+      (coalescent->GetNumInjected() > 0) ||
+      coalescent->GetNumOffspringGenotypes() > 1) ) {
+    return coalescent->GetDepth();
+  }
+
+  // If there is no best, there is nothing to search through...
+  if (best == NULL) return -1;
+
+  // Find the new point...
+  cInjectGenotype * test_gen = best;
+  cInjectGenotype * found_gen = best;
+  cInjectGenotype * parent_gen = best->GetParentGenotype();
+
+  while (parent_gen != NULL) {
+    // See if this genotype should be the new found genotype...
+    if (test_gen->GetNumOrganisms() > 0 ||
+	test_gen->GetNumOffspringGenotypes() > 1) {
+      found_gen = test_gen;
+    }
+
+    // Move to the next genotype...
+    test_gen = parent_gen;
+    parent_gen = test_gen->GetParentGenotype();
+  }
+
+  coalescent = found_gen;
+
+  return coalescent->GetDepth();
+}*/
+
+
+bool cInjectGenotypeControl::CheckPos(cInjectGenotype & in_inject_genotype)
+{
+  int next_OK = false;
+  int prev_OK = false;
+
+  if (in_inject_genotype.GetNumInjected() >= in_inject_genotype.GetNext()->GetNumInjected()) {
+    next_OK =true;
+  }
+  if (in_inject_genotype.GetNumInjected() <= in_inject_genotype.GetPrev()->GetNumInjected()) {
+    prev_OK =true;
+  }
+
+  if ((&in_inject_genotype == best && next_OK) ||
+      (next_OK && prev_OK) ||
+      (&in_inject_genotype == best->GetPrev() && prev_OK)) {
+    return true;
+  }
+
+  return false;
+}
+
+void cInjectGenotypeControl::Insert(cInjectGenotype & new_genotype)
+{
+  // If there is nothing in the list, add this.
+
+  if (size == 0) {
+    Insert(new_genotype, NULL);
+  }
+
+  // Otherwise tack it on the end.
+
+  else {
+    Insert(new_genotype, best->GetPrev());
+  }
+}
+
+bool cInjectGenotypeControl::Adjust(cInjectGenotype & in_inject_genotype)
+{
+  //if (in_inject_genotype.GetDeferAdjust() == true) return true;
+
+  cInjectGenotype * cur_inject_genotype = in_inject_genotype.GetPrev();
+
+  // Check to see if this genotype should be removed completely.
+
+  if (in_inject_genotype.GetNumInjected() == 0) {
+    m_world->GetClassificationManager().RemoveInjectGenotype(in_inject_genotype);
+    return false;
+  }
+
+  // Do not adjust if this was and still is the best genotype, or is
+  // otherwise in the proper spot...
+
+  if (CheckPos(in_inject_genotype)) {
+    return true;
+  }
+
+  // Otherwise, remove it from the queue for just the moment.
+
+  Remove(in_inject_genotype);
+
+  // Also, if this genotype is the best, put it there.
+
+  if (in_inject_genotype.GetNumInjected() > best->GetNumInjected()) {
+    Insert(in_inject_genotype, best->GetPrev());
+    best = &in_inject_genotype;
+    return true;
+  }
+
+  // Finally, find out where this genotype *does* go.
+
+  while (cur_inject_genotype->GetNumInjected() >= in_inject_genotype.GetNumInjected() &&
+	 cur_inject_genotype != best->GetPrev()) {
+    cur_inject_genotype = cur_inject_genotype->GetNext();
+  }
+  while (cur_inject_genotype->GetNumInjected() < in_inject_genotype.GetNumInjected() &&
+	 cur_inject_genotype != best) {
+    cur_inject_genotype = cur_inject_genotype->GetPrev();
+  }
+
+  Insert(in_inject_genotype, cur_inject_genotype);
+
+  return true;
+}
+
+
+cInjectGenotype * cInjectGenotypeControl::Find(const cGenome & in_genome) const
+{
+  int i;
+  cInjectGenotype * cur_inject_genotype = best;
+
+  for (i = 0; i < size; i++) {
+    if (in_genome == cur_inject_genotype->GetGenome()) {
+      return cur_inject_genotype;
+    }
+    cur_inject_genotype = cur_inject_genotype->GetNext();
+  }
+
+  return NULL;
+}
+
+int cInjectGenotypeControl::FindPos(cInjectGenotype & in_inject_genotype, int max_depth)
+{
+  cInjectGenotype * temp_genotype = best;
+  if (max_depth < 0 || max_depth > size) max_depth = size;
+
+  for (int i = 0; i < max_depth; i++) {
+    if (temp_genotype == &in_inject_genotype) return i;
+    temp_genotype = temp_genotype->GetNext();
+  }
+
+  return -1;
+}
+
+cInjectGenotype * cInjectGenotypeControl::Next(int thread)
+{
+  return threads[thread] = threads[thread]->GetNext();
+}
+
+cInjectGenotype * cInjectGenotypeControl::Prev(int thread)
+{
+  return threads[thread] = threads[thread]->GetPrev();
+}

Copied: development/source/classification/cInjectGenotypeControl.h (from rev 392, development/source/main/cInjectGenotypeControl.h)
===================================================================
--- development/source/main/cInjectGenotypeControl.h	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cInjectGenotypeControl.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,65 @@
+/*
+ *  cInjectGenotypeControl.h
+ *  Avida
+ *
+ *  Created by David on 11/15/05.
+ *  Copyright 2005 Michigan State University. All rights reserved.
+ *  Copyright 1993-2003 California Institute of Technology.
+ *
+ */
+
+#ifndef cInjectGenotypeControl_h
+#define cInjectGenotypeControl_h
+
+#ifndef nInjectGenotype_h
+#include "nInjectGenotype.h"
+#endif
+
+class cGenome;
+class cInjectGenotype;
+class cWorld;
+
+class cInjectGenotypeControl {
+private:
+  cWorld* m_world;
+  int size;
+  cInjectGenotype* best;
+  cInjectGenotype* coalescent;
+  cInjectGenotype* threads[nInjectGenotype::THREADS];
+
+  cInjectGenotype* historic_list;
+  int historic_count;
+
+  void Insert(cInjectGenotype& in_inject_genotype, cInjectGenotype* prev_inject_genotype);
+  bool CheckPos(cInjectGenotype& in_inject_genotype);
+
+public:
+  cInjectGenotypeControl(cWorld* world);
+  ~cInjectGenotypeControl();
+
+  bool OK();
+  void Remove(cInjectGenotype & in_inject_genotype);
+  void Insert(cInjectGenotype & new_inject_genotype);
+  bool Adjust(cInjectGenotype & in_inject_genotype);
+
+  void RemoveHistoric(cInjectGenotype & in_inject_genotype);
+  void InsertHistoric(cInjectGenotype & in_inject_genotype);
+  int GetHistoricCount() { return historic_count; }
+
+  inline int GetSize() const { return size; }
+  inline cInjectGenotype * GetBest() const { return best; }
+  inline cInjectGenotype * GetCoalescent() const { return coalescent; }
+
+  cInjectGenotype * Find(const cGenome & in_genome) const;
+  int FindPos(cInjectGenotype & in_inject_genotype, int max_depth = -1);
+
+  inline cInjectGenotype * Get(int thread) const { return threads[thread]; }
+  inline cInjectGenotype * Reset(int thread)
+    { return threads[thread] = best; }
+  inline cInjectGenotype * ResetHistoric(int thread)
+    { return threads[thread] = historic_list; }
+  cInjectGenotype * Next(int thread);
+  cInjectGenotype * Prev(int thread);
+};
+
+#endif

Copied: development/source/classification/cInjectGenotypeElement.h (from rev 392, development/source/main/cInjectGenotypeElement.h)

Copied: development/source/classification/cInjectGenotypeQueue.cc (from rev 392, development/source/main/cInjectGenotypeQueue.cc)

Copied: development/source/classification/cInjectGenotypeQueue.h (from rev 392, development/source/main/cInjectGenotypeQueue.h)

Copied: development/source/classification/cInjectGenotype_BirthData.cc (from rev 392, development/source/main/cInjectGenotype_BirthData.cc)

Copied: development/source/classification/cInjectGenotype_BirthData.h (from rev 392, development/source/main/cInjectGenotype_BirthData.h)

Copied: development/source/classification/cLineage.cc (from rev 392, development/source/main/cLineage.cc)
===================================================================
--- development/source/main/cLineage.cc	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cLineage.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,143 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 LINEAGE_HH
+#include "cLineage.h"
+#endif
+#ifndef GENOTYPE_HH
+#include "cGenotype.h"
+#endif
+
+using namespace std;
+
+
+bool gt_gentype::operator()(const cGenotype * g1, const cGenotype * g2) const
+{
+  return g1->GetID() > g2->GetID();
+}
+
+cLineage::cLineage(double start_fitness, int parent_id, int id, int update,
+		   double generation,  double lineage_stat1, double lineage_stat2)
+  : m_id(id)
+  , m_parent_id(parent_id)
+  , m_update_born(update)
+  , m_num_CPUs(0)
+  , m_total_CPUs(0)
+  , m_total_genotypes(0)
+  , m_generation_born(generation)
+  , m_lineage_stat1(lineage_stat1)
+  , m_lineage_stat2(lineage_stat2)
+{
+  m_start_fitness = m_max_fitness = m_max_fitness_ever = start_fitness;
+  m_ave_fitness = 0;
+  m_ave_fitness_changed = true;
+  m_threshold = false;
+}
+
+void cLineage::AddCreature(cGenotype * genotype)
+{
+  // add the new genotype to the map if necessary, otherwise
+  // find its position
+  pair<map<const cGenotype *, int, gt_gentype>::iterator, bool> p =
+    m_genotype_map.insert( pair<const cGenotype*, int>( genotype, 0 ) );
+
+  // did we add a new genotype?
+  if ( ( p.second ) == true )
+    m_total_genotypes += 1;
+
+  // increase the count for the given genotype by one.
+  (*(p.first)).second += 1;
+
+  // The above lines could be written like that:
+  //     m_genotype_map[ genotype ] += 1;
+  // if we didn't want to count how often we add a new genotype
+
+  double fitness = genotype->GetTestColonyFitness();
+
+  // adjust the current maximum fitness
+  if ( fitness > m_max_fitness )
+    m_max_fitness = fitness;
+   // adjust overall maxiumum fitness
+  if ( fitness> m_max_fitness_ever )
+    m_max_fitness_ever = fitness;
+  // the average fitness has changed as well
+  m_ave_fitness_changed = true;
+
+  m_num_CPUs++;
+  m_total_CPUs++;
+}
+
+bool cLineage::RemoveCreature(cGenotype * genotype)
+{
+  // we return true if the removal of this creature triggers a
+  // recalculation of the best lineage
+  bool result = false;
+
+  map<const cGenotype *, int, gt_gentype>::iterator cur = m_genotype_map.find( genotype );
+
+  // is the genotype part of the map?
+  if ( cur == m_genotype_map.end() ){
+    cerr << "Removing creature from lineage whose genotype is not part of the lineage!" << endl;
+    cerr << "  " << genotype->GetName()() << " " << GetID() << endl;
+    return false;
+  }
+
+  // yes, decrease the count
+  (*cur).second -= 1;
+  // and adjust the average fitness
+  m_ave_fitness_changed = true;
+
+  double fitness = genotype->GetTestColonyFitness();
+
+  // did we reach zero?
+  if ( (*cur).second == 0 ){
+    // yes, remove the entry
+    m_genotype_map.erase( cur );
+    // make sure that the maximum fitness is correct
+    if (fitness == m_max_fitness) CalcCurrentFitness();
+    // adjust the return value
+    result = true;
+  }
+
+  // and now the total cpu count
+  m_num_CPUs--;
+
+  return result;
+}
+
+int cLineage::CountNumCreatures() const
+{
+  int creature_count = 0;
+
+  map<const cGenotype *, int, gt_gentype>::const_iterator it =
+    m_genotype_map.begin();
+
+  for ( ; it!=m_genotype_map.end(); it++ )
+    creature_count += (*it).second;
+
+  return creature_count;
+}
+
+void cLineage::CalcCurrentFitness() const
+{
+  m_max_fitness = 0.0;
+  map<const cGenotype *, int, gt_gentype>::const_iterator it =
+    m_genotype_map.begin();
+
+  // we calculate the average fitness as well, since it is so easy.
+  m_ave_fitness = 0;
+  for ( ; it!=m_genotype_map.end(); it++ ){
+    double fitness = (*it).first->GetTestColonyFitness();
+    if (fitness > m_max_fitness) m_max_fitness = fitness;
+    if (fitness > m_max_fitness_ever) m_max_fitness_ever = fitness;
+    m_ave_fitness += fitness * (*it).second;
+  }
+  m_ave_fitness /= (double) m_num_CPUs;
+  m_ave_fitness_changed = false;
+}
+
+

Copied: development/source/classification/cLineage.h (from rev 392, development/source/main/cLineage.h)
===================================================================
--- development/source/main/cLineage.h	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cLineage.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,168 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 LINEAGE_HH
+#define LINEAGE_HH
+
+#include <map>
+
+class cGenotype;
+
+// struct to compare to genotypes
+struct gt_gentype
+{
+  bool operator()(const cGenotype * g1, const cGenotype * g2) const;
+};
+
+class cLineage {
+private:
+  friend class cClassificationManager;
+  
+  int m_id;
+  int m_parent_id;
+  int m_update_born;
+  int m_num_CPUs;
+  int m_total_CPUs;
+  int m_total_genotypes;
+  double m_start_fitness;
+  mutable double m_max_fitness;
+  mutable double m_ave_fitness;
+  double m_generation_born;
+
+  std::map<const cGenotype *, int, gt_gentype> m_genotype_map;
+  bool m_threshold;
+  mutable bool m_ave_fitness_changed;
+  mutable double m_max_fitness_ever;
+  double m_lineage_stat1;
+  double m_lineage_stat2;
+
+  void CalcCurrentFitness() const;
+
+  /**
+    * Creates a new lineage with a given start fitness and parent id.
+   * The first genotype has to be added with AddGenotype later.
+   *
+   * @param start_fitness The initial fitness of the lineage.
+   * @param parent_id The id of the parent's lineage.
+   * @param id The requested id for this lineage. If negative, a generated
+   * value is used. Attention: if you request lineage id's, it is your
+   * responsibility not to request two identical ones for different lineages
+   * (the class @ref cLineageControl does that correctly).
+   **/
+  cLineage(double start_fitness, int parent_id, int id,
+           int update, double generation,
+           double lineage_stat1 = 0.0, double lineage_stat2 = 0.0);
+  
+  cLineage();
+
+public:
+  ~cLineage() { ; }
+
+  /**
+   * Adds one instance of the given genotype to the lineage.
+   **/
+  void AddCreature( cGenotype * genotype );
+
+  /**
+   * Removes on instance of the given genotype from the lineage.
+   *
+   * @return True if the removal of this creature potentially creates a new
+   * best lineage, otherwise false.
+   **/
+  bool RemoveCreature( cGenotype * genotype );
+  void SetThreshold() { m_threshold = true; }
+
+  /**
+   * @return The id of the lineage.
+   **/
+  int GetID() const { return m_id; }
+
+  /**
+   * @return The id of the parent lineage.
+   **/
+  int GetParentID() const { return m_parent_id; }
+
+  /**
+   * @return The update at which the lineage was created.
+   **/
+  int GetUpdateBorn() const { return m_update_born; }
+
+  /**
+   * @return The generation at which the lineage was created.
+   **/
+  double GetGenerationBorn() const { return m_generation_born; }
+
+  /**
+   * @return The initial fitness of the lineage.
+   **/
+  double GetStartFitness() const { return m_start_fitness; }
+
+  /**
+   * @return The current maximum fitness of the lineage.
+   **/
+  double GetMaxFitness() const { return m_max_fitness; }
+  
+  /**
+   * @return The average fitness of the lineage.
+   **/
+  double GetAveFitness() const {
+    if ( m_ave_fitness_changed )
+      CalcCurrentFitness();
+    return m_ave_fitness; }
+
+  /**
+   * @return The current number of genotypes in the lineage.
+   **/
+  int GetNumGenotypes() const { return m_genotype_map.size(); }
+
+  /**
+   * @return The current number of creatures in the lineage.
+   **/
+  int GetNumCreatures() const { return m_num_CPUs; }
+
+  /**
+   * Counts the number of creatures in the lineage.
+   *
+   * Should always equal GetNumCreatures(), otherwise something
+   * is wrong.
+   **/
+  int CountNumCreatures() const;
+
+  /**
+   * @return The total number of creatures that have ever existed
+   * in this lineage.
+   **/
+  int GetTotalCreatures() const { return m_total_CPUs; }
+
+  /**
+   * @return The total number of genotypes that have ever been part
+   * of this lineage.
+   **/
+  int GetTotalGenotypes() const { return m_total_genotypes; }
+
+  bool GetThreshold() const { return m_threshold; }
+    
+  /**
+   * @return The maximum fitness ever attained by this lineage
+   **/
+  double GetMaxFitnessEver() const { return m_max_fitness_ever; }
+
+  /**
+   * @return The value of the first fitness criteria for
+   * the creation of this lineage
+   **/
+  double GetLineageStat1 () const { return m_lineage_stat1; }
+
+  /**
+   * @return The value of the second fitness criteria for
+   * the creation of this lineage
+   **/
+  double GetLineageStat2 () const { return m_lineage_stat2; }
+
+};
+
+#endif

Copied: development/source/classification/cSpecies.cc (from rev 392, development/source/main/cSpecies.cc)
===================================================================
--- development/source/main/cSpecies.cc	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cSpecies.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,171 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 "cSpecies.h"
+
+#include "cCPUTestInfo.h"
+#include "functions.h"
+#include "cGenotype.h"
+#include "cGenomeUtil.h"
+#include "cTestCPU.h"
+
+using namespace std;
+
+cSpecies::cSpecies(cWorld* world, const cGenome & in_genome, int update, int in_id)
+  : m_world(world)
+  , id_num(in_id)
+  , genome(in_genome)
+  , update_born(update)
+{
+  parent_id = -1;
+  symbol = '+';
+
+  num_genotypes = 0;
+  num_threshold = 0;
+  total_organisms = 0;
+  total_genotypes = 0;
+
+  queue_type = SPECIES_QUEUE_NONE;
+
+  next = NULL;
+  prev = NULL;
+
+  // Track distance of each genome as it is passed in...
+  for (int i = 0; i < SPECIES_MAX_DISTANCE; i++) {
+    genotype_distance[i] = 0;
+  }
+}
+
+cSpecies::~cSpecies()
+{
+  int i, total_count = 0;
+  for (i = 0; i < SPECIES_MAX_DISTANCE; i++) {
+    total_count += genotype_distance[i];
+  }
+
+#ifdef TEST
+  // Only print out the non-trivial species.
+
+  if (total_count > 1) {
+    FILE * fp = stats.GetTestFP();
+
+    fprintf(fp, "Species %3d: ", id_num);
+    for (i = 0; i < SPECIES_MAX_DISTANCE; i++) {
+      fprintf(fp, "%2d ", genotype_distance[i]);
+    }
+    fprintf(fp, "\n");
+    fflush(fp);
+  }
+#endif
+}
+
+// This method compares a second genome to this species and determines
+// how different it is.  A -1 indicates a critical failure (like one of
+// the genomes being considered is not viable), otherwise the count
+// Of failed crossovers is returned.
+// @CAO Todo: Check phenotypes, allow failure proportional to size.
+
+int cSpecies::Compare(const cGenome & test_genome, int max_fail_count)
+{
+  cCPUTestInfo test_info;
+
+  // First, make some phenotypic comparisons between organisms.
+  // For now, just check that they both copy-true.
+
+  m_world->GetTestCPU().TestGenome(test_info, test_genome);
+
+  // If the organisms aren't viable, return a -1...
+  if (test_info.IsViable() == false) {
+    return -1;
+  }
+
+  // Find the optimal offset between organisms, and related variables.
+  // @CAO: For the moment, lets not worry about offsets...
+  // The first line of B is at line 'offset' of A. 
+  //int offset = cGenomeUtil::FindBestOffset(genome, test_genome);
+
+
+  // Figure out how much of the organisms overlap, and how much doesn't.
+  int overlap = Min(genome.GetSize(), test_genome.GetSize());
+  int fail_count = Max(genome.GetSize(), test_genome.GetSize()) - overlap;
+
+
+  // Do the crossovers at all posible points.
+  // Start with the first direction crossover...
+
+  bool cross1_viable = true;
+  bool cross2_viable = true;
+  cGenome cross_genome1(genome);
+  cGenome cross_genome2(test_genome);
+
+  for (int i = 0; i < overlap; i++) {
+    // If this position has changed, check if crossovers here are viable.
+    if (test_genome[i] != genome[i]) {
+      // Continue crossing over on each side...
+      cross_genome1[i] = test_genome[i];
+      cross_genome2[i] = genome[i];
+   
+      // Run each side, and determine viability...
+      m_world->GetTestCPU().TestGenome(test_info, cross_genome1);
+      cross1_viable = test_info.IsViable();
+
+      m_world->GetTestCPU().TestGenome(test_info, cross_genome2);
+      cross2_viable = test_info.IsViable();
+    }
+
+    if (cross1_viable == false) fail_count++;
+    if (cross2_viable == false) fail_count++;
+
+    if (max_fail_count != -1 && fail_count > max_fail_count) break;
+  }
+
+
+  return fail_count;
+}
+
+bool cSpecies::OK()
+{
+  assert(id_num >= 0);  // Species has negative ID value!
+  assert(genome.OK());  // Species genome not registering as OK!
+
+  // Assert valid statistics in species.
+  assert(total_organisms >= 0 && total_genotypes >= 0 &&
+	 num_threshold >= 0 && num_genotypes >= 0);
+
+  // Finally, make sure the species is registered as being in a queue.
+
+  assert(queue_type >= 0 && queue_type <= 3); // Species not in a proper queue
+
+  return true;
+}
+
+void cSpecies::AddThreshold(cGenotype & in_genotype)
+{
+  const int distance = 
+    cGenomeUtil::FindEditDistance(genome, in_genotype.GetGenome());
+
+  if (distance >= 0 && distance < SPECIES_MAX_DISTANCE)
+    genotype_distance[distance]++;
+
+  num_threshold++;
+}
+
+void cSpecies::RemoveThreshold(cGenotype & in_genotype)
+{
+  total_genotypes++;
+  total_organisms += in_genotype.GetTotalOrganisms();
+  num_threshold--;
+}
+
+void cSpecies::AddGenotype()
+{
+  num_genotypes++;
+}
+
+void cSpecies::RemoveGenotype() {
+  num_genotypes--;
+}

Copied: development/source/classification/cSpecies.h (from rev 392, development/source/main/cSpecies.h)
===================================================================
--- development/source/main/cSpecies.h	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cSpecies.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,94 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 SPECIES_HH
+#define SPECIES_HH
+
+#include <fstream>
+
+#ifndef GENOME_HH
+#include "cGenome.h"
+#endif
+
+#define SPECIES_QUEUE_NONE     0
+#define SPECIES_QUEUE_ACTIVE   1
+#define SPECIES_QUEUE_INACTIVE 2
+#define SPECIES_QUEUE_GARBAGE  3
+
+#define SPECIES_MAX_DISTANCE 20
+
+class cGenotype;
+class cWorld;
+
+class cSpecies {
+private:
+  friend class cClassificationManager;
+  
+  cWorld* m_world;
+  int id_num;
+  int parent_id;
+  cGenome genome;
+  int update_born;
+
+  int total_organisms;
+  int total_genotypes;
+  int num_threshold;
+  int num_genotypes;
+  int num_organisms;
+  int queue_type;
+  char symbol;
+  int genotype_distance[SPECIES_MAX_DISTANCE];
+
+  cSpecies * next;
+  cSpecies * prev;
+  
+  cSpecies(cWorld* world, const cGenome& in_genome, int update, int in_id);
+  cSpecies();
+  
+public:
+  ~cSpecies();
+
+  int Compare(const cGenome & test_genome, int max_fail_count=-1);
+  bool OK();
+
+  void AddThreshold(cGenotype & in_genotype);
+  void RemoveThreshold(cGenotype & in_genotype);
+  void AddGenotype();
+  void RemoveGenotype();
+
+  void AddOrganisms(int in_num) { num_organisms += in_num; }
+  void ResetStats() { num_organisms = 0; }
+
+  cSpecies * GetNext() { return next; }
+  cSpecies * GetPrev() { return prev; }
+
+  int GetID() { return id_num; }
+  int GetParentID() { return parent_id; }
+  const cGenome & GetGenome() { return genome; }
+  int GetUpdateBorn() { return update_born; }
+  int GetNumGenotypes() { return num_genotypes; }
+  int GetNumThreshold() { return num_threshold; }
+  int GetNumOrganisms() { return num_organisms; }
+  int GetTotalOrganisms() { return total_organisms; }
+  int GetTotalGenotypes() { return total_genotypes; }
+  int GetQueueType() { return queue_type; }
+  char GetSymbol() { return symbol; }
+
+  void SetQueueType(int in_qt) { queue_type = in_qt; }
+  void SetNext(cSpecies * in_next) { next = in_next; }
+  void SetPrev(cSpecies * in_prev) { prev = in_prev; }
+  void SetSymbol(char in_symbol) { symbol = in_symbol; }
+  void SetParentID(int in_id) { parent_id = in_id; }
+
+#ifdef DEBUG
+  // These are used in cClassificationManager::OK()
+  int debug_num_genotypes;
+  int debug_num_threshold;
+#endif
+};
+
+#endif

Copied: development/source/classification/cSpeciesControl.cc (from rev 392, development/source/main/cSpeciesControl.cc)
===================================================================
--- development/source/main/cSpeciesControl.cc	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cSpeciesControl.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,150 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 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 "cSpeciesControl.h"
+
+#include "defs.h"
+#include "cGenotype.h"
+#include "nSpecies.h"
+#include "cSpecies.h"
+#include "cStats.h"
+#include "cWorld.h"
+
+#include <assert.h>
+
+cSpeciesControl::cSpeciesControl(cWorld* world) : m_world(world)
+{
+}
+
+cSpeciesControl::~cSpeciesControl()
+{
+}
+
+void cSpeciesControl::Remove(cSpecies & in_species)
+{
+  switch (in_species.GetQueueType()) {
+  case SPECIES_QUEUE_ACTIVE:
+    active_queue.Remove(in_species);
+    break;
+  case SPECIES_QUEUE_INACTIVE:
+    inactive_queue.Remove(in_species);
+    break;
+  case SPECIES_QUEUE_GARBAGE:
+    garbage_queue.Remove(in_species);
+    break;
+  default:
+    break;
+  }
+
+  in_species.SetQueueType(SPECIES_QUEUE_NONE);
+}
+
+void cSpeciesControl::Adjust(cSpecies & in_species)
+{
+  // Only adjust if this species is in the active queue.
+
+  if (in_species.GetQueueType() == SPECIES_QUEUE_ACTIVE) {
+    active_queue.Adjust(in_species);
+  }
+}
+
+void cSpeciesControl::SetActive(cSpecies & in_species)
+{
+  Remove(in_species);
+  active_queue.InsertRear(in_species);
+  in_species.SetQueueType(SPECIES_QUEUE_ACTIVE);
+}
+
+void cSpeciesControl::SetInactive(cSpecies & in_species)
+{
+  Remove(in_species);
+  inactive_queue.InsertRear(in_species);
+  in_species.SetQueueType(SPECIES_QUEUE_INACTIVE);
+}
+
+void cSpeciesControl::SetGarbage(cSpecies & in_species)
+{
+  Remove(in_species);
+  garbage_queue.InsertRear(in_species);
+  in_species.SetQueueType(SPECIES_QUEUE_GARBAGE);
+}
+
+bool cSpeciesControl::OK()
+{
+  int ret_value = true;
+
+  // Check the queues.
+
+  assert (active_queue.OK(SPECIES_QUEUE_ACTIVE));
+  assert (inactive_queue.OK(SPECIES_QUEUE_INACTIVE));
+  assert (garbage_queue.OK(SPECIES_QUEUE_GARBAGE));
+
+  return ret_value;
+}
+
+int cSpeciesControl::FindPos(cSpecies & in_species, int max_depth)
+{
+  cSpecies * temp_species = active_queue.GetFirst();
+  if (max_depth < 0 || max_depth > active_queue.GetSize()) {
+    max_depth = active_queue.GetSize();
+  }
+
+  for (int i = 0; i < max_depth; i++) {
+    if (temp_species == &in_species) return i;
+    temp_species = temp_species->GetNext();
+  }
+
+  return -1;
+}
+
+cSpecies * cSpeciesControl::Find(cGenotype & in_genotype, int record_level)
+{
+  cSpecies * found_species = NULL;
+  int cur_count, best_count = MAX_CREATURE_SIZE;
+  cSpecies * cur_species;
+  const int species_threshold = m_world->GetConfig().SPECIES_THRESHOLD.Get();
+
+  if (record_level == nSpecies::RECORD_FULL) {
+    cur_species = active_queue.GetFirst();
+    int size = active_queue.GetSize();
+    for (int i = 0; i < size; i++) {
+      cur_count = cur_species->Compare(in_genotype.GetGenome(), species_threshold);
+      if (cur_count != -1 && cur_count <= species_threshold && cur_count < best_count) {
+        found_species = cur_species;
+        best_count = cur_count;
+      }
+      cur_species = cur_species->GetNext();
+    }
+  }
+
+  if (record_level == nSpecies::RECORD_LIMITED) {
+    cur_species = in_genotype.GetSpecies();
+
+    if (cur_species) {
+      int num_diff = cur_species->Compare(in_genotype.GetGenome(), species_threshold);
+      if (num_diff != -1 && num_diff <= species_threshold) {
+        found_species = cur_species;
+      }
+    }
+  }
+
+  return found_species;
+}
+
+void cSpeciesControl::Purge(cStats & stats)
+{
+  cSpecies * cur_species = garbage_queue.GetFirst();
+  for (int i = 0; i < garbage_queue.GetSize(); i++) {
+    stats.RemoveSpecies(cur_species->GetID(),
+			cur_species->GetParentID(),
+			cur_species->GetTotalGenotypes(),
+			cur_species->GetTotalOrganisms(),
+			stats.GetUpdate() - cur_species->GetUpdateBorn());
+    cur_species = cur_species->GetNext();
+  }
+  garbage_queue.Purge();
+}

Copied: development/source/classification/cSpeciesControl.h (from rev 392, development/source/main/cSpeciesControl.h)
===================================================================
--- development/source/main/cSpeciesControl.h	2005-11-11 19:40:03 UTC (rev 392)
+++ development/source/classification/cSpeciesControl.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -0,0 +1,52 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 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 SPECIES_CONTROL_HH
+#define SPECIES_CONTROL_HH
+
+#ifndef SPECIES_QUEUE_HH
+#include "cSpeciesQueue.h"
+#endif
+
+class cGenotype;
+class cSpecies;
+class cStats;
+class cWorld;
+
+class cSpeciesControl {
+private:
+  cWorld* m_world;
+  cSpeciesQueue active_queue;
+  cSpeciesQueue inactive_queue;
+  cSpeciesQueue garbage_queue;
+
+public:
+  cSpeciesControl(cWorld* world);
+  ~cSpeciesControl();
+
+  void Remove(cSpecies & in_species);
+  void Adjust(cSpecies & in_species);
+  void SetInactive(cSpecies & in_species);
+  void SetActive(cSpecies & in_species);
+  void SetGarbage(cSpecies & in_species);
+  void Purge(cStats & stats);
+
+  bool OK();
+
+  int FindPos(cSpecies & in_species, int max_depth = -1);
+  cSpecies * Find(cGenotype & in_genotype, int record_level);
+
+  inline cSpecies * GetFirst() const { return active_queue.GetFirst(); }
+  inline cSpecies * GetFirstInactive() const
+    { return inactive_queue.GetFirst(); }
+  inline cSpecies * GetFirstGarbage() const
+    { return garbage_queue.GetFirst(); }
+  inline int GetSize() const { return active_queue.GetSize(); }
+  inline int GetInactiveSize() const { return inactive_queue.GetSize(); }
+};
+
+#endif

Copied: development/source/classification/cSpeciesQueue.cc (from rev 392, development/source/main/cSpeciesQueue.cc)

Copied: development/source/classification/cSpeciesQueue.h (from rev 392, development/source/main/cSpeciesQueue.h)

Copied: development/source/classification/nGenotype.h (from rev 392, development/source/main/nGenotype.h)

Copied: development/source/classification/nInjectGenotype.h (from rev 392, development/source/main/nInjectGenotype.h)

Copied: development/source/classification/nSpecies.h (from rev 392, development/source/main/nSpecies.h)

Modified: development/source/cpu/cCodeLabel.cc
===================================================================
--- development/source/cpu/cCodeLabel.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cCodeLabel.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -74,39 +74,6 @@
   return -1;
 }
 
-void cCodeLabel::SaveState(ostream& fp)
-{
-//   assert(fp.good());
-//   fp<<"cCodeLabel"<<" ";
-
-//   fp<<"|"; // marker
-
-//   fp << size << " " << base << " ";
-//   for( int i=0; i < size; ++i ){
-//     fp<<nop_sequence[i];
-//   }
-//   fp<<endl;
-}
-
-
-void cCodeLabel::LoadState(istream & fp)
-{
-//   assert(fp.good());
-//   cString foo;
-//   fp>>foo;
-//   assert( foo == "cCodeLabel");
-
-//   char marker;
-//   fp>>marker;
-//   assert( marker == '|' );
-
-//   fp.get(size);
-//   fp.get(base);
-//   for( int i=0; i<nHardware::MAX_LABEL_SIZE; ++i ){
-//     fp.get(nop_sequence[i]);
-//   }
-}
-
 int cCodeLabel::AsInt(const int base) const
 {
   int value = 0;
@@ -130,7 +97,7 @@
     if(oddCount % 2 == 0) {
       value += nop_sequence[i];
     } else {
-      // DDD - this should not be relying on hardware specific NUM_NOPS
+      // @DMB - this should not be relying on hardware specific NUM_NOPS
       value += (nHardwareCPU::NUM_NOPS - 1) - nop_sequence[i];
     }
 

Modified: development/source/cpu/cCodeLabel.h
===================================================================
--- development/source/cpu/cCodeLabel.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cCodeLabel.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -59,9 +59,6 @@
   int AsIntAdditivePolynomial(const int base) const;
   int AsIntFib(const int base) const;
   int AsIntPolynomialCoefficent(const int base) const;
-
-  void SaveState(std::ostream& fp);
-  void LoadState(std::istream & fp);
 };
 
 void cCodeLabel::AddNop(int nop_num) {

Modified: development/source/cpu/cHardware4Stack.cc
===================================================================
--- development/source/cpu/cHardware4Stack.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardware4Stack.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1251,53 +1251,7 @@
 }
 
 
-void cHardware4Stack::SaveState(ostream& fp)
-{
-  // note, memory & child_memory handled by cpu (@CAO Not any more!)
-  assert(fp.good());
 
-  fp<<"cHardware4Stack"<<endl;
-
-  // global_stack (in inverse order so load can just push)
-  for(int i=nHardware4Stack::NUM_LOCAL_STACKS; i<nHardware4Stack::NUM_STACKS; i++)
-    Stack(i).SaveState(fp);
-
-  //fp << thread_time_used  << endl;
-  fp << GetNumThreads()   << endl;
-  fp << cur_thread        << endl;
-
-  // Threads
-  for( int i = 0; i < GetNumThreads(); i++ ) {
-    threads[i].SaveState(fp);
-  }
-}
-
-
-void cHardware4Stack::LoadState(istream & fp)
-{
-  // note, memory & child_memory handled by cpu (@CAO Not any more!)
-  assert(fp.good());
-
-  cString foo;
-  fp>>foo;
-  assert( foo == "cHardware4Stack" );
-
-  // global_stack
-  for(int i=nHardware4Stack::NUM_LOCAL_STACKS; i<nHardware4Stack::NUM_STACKS; i++)
-    Stack(i).LoadState(fp);
-
-  int num_threads;
-  //fp >> thread_time_used;
-  fp >> num_threads;
-  fp >> cur_thread;
-
-  // Threads
-  for( int i = 0; i < num_threads; i++ ){
-    threads[i].LoadState(fp);
-  }
-}
-
-
 ////////////////////////////
 //  Instruction Helpers...
 ////////////////////////////

Modified: development/source/cpu/cHardware4Stack.h
===================================================================
--- development/source/cpu/cHardware4Stack.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardware4Stack.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -253,9 +253,6 @@
 
   void ReadInst(const int in_inst);
 
-  void SaveState(std::ostream& fp);
-  void LoadState(std::istream & fp);
-
   //void InitInstSet(const cString & filename, cInstSet & inst_set);
   cString ConvertToInstruction(int mem_space_used);
 

Modified: development/source/cpu/cHardware4Stack_Thread.cc
===================================================================
--- development/source/cpu/cHardware4Stack_Thread.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardware4Stack_Thread.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -59,52 +59,3 @@
   next_label.Clear();
   owner = NULL;
 }
-
-void cHardware4Stack_Thread::SaveState(ostream& fp){
-  assert(fp.good());
-  fp << "cHardware4Stack_Thread" << endl;
-
-  // stacks (NOT WORKING! -law)
-  for( int i=0; i<nHardware4Stack::NUM_STACKS; ++i ){
-    local_stacks[i].SaveState(fp);
-  }
-
-  // heads (@TCC does not handle parasites!!!)
-  for( int i=0; i<nHardware::NUM_HEADS; ++i ){
-    fp<<heads[i].GetPosition()<<endl;
-  }
-
-  fp<<"|"; // marker
-  fp<<cur_head;
-  fp<<endl;
-
-  // Code labels
-  read_label.SaveState(fp);
-  next_label.SaveState(fp);
-}
-
-void cHardware4Stack_Thread::LoadState(istream & fp){
-  assert(fp.good());
-  cString foo;
-  fp >> foo;
-  assert( foo == "cHardware4Stack_Thread");
-
-  // stacks (NOT WORKING!  -law)
-  for( int i=0; i<nHardware4Stack::NUM_STACKS; ++i ){
-    local_stacks[i].LoadState(fp);
-  }
-
-  // heads (@TCC does not handle parasites!!!)
-  for( int i=0; i<nHardware::NUM_HEADS; ++i ){
-    int pos;
-    fp>>pos;
-    heads[i].AbsSet(pos);
-  }
-
-  char marker; fp >> marker; assert( marker == '|' );
-  /* YIKES!  data loss below: */ 
-
-  // Code labels
-  read_label.LoadState(fp);
-  next_label.LoadState(fp);
-}

Modified: development/source/cpu/cHardware4Stack_Thread.h
===================================================================
--- development/source/cpu/cHardware4Stack_Thread.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardware4Stack_Thread.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -63,9 +63,6 @@
   void Reset(cHardwareBase * in_hardware, int _id);
   int GetID() const { return id; }
   void SetID(int _id) { id = _id; }
-
-  void SaveState(std::ostream& fp);
-  void LoadState(std::istream & fp);
 };
 
 #endif

Modified: development/source/cpu/cHardwareBase.cc
===================================================================
--- development/source/cpu/cHardwareBase.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareBase.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -11,8 +11,6 @@
 
 using namespace std;
 
-int cHardwareBase::instance_count(0);
-
 cHardwareBase::cHardwareBase(cWorld* world, cOrganism* in_organism, cInstSet* in_inst_set)
   : m_world(world)
   , organism(in_organism)
@@ -22,21 +20,13 @@
 {
   assert(inst_set->OK());
   assert(organism != NULL);
-
-  instance_count++;
 }
 
-cHardwareBase::~cHardwareBase()
-{
-  instance_count--;
-}
-
 bool cHardwareBase::Inst_Nop()          // Do Nothing.
 {
   return true;
 }
 
-
 int cHardwareBase::GetNumInst()
 {
   assert(inst_set != NULL);

Modified: development/source/cpu/cHardwareBase.h
===================================================================
--- development/source/cpu/cHardwareBase.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareBase.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -35,10 +35,9 @@
 
   cHardwareTracer * m_tracer;         // Set this if you want execution traced.
 
-  static int instance_count;
 public:
   cHardwareBase(cWorld* world, cOrganism * in_organism, cInstSet * in_inst_set);
-  virtual ~cHardwareBase();
+  virtual ~cHardwareBase() { ; }
 
   // --------  Organism ---------
   cOrganism * GetOrganism() { return organism; }
@@ -71,8 +70,6 @@
 
   // --------  Input and Output --------
   virtual void PrintStatus(std::ostream& fp) = 0;
-  virtual void SaveState(std::ostream& fp) = 0;
-  virtual void LoadState(std::istream & fp) = 0;
 
   void SetTrace(cHardwareTracer * tracer) { m_tracer = tracer; }
 
@@ -84,9 +81,6 @@
   // --------  @CAO Should be rethought?  --------
   virtual cCPUMemory & GetMemory() = 0;
   virtual cCPUMemory & GetMemory(int) = 0;
-
-  // --------  DEBUG ---------
-  static int GetInstanceCount() { return instance_count; }
 };
 
 #endif

Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareCPU.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1320,52 +1320,6 @@
   return true;
 }
 
-
-void cHardwareCPU::SaveState(ostream& fp)
-{
-  // note, memory & child_memory handled by cpu (@CAO Not any more!)
-  assert(fp.good());
-
-  fp<<"cHardwareCPU"<<endl;
-
-  // global_stack (in inverse order so load can just push)
-  global_stack.SaveState(fp);
-
-  fp << thread_time_used  << endl;
-  fp << GetNumThreads()   << endl;
-  fp << cur_thread        << endl;
-
-  // Threads
-  for( int i = 0; i < GetNumThreads(); i++ ) {
-    threads[i].SaveState(fp);
-  }
-}
-
-
-void cHardwareCPU::LoadState(istream & fp)
-{
-  // note, memory & child_memory handled by cpu (@CAO Not any more!)
-  assert(fp.good());
-
-  cString foo;
-  fp>>foo;
-  assert( foo == "cHardwareCPU" );
-
-  // global_stack
-  global_stack.LoadState(fp);
-
-  int num_threads;
-  fp >> thread_time_used;
-  fp >> num_threads;
-  fp >> cur_thread;
-
-  // Threads
-  for( int i = 0; i < num_threads; i++ ){
-    threads[i].LoadState(fp);
-  }
-}
-
-
 ////////////////////////////
 //  Instruction Helpers...
 ////////////////////////////

Modified: development/source/cpu/cHardwareCPU.h
===================================================================
--- development/source/cpu/cHardwareCPU.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareCPU.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -234,9 +234,6 @@
 
   void ReadInst(const int in_inst);
 
-  void SaveState(std::ostream& fp);
-  void LoadState(std::istream & fp);
-
   //void InitInstSet(const cString & filename, cInstSet & inst_set);
 
   /*

Modified: development/source/cpu/cHardwareCPU_Thread.cc
===================================================================
--- development/source/cpu/cHardwareCPU_Thread.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareCPU_Thread.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -60,67 +60,3 @@
   read_label.Clear();
   next_label.Clear();
 }
-
-
-
-
-void cHardwareCPU_Thread::SaveState(ostream& fp){
-  assert(fp.good());
-  fp << "cHardwareCPU_Thread" << endl;
-
-  // registers
-  for( int i=0; i<nHardwareCPU::NUM_REGISTERS; ++i ){
-    fp<<reg[i]<<endl;
-  }
-
-  // heads (@TCC does not handle parasites!!!)
-  for( int i=0; i<nHardware::NUM_HEADS; ++i ){
-    fp<<heads[i].GetPosition()<<endl;
-  }
-
-  stack.SaveState(fp);
-
-  fp<<"|"; // marker
-  fp<<cur_stack;
-  fp<<cur_head;
-  fp<<endl;
-
-  // Code labels
-  read_label.SaveState(fp);
-  next_label.SaveState(fp);
-}
-
-
-
-void cHardwareCPU_Thread::LoadState(istream & fp){
-  assert(fp.good());
-  cString foo;
-  fp >> foo;
-  assert( foo == "cHardwareCPU_Thread");
-
-  // registers
-  for( int i=0; i<nHardwareCPU::NUM_REGISTERS; ++i ){
-    fp>>reg[i];
-  }
-
-  // heads (@TCC does not handle parasites!!!)
-  for( int i=0; i<nHardware::NUM_HEADS; ++i ){
-    int pos;
-    fp>>pos;
-    heads[i].AbsSet(pos);
-  }
-
-  // stack
-  stack.LoadState(fp);
-
-  char marker; fp>>marker; assert( marker == '|' );
-  /* YIKES!  data loss below: */
-  char the_cur_stack = cur_stack;
-  char the_cur_head = cur_head;
-  fp.get(the_cur_stack);
-  fp.get(the_cur_head);
-
-  // Code labels
-  read_label.LoadState(fp);
-  next_label.LoadState(fp);
-}

Modified: development/source/cpu/cHardwareCPU_Thread.h
===================================================================
--- development/source/cpu/cHardwareCPU_Thread.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareCPU_Thread.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -63,9 +63,6 @@
   void Reset(cHardwareBase * in_hardware, int _id);
   int GetID() const { return id; }
   void SetID(int _id) { id = _id; }
-
-  void SaveState(std::ostream& fp);
-  void LoadState(std::istream & fp);
 };
 
 #endif

Modified: development/source/cpu/cHardwareManager.cc
===================================================================
--- development/source/cpu/cHardwareManager.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareManager.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -113,14 +113,14 @@
     // First, determine if it is a nop...
     int nop_mod = -1;
     if(nop_dict.Find(inst_name, nop_mod) == true) {
-      m_inst_set.AddNop2(nop_mod, redundancy, ft_cost, cost, prob_fail);
+      m_inst_set.AddNop(nop_mod, redundancy, ft_cost, cost, prob_fail);
       continue;
     }
     
     // Otherwise, it had better be in the main dictionary...
     int fun_id = -1;
     if(inst_dict.Find(inst_name, fun_id) == true){
-      m_inst_set.Add2(fun_id, redundancy, ft_cost, cost, prob_fail);
+      m_inst_set.AddInst(fun_id, redundancy, ft_cost, cost, prob_fail);
       continue;
     }
     

Modified: development/source/cpu/cHardwareSMT.cc
===================================================================
--- development/source/cpu/cHardwareSMT.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareSMT.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -746,7 +746,7 @@
 //This is the code run by the TARGET of an injection.  This RECIEVES the infection.
 bool cHardwareSMT::InjectHost(const cCodeLabel & in_label, const cGenome & inject_code)
 {
-  // DDD - Need to discuss how InjectHost should work with extensible memory spaces...
+  // @DMB - Need to discuss how InjectHost should work with extensible memory spaces...
   return false;
   
   // Make sure the genome will be below max size after injection.	
@@ -1073,53 +1073,6 @@
 }
 
 
-void cHardwareSMT::SaveState(ostream& fp)
-{
-  // note, memory & child_memory handled by cpu (@CAO Not any more!)
-  assert(fp.good());
-	
-  fp<<"cHardwareSMT"<<endl;
-	
-  // global_stack (in inverse order so load can just push)
-  for(int i = nHardwareSMT::NUM_LOCAL_STACKS; i < nHardwareSMT::NUM_STACKS; i++)
-    Stack(i).SaveState(fp);
-	
-  //fp << thread_time_used  << endl;
-  fp << GetNumThreads()   << endl;
-  fp << m_cur_thread        << endl;
-	
-  // Threads
-  for( int i = 0; i < GetNumThreads(); i++ ) {
-    m_threads[i].SaveState(fp);
-  }
-}
-
-
-void cHardwareSMT::LoadState(istream & fp)
-{
-  // note, memory & child_memory handled by cpu (@CAO Not any more!)
-  assert(fp.good());
-	
-  cString foo;
-  fp>>foo;
-  assert( foo == "cHardwareSMT" );
-	
-  // global_stack
-  for(int i = nHardwareSMT::NUM_LOCAL_STACKS; i < nHardwareSMT::NUM_STACKS; i++)
-    Stack(i).LoadState(fp);
-	
-  int num_threads;
-  //fp >> thread_time_used;
-  fp >> num_threads;
-  fp >> m_cur_thread;
-	
-  // Threads
-  for( int i = 0; i < num_threads; i++ ){
-    m_threads[i].LoadState(fp);
-  }
-}
-
-
 ////////////////////////////
 //  Instruction Helpers...
 ////////////////////////////
@@ -1534,7 +1487,7 @@
 {
   int write_head_pos = GetHead(nHardware::HEAD_WRITE).GetPosition();
   
-  // DDD - change to allow ???
+  // @DMB - change to allow ???
   // We're going to disallow division calls from memory spaces other than zero for right now @law
   if(IP().GetMemSpace() != 0) return false;
 
@@ -2033,7 +1986,7 @@
 //25
 bool cHardwareSMT::Inst_PushNext() 
 {
-  // DDD - Should this allow modified next, or be eliminated in favor of just 'Push'
+  // @DMB - Should this allow modified next, or be eliminated in favor of just 'Push'
   const int src = FindModifiedStack(nHardwareSMT::STACK_AX);
 #ifdef SMT_FULLY_ASSOCIATIVE
   const int dst = FindModifiedNextStack(src);
@@ -2047,7 +2000,7 @@
 //26
 bool cHardwareSMT::Inst_PushPrevious() 
 {
-  // DDD - Should this allow modified previous, or be eliminated in favor of just 'Push'
+  // @DMB - Should this allow modified previous, or be eliminated in favor of just 'Push'
   const int src = FindModifiedStack(nHardwareSMT::STACK_BX);
 #ifdef SMT_FULLY_ASSOCIATIVE
   const int dst = FindModifiedPreviousStack(src);
@@ -2061,7 +2014,7 @@
 //27
 bool cHardwareSMT::Inst_PushComplement() 
 {
-  // DDD - Should this allow modified complement, or be eliminated in favor of just 'Push'
+  // @DMB - Should this allow modified complement, or be eliminated in favor of just 'Push'
   int src = FindModifiedStack(nHardwareSMT::STACK_BX);
 #ifdef SMT_FULLY_ASSOCIATIVE
   const int dst = FindModifiedComplementStack(src);
@@ -2177,7 +2130,7 @@
 
 bool cHardwareSMT::isEmpty(int mem_space_used)
 {
-  // DDD - shouldn't this just be return false if GetSize() != 1
+  // @DMB - shouldn't this just be return false if GetSize() != 1
   for(int x = 0; x < m_mem_array[mem_space_used].GetSize(); x++) {
 		if(m_mem_array[mem_space_used][x].GetOp() >= nHardwareSMT::NUM_NOPS)
 			return false;

Modified: development/source/cpu/cHardwareSMT.h
===================================================================
--- development/source/cpu/cHardwareSMT.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareSMT.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -232,9 +232,6 @@
 	
   void ReadInst(const int in_inst);
 	
-  void SaveState(std::ostream& fp);
-  void LoadState(std::istream & fp);
-		
 private:
   /////////---------- Instruction Helpers ------------//////////
   int FindModifiedStack(int default_stack);

Modified: development/source/cpu/cHardwareSMT_Thread.cc
===================================================================
--- development/source/cpu/cHardwareSMT_Thread.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareSMT_Thread.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -59,52 +59,3 @@
   next_label.Clear();
   owner = NULL;
 }
-
-void cHardwareSMT_Thread::SaveState(ostream& fp){
-  assert(fp.good());
-  fp << "cHardwareSMT_Thread" << endl;
-	
-  // stacks (NOT WORKING! -law)
-  for( int i = 0; i < nHardwareSMT::NUM_STACKS; ++i ){
-    local_stacks[i].SaveState(fp);
-  }
-	
-  // heads (@TCC does not handle parasites!!!)
-  for( int i = 0; i < nHardware::NUM_HEADS; ++i ){
-    fp<<heads[i].GetPosition()<<endl;
-  }
-	
-  fp<<"|"; // marker
-  fp<<cur_head;
-  fp<<endl;
-	
-  // Code labels
-  read_label.SaveState(fp);
-  next_label.SaveState(fp);
-}
-
-void cHardwareSMT_Thread::LoadState(istream & fp){
-  assert(fp.good());
-  cString foo;
-  fp >> foo;
-  assert( foo == "cHardwareSMT_Thread");
-	
-  // stacks (NOT WORKING!  -law)
-  for( int i=0; i < nHardwareSMT::NUM_STACKS; ++i ){
-    local_stacks[i].LoadState(fp);
-  }
-	
-  // heads (@TCC does not handle parasites!!!)
-  for( int i = 0; i < nHardware::NUM_HEADS; ++i ){
-    int pos;
-    fp>>pos;
-    heads[i].AbsSet(pos);
-  }
-	
-  char marker; fp >> marker; assert( marker == '|' );
-  /* YIKES!  data loss below: */ 
-	
-  // Code labels
-  read_label.LoadState(fp);
-  next_label.LoadState(fp);
-}

Modified: development/source/cpu/cHardwareSMT_Thread.h
===================================================================
--- development/source/cpu/cHardwareSMT_Thread.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/cpu/cHardwareSMT_Thread.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -65,9 +65,6 @@
   void Reset(cHardwareBase* in_hardware, int _id);
   int GetID() const { return id; }
   void SetID(int _id) { id = _id; }
-	
-  void SaveState(std::ostream& fp);
-  void LoadState(std::istream & fp);
 };
 
 #endif

Modified: development/source/event/cEventManager.cc
===================================================================
--- development/source/event/cEventManager.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/event/cEventManager.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -4,16 +4,14 @@
 #include "cAnalyzeUtil.h"
 #include "avida.h"
 #include "cAvidaDriver_Base.h"
+#include "cClassificationManager.h"
 #include "cEnvironment.h"
 #include "cEvent.h"
-#include "cGenebank.h"
 #include "cGenotype.h"
 #include "cHardwareManager.h"
-#include "cInjectGenebank.h"
 #include "cInjectGenotype.h"
 #include "cInstUtil.h"
 #include "cLandscape.h"
-#include "cLineageControl.h"
 #include "cOrganism.h"
 #include "cPhenotype.h"
 #include "cPopulation.h"
@@ -872,11 +870,11 @@
   }
   ///// print_lineage_totals /////
   void Process(){
-    if (m_world->GetPopulation().GetLineageControl() == NULL) {
+    if (!m_world->GetConfig().LOG_LINEAGES.Get()) {
       m_world->GetDataFileOFStream(fname) << "No lineage data available!" << endl;
       return;
     }
-    m_world->GetPopulation().GetLineageControl()->PrintLineageTotals(fname, verbose);
+    m_world->GetClassificationManager().PrintLineageTotals(fname, verbose);
   }
 };
 
@@ -904,15 +902,15 @@
   }
   ///// print_lineage_counts /////
   void Process(){
-    if (m_world->GetPopulation().GetLineageControl() == NULL) {
+    if (!m_world->GetConfig().LOG_LINEAGES.Get()) {
       m_world->GetDataFileOFStream(fname) << "No lineage data available!" << endl;
       return;
     }
     if (verbose) {    // verbose mode is the same in both methods
-      m_world->GetPopulation().GetLineageControl()->PrintLineageTotals(fname, verbose);
+      m_world->GetClassificationManager().PrintLineageTotals(fname, verbose);
       return;
     }
-    m_world->GetPopulation().GetLineageControl()->PrintLineageCurCounts(fname);
+    m_world->GetClassificationManager().PrintLineageCurCounts(fname);
   }
 };
 
@@ -925,7 +923,7 @@
  * filename (string)
  *   The name under which the genotype should be saved. If no
  *   filename is given, the genotype is saved into the directory
- *   genebank, under the name that the genebank has associated with
+ *   archive, under the name that the archive has associated with
  *   this genotype.
  **/
 
@@ -946,9 +944,9 @@
   }
   ///// print_dom /////
   void Process(){
-    cGenotype * dom = m_world->GetPopulation().GetGenebank().GetBestGenotype();
+    cGenotype * dom = m_world->GetClassificationManager().GetBestGenotype();
     cString filename(in_filename);
-    if (filename == "") filename.Set("genebank/%s", dom->GetName()());
+    if (filename == "") filename.Set("archive/%s", dom->GetName()());
     cTestUtil::PrintGenome(m_world, dom->GetGenome(), filename, dom, m_world->GetStats().GetUpdate());
   }
 };
@@ -987,7 +985,7 @@
  * filename (string)
  *   The name under which the genotype should be saved. If no
  *   filename is given, the genotype is saved into the directory
- *   genebank, under the name that the genebank has associated with
+ *   archive, under the name that the archive has associated with
  *   this genotype.
  **/
 
@@ -1008,10 +1006,10 @@
   }
   ///// print_dom_parasite /////
   void Process(){
-    cInjectGenotype * dom = m_world->GetPopulation().GetInjectGenebank().GetBestInjectGenotype();
+    cInjectGenotype * dom = m_world->GetClassificationManager().GetBestInjectGenotype();
     if (dom!=NULL) {
       cString filename(in_filename);
-      if (filename == "") filename.Set("genebank/%s", dom->GetName()());
+      if (filename == "") filename.Set("archive/%s", dom->GetName()());
       cTestUtil::PrintGenome(m_world, dom, dom->GetGenome(), filename, m_world->GetStats().GetUpdate()); }
   }
 };
@@ -1292,7 +1290,7 @@
     if( fname == "" ){
       filename.Set("dump.%d", m_world->GetStats().GetUpdate());
     }
-    m_world->GetPopulation().GetGenebank().DumpTextSummary(m_world->GetDataFileOFStream(filename));
+    m_world->GetClassificationManager().DumpTextSummary(m_world->GetDataFileOFStream(filename));
     m_world->GetDataFileManager().Remove(filename);
   }
 };
@@ -1341,7 +1339,7 @@
     if (filename == "") {
       filename.Set("genotypes-%d.dat", m_world->GetStats().GetUpdate());
     }
-    m_world->GetPopulation().GetGenebank().PrintGenotypes(m_world->GetDataFileOFStream(filename),
+    m_world->GetClassificationManager().PrintGenotypes(m_world->GetDataFileOFStream(filename),
                                                           data_fields, historic);
     m_world->GetDataFileManager().Remove(filename);
   }
@@ -1378,7 +1376,7 @@
     if( fname == "" ){
       filename.Set("detail_pop.%d", m_world->GetStats().GetUpdate());
     }
-    m_world->GetPopulation().GetGenebank().DumpDetailedSummary(m_world->GetDataFileOFStream(filename));
+    m_world->GetClassificationManager().DumpDetailedSummary(m_world->GetDataFileOFStream(filename));
     m_world->GetDataFileManager().Remove(filename);
   }
 };
@@ -1415,7 +1413,7 @@
     if( fname == "" ){
       filename.Set("detail_pop.%d", m_world->GetStats().GetUpdate());
     }
-    m_world->GetPopulation().GetGenebank().DumpDetailedSexSummary(m_world->GetDataFileOFStream(filename));
+    m_world->GetClassificationManager().DumpDetailedSexSummary(m_world->GetDataFileOFStream(filename));
     m_world->GetDataFileManager().Remove(filename);
   }
 };
@@ -1451,7 +1449,7 @@
     if( fname == "" ){
       filename.Set("detail_parasite_pop.%d", m_world->GetStats().GetUpdate());
     }
-    m_world->GetPopulation().GetInjectGenebank().DumpDetailedSummary(filename, m_world->GetStats().GetUpdate());
+    m_world->GetClassificationManager().DumpInjectDetailedSummary(filename, m_world->GetStats().GetUpdate());
   }
 };
 
@@ -1494,7 +1492,7 @@
     if( fname == "" ){
       filename.Set("historic_dump.%d", m_world->GetStats().GetUpdate());
     }
-    m_world->GetPopulation().GetGenebank().DumpHistoricSummary(m_world->GetDataFileOFStream(filename), back_dist);
+    m_world->GetClassificationManager().DumpHistoricSummary(m_world->GetDataFileOFStream(filename), back_dist);
     m_world->GetDataFileManager().Remove(filename);
   }
 };
@@ -1531,7 +1529,7 @@
     if( fname == "" ){
       filename.Set("historic_dump.%d", m_world->GetStats().GetUpdate());
     }
-    m_world->GetPopulation().GetGenebank().DumpHistoricSexSummary(m_world->GetDataFileOFStream(filename));
+    m_world->GetClassificationManager().DumpHistoricSexSummary(m_world->GetDataFileOFStream(filename));
     m_world->GetDataFileManager().Remove(filename);
   }
 };
@@ -2249,7 +2247,7 @@
   }
   ///// calc_landscape /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cAnalyzeUtil::CalcLandscape(m_world, landscape_dist, genome,
                                 m_world->GetHardwareManager().GetInstSet());
   }
@@ -2277,7 +2275,7 @@
   }
   ///// predict_w_landscape /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cLandscape landscape(m_world, genome, m_world->GetHardwareManager().GetInstSet());
     landscape.PredictWProcess(m_world->GetDataFileOFStream(datafile));
   }
@@ -2305,7 +2303,7 @@
   }
   ///// predict_nu_landscape /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cLandscape landscape(m_world, genome, m_world->GetHardwareManager().GetInstSet());
     landscape.PredictNuProcess(m_world->GetDataFileOFStream(datafile));
   }
@@ -2333,7 +2331,7 @@
   }
   ///// sample_landscape /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cLandscape landscape(m_world, genome, m_world->GetHardwareManager().GetInstSet());
     if (sample_size == 0) sample_size = m_world->GetHardwareManager().GetInstSet().GetSize() - 1;
     landscape.SampleProcess(sample_size);
@@ -2371,7 +2369,7 @@
   }
   ///// random_landscape /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cLandscape landscape(m_world, genome, m_world->GetHardwareManager().GetInstSet());
     landscape.RandomProcess(sample_size, landscape_dist, min_found,
                             max_sample_size, print_if_found);
@@ -2405,7 +2403,7 @@
   }
   ///// analyze_landscape /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cAnalyzeUtil::AnalyzeLandscape(m_world, genome, m_world->GetHardwareManager().GetInstSet(),
                      sample_size, min_found, max_sample_size,
                      m_world->GetStats().GetUpdate());
@@ -2435,7 +2433,7 @@
   }
   ///// pairtest_landscape /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cAnalyzeUtil::PairTestLandscape(m_world, genome, m_world->GetHardwareManager().GetInstSet(),
                                     sample_size, m_world->GetStats().GetUpdate());
   }
@@ -2459,7 +2457,7 @@
     m_args = in_args; }
   ///// test_dom /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cAnalyzeUtil::TestGenome(m_world, genome, m_world->GetHardwareManager().GetInstSet(),
                              m_world->GetDataFileOFStream("dom-test.dat"), m_world->GetStats().GetUpdate());
   }
@@ -2876,7 +2874,7 @@
     m_args = in_args; }
   ///// hillclimb /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cLandscape landscape(m_world, genome, m_world->GetHardwareManager().GetInstSet());
     landscape.HillClimb(m_world->GetDataFileOFStream("hillclimb.dat"));
     m_world->GetDataFileManager().Remove("hillclimb.dat");
@@ -2901,7 +2899,7 @@
     m_args = in_args; }
   ///// hillclimb_neut /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cLandscape landscape(m_world, genome, m_world->GetHardwareManager().GetInstSet());
     landscape.HillClimb_Neut(m_world->GetDataFileOFStream("hillclimb.dat"));
     m_world->GetDataFileManager().Remove("hillclimb.dat");
@@ -2926,7 +2924,7 @@
     m_args = in_args; }
   ///// hillclimb_rand /////
   void Process(){
-    cGenome & genome = m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome();
+    cGenome & genome = m_world->GetClassificationManager().GetBestGenotype()->GetGenome();
     cLandscape landscape(m_world, genome, m_world->GetHardwareManager().GetInstSet());
     landscape.HillClimb_Rand(m_world->GetDataFileOFStream("hillclimb.dat"));
     m_world->GetDataFileManager().Remove("hillclimb.dat");
@@ -3103,7 +3101,7 @@
     ofstream& fp = m_world->GetDataFileOFStream(filename);
     cAnalyzeUtil::TestInsSizeChangeRobustness(m_world, fp,
                                               m_world->GetHardwareManager().GetInstSet(),
-                                              m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome(),
+                                              m_world->GetClassificationManager().GetBestGenotype()->GetGenome(),
                                               num_trials, m_world->GetStats().GetUpdate());
   }
 };
@@ -3128,7 +3126,7 @@
   
   ///// test_threads /////
   void Process(){
-    m_world->GetTestCPU().TestThreads(m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome());
+    m_world->GetTestCPU().TestThreads(m_world->GetClassificationManager().GetBestGenotype()->GetGenome());
   }
 };
 
@@ -3151,7 +3149,7 @@
   }
   ///// print_threads /////
   void Process(){
-    m_world->GetTestCPU().PrintThreads( m_world->GetPopulation().GetGenebank().GetBestGenotype()->GetGenome() );
+    m_world->GetTestCPU().PrintThreads( m_world->GetClassificationManager().GetBestGenotype()->GetGenome() );
   }
 };
 
@@ -3367,7 +3365,7 @@
   ///// print_tree_depths /////
   void Process(){
     if (filename == "") filename.Set("tree_depth.%d.dat", m_world->GetStats().GetUpdate());
-    cAnalyzeUtil::PrintTreeDepths(&m_world->GetPopulation(), m_world->GetDataFileOFStream(filename));
+    cAnalyzeUtil::PrintTreeDepths(m_world, m_world->GetDataFileOFStream(filename));
     m_world->GetDataFileManager().Remove(filename);
   }
 };

Modified: development/source/main/CMakeLists.txt
===================================================================
--- development/source/main/CMakeLists.txt	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/CMakeLists.txt	2005-11-15 18:05:29 UTC (rev 399)
@@ -9,24 +9,12 @@
   cBirthChamber.cc
   cEnvironment.cc
   cFitnessMatrix.cc
-  cGenebank.cc
   cGenome.cc
   cGenomeUtil.cc
-  cGenotype.cc
-  cGenotype_BirthData.cc
-  cGenotypeControl.cc
-  cGenotype_TestData.cc
-  cInjectGenebank.cc
-  cInjectGenotype.cc
-  cInjectGenotype_BirthData.cc
-  cInjectGenotypeControl.cc
-  cInjectGenotypeQueue.cc
   cInstruction.cc
   cInstSet.cc
   cInstUtil.cc
   cLandscape.cc
-  cLineage.cc
-  cLineageControl.cc
   cLocalMutations.cc
   cMutationLib.cc
   cMutationRates.cc
@@ -48,9 +36,6 @@
   cResourceLib.cc
   cSpatialCountElem.cc
   cSpatialResCount.cc
-  cSpecies.cc
-  cSpeciesControl.cc
-  cSpeciesQueue.cc
   cStats.cc
   cTaskEntry.cc
   cTaskLib.cc
@@ -61,7 +46,7 @@
 
 IF(AVD_PRIMITIVE)
   ADD_EXECUTABLE(primitive primitive.cc)
-  TARGET_LINK_LIBRARIES(primitive main cpu event analyze cpu main tools)
+  TARGET_LINK_LIBRARIES(primitive main classification cpu event analyze cpu main tools)
   LINK_DIRECTORIES(${ALL_LIB_DIRS})
   INSTALL_TARGETS(/work primitive)
 ENDIF(AVD_PRIMITIVE)

Modified: development/source/main/cAvidaDriver_Population.cc
===================================================================
--- development/source/main/cAvidaDriver_Population.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cAvidaDriver_Population.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -10,7 +10,7 @@
 #include "cChangeList.h"
 #include "cPopulation.h"
 #include "cString.h"
-#include "cGenebank.h"
+#include "cClassificationManager.h"
 #include "cGenotype.h"
 #include "cPopulationCell.h"
 #include "cOrganism.h"
@@ -55,10 +55,10 @@
     stats.ProcessUpdate();
     
     // Update all the genotypes for the end of this update.
-    cGenebank& genebank = population->GetGenebank();
-    for (cGenotype * cur_genotype = genebank.ResetThread(0);
+    cClassificationManager& classmgr = m_world->GetClassificationManager();
+    for (cGenotype * cur_genotype = classmgr.ResetThread(0);
          cur_genotype != NULL && cur_genotype->GetThreshold();
-         cur_genotype = genebank.NextGenotype(0)) {
+         cur_genotype = classmgr.NextGenotype(0)) {
       cur_genotype->UpdateReset();
     }
   }

Modified: development/source/main/cBirthChamber.cc
===================================================================
--- development/source/main/cBirthChamber.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cBirthChamber.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -9,7 +9,7 @@
 
 #include "tArray.h"
 #include "functions.h"
-#include "cGenebank.h"
+#include "cClassificationManager.h"
 #include "cGenome.h"
 #include "cGenomeUtil.h"
 #include "cGenotype.h"
@@ -17,8 +17,7 @@
 #include "cTools.h"
 #include "cWorld.h"
 
-cBirthChamber::cBirthChamber(cWorld* world)
-  : m_world(world), genebank(NULL)
+cBirthChamber::cBirthChamber(cWorld* world) : m_world(world)
 {
   const int num_orgs = m_world->GetConfig().WORLD_X.Get() * m_world->GetConfig().WORLD_Y.Get();
   const int num_demes = m_world->GetConfig().NUM_DEMES.Get(); 
@@ -147,8 +146,7 @@
   
   if (parent.GetPhenotype().CopyTrue() == false) {
     // Add this genotype with only one parent since its asexual.
-    child_genotype = genebank->AddGenotype(child_genome,
-					   parent.GetGenotype(), NULL);
+    child_genotype = m_world->GetClassificationManager().GetGenotype(child_genome, parent.GetGenotype(), NULL);
   }
 
   child_array[0]->SetGenotype(child_genotype);
@@ -183,7 +181,7 @@
   // the birth chamber, so we can un-defer that one.
 
   old_entry.parent_genotype->DecDeferAdjust();
-  genebank->AdjustGenotype(*old_entry.parent_genotype);
+  m_world->GetClassificationManager().AdjustGenotype(*old_entry.parent_genotype);
 
   return true;
 }
@@ -476,22 +474,17 @@
 }
 
 
-void cBirthChamber::SetupGenotypeInfo(cOrganism * organism,
-				      cGenotype * parent0_genotype,
-				      cGenotype * parent1_genotype)
+void cBirthChamber::SetupGenotypeInfo(cOrganism* organism, cGenotype* parent0, cGenotype* parent1)
 {
   // Setup the genotypes for both children...
-  cGenotype * child_genotype =
-    genebank->AddGenotype(organism->GetGenome(),
-			  parent0_genotype, parent1_genotype);
+  cGenotype* child_genotype =
+    m_world->GetClassificationManager().GetGenotype(organism->GetGenome(), parent0, parent1);
 
   organism->SetGenotype(child_genotype);
-
-  parent0_genotype->SetBreedStats(*child_genotype);
+  parent0->SetBreedStats(*child_genotype);
   
   // Defer the child genotype from being adjusted until after the child
   // has been placed into the population.
-
   child_genotype->IncDeferAdjust();
 }
 
@@ -500,8 +493,6 @@
 				    tArray<cOrganism *> & child_array,
 				    tArray<cMerit> & merit_array)
 {
-  assert(genebank != NULL);
-
   cPhenotype & parent_phenotype = parent.GetPhenotype();
 
   if (parent_phenotype.DivideSex() == false) {
@@ -635,7 +626,7 @@
   // We are now also done with the parent genotype that we were saving in
   // the birth chamber, so we can un-defer that one.
   parent0_genotype->DecDeferAdjust();
-  genebank->AdjustGenotype(*parent0_genotype);
+  m_world->GetClassificationManager().AdjustGenotype(*parent0_genotype);
 
   return true;
 }

Modified: development/source/main/cBirthChamber.h
===================================================================
--- development/source/main/cBirthChamber.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cBirthChamber.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -23,9 +23,6 @@
  * over before they are born.
  **/
 
-class cCPUMemory; // aggregate
-class cMerit; // aggregate
-class cGenebank;
 class cGenome;
 class cGenotype;
 class cOrganism;
@@ -44,7 +41,6 @@
   };
   
   cWorld* m_world;
-  cGenebank* genebank;
 
   cBirthEntry global_wait_entry;
   tArray<cBirthEntry> local_wait_entry;
@@ -101,8 +97,6 @@
   cBirthChamber(cWorld* world);
   ~cBirthChamber();
 
-  void SetGenebank(cGenebank * in_genebank) { genebank = in_genebank; }
-
   // Handle manipulations & tests of genome.  Return false if divide process
   // should halt.  Place offspring in child_array.
   bool SubmitOffspring(const cGenome & child_genome, cOrganism & parent,

Deleted: development/source/main/cGenebank.cc
===================================================================
--- development/source/main/cGenebank.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenebank.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,910 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 "cGenebank.h"
-
-#include "cGenotype.h"
-#include "cSpecies.h"
-#include "cStats.h"
-#include "cStringList.h"
-#include "cTestUtil.h"
-#include "cWorld.h"
-
-using namespace std;
-
-
-cGenebank::cGenebank(cWorld* world)
-  : m_world(world), stats(world->GetStats())
-{
-  for (int i = 0; i < MAX_CREATURE_SIZE; i++) {
-    genotype_count[i] = 0;
-  }
-
-  genotype_control = new cGenotypeControl(world, *this);
-  species_control  = new cSpeciesControl(world, *this);
-
-}
-
-cGenebank::~cGenebank()
-{
-  delete genotype_control;
-  delete species_control;
-}
-
-void cGenebank::UpdateReset()
-{
-  static int genotype_dom_time = 0;
-  static int prev_dom = -1;
-
-  cGenotype * best_genotype = GetBestGenotype();
-
-  species_control->Purge(stats);
-  if (best_genotype && best_genotype->GetID() != prev_dom) {
-    genotype_dom_time = 0;
-    prev_dom = best_genotype->GetID();
-  }
-  else {
-    genotype_dom_time++;
-    if (genotype_dom_time == m_world->GetConfig().GENOTYPE_PRINT_DOM.Get()) {
-      cString filename;
-      filename.Set("genebank/%s", best_genotype->GetName()());
-      cTestUtil::PrintGenome(m_world, best_genotype->GetGenome(), 
-			     filename, best_genotype, stats.GetUpdate());
-    }
-  }
-
-//   tArray<int> hist_array(15);
-//   hist_array.SetAll(0);
-//   int total_gens = 0;
-  
-//   for (int i = 0; i < nGenotype::HASH_SIZE; i++) {
-//     int cur_val = active_genotypes[i].GetSize();
-//     total_gens += cur_val;
-//     if (cur_val < 15) hist_array[cur_val]++;
-//     else cout << cur_val << " ";
-//   }
-//   cout << endl;
-//   for (int i = 0; i < 15; i++) {
-//     cout << i << " : " << hist_array[i] << endl;
-//   }
-//   cout << "Total genotypes: " << total_gens << endl;
-}
-
-cString cGenebank::GetLabel(int in_size, int in_num)
-{
-  char alpha[6];
-  char full_name[12];
-  int i;
-
-  for (i = 4; i >= 0; i--) {
-    alpha[i] = (in_num % 26) + 'a';
-    in_num /= 26;
-  }
-  alpha[5] = '\0';
-
-  sprintf(full_name, "%03d-%s", in_size, alpha);
-
-  return full_name;
-}
-
-
-void cGenebank::AddGenotype(cGenotype * in_genotype, int list_num)
-{
-  assert( in_genotype != 0 );
-  
-  if (list_num < 0) list_num = FindCRC(in_genotype->GetGenome());
-  
-  active_genotypes[list_num].Push(in_genotype);
-  genotype_control->Insert(*in_genotype);
-  stats.AddGenotype(in_genotype->GetID());
-
-  // Speciation... If we are creating a new genotype here, we must
-  // initilize it to the species of its parent genotype.
-
-  cSpecies * parent_species = NULL;
-  if ( in_genotype->GetParentGenotype() != NULL) {
-    parent_species = in_genotype->GetParentGenotype()->GetSpecies();
-  }
-
-  in_genotype->SetSpecies(parent_species);
-  if (parent_species != NULL) parent_species->AddGenotype();
-}
-
-
-// Add a new genotype to the genebank.  Take in parent genotypes to track
-// phylogenies (the second genotype is in the case of sexual organisms)
-
-cGenotype * cGenebank::AddGenotype(const cGenome & in_genome,
-				   cGenotype * parent_genotype,
-				   cGenotype * parent2_genotype)
-{
-  // Make sure we dont have a NULL parent -- if we do, we should be calling
-  // InjectGenotype().
-  assert (parent_genotype != NULL);
-
-  int list_num = FindCRC(in_genome);
-  cGenotype * found_genotype = FindGenotype(in_genome,
-			       parent_genotype->GetLineageLabel(), list_num);
-
-  if (!found_genotype) {
-    found_genotype = new cGenotype(m_world, stats.GetUpdate());
-    found_genotype->SetGenome(in_genome);
-    found_genotype->SetParent(parent_genotype, parent2_genotype);    
-    AddGenotype(found_genotype, list_num);
-  }
-
-  return found_genotype;
-}
-
-
-// Add a new genotype that has been injected from the outside to the genebank.
-//  Take in a lineage label to track clades.
-
-cGenotype * cGenebank::InjectGenotype(const cGenome & in_genome,
-				      int lineage_label)
-{
-  int list_num = FindCRC(in_genome);
-  cGenotype * found_genotype =
-    FindGenotype(in_genome, lineage_label, list_num);
-
-  if (!found_genotype) {
-    found_genotype = new cGenotype(m_world, stats.GetUpdate());
-    found_genotype->SetGenome(in_genome);
-    found_genotype->SetParent(NULL, NULL);
-    found_genotype->SetLineageLabel(lineage_label);
-    AddGenotype(found_genotype, list_num);
-  }
-
-  return found_genotype;
-}
-
-const cGenotype * cGenebank::FindGenotype(const cGenome & in_genome,
-				  int lineage_label, int list_num) const
-{
-  if (list_num < 0) list_num = FindCRC(in_genome);
-
-  tConstListIterator<cGenotype> list_it(active_genotypes[list_num]);
-
-  // If the lineage label is -1, match any lineage...
-  if (lineage_label == -1) {
-    while (list_it.Next() != NULL) {
-      if (list_it.GetConst()->GetGenome() == in_genome) break;
-    }
-  }
-
-  // Otherwise, only match a genotype of the same lineage.
-  else {
-    while (list_it.Next() != NULL) {
-      if (list_it.GetConst()->GetGenome() == in_genome &&
-	  list_it.GetConst()->GetLineageLabel() == lineage_label) break;
-    }
-  }
-  
-  return list_it.GetConst();
-}
-
-cGenotype * cGenebank::FindGenotype(const cGenome & in_genome,
-				    int lineage_label, int list_num)
-{
-  if (list_num < 0) list_num = FindCRC(in_genome);
-
-  tListIterator<cGenotype> list_it(active_genotypes[list_num]);
-  // If the lineage label is -1, match any lineage...
-  if (lineage_label == -1) {
-    while (list_it.Next() != NULL) {
-      if (list_it.Get()->GetGenome() == in_genome) break;
-    }
-  }
-
-  // Otherwise, only match a genotype of the same lineage.
-  else {
-    while (list_it.Next() != NULL) {
-      if (list_it.Get()->GetGenome() == in_genome &&
-	  list_it.Get()->GetLineageLabel() == lineage_label) break;
-    }
-  }
-  return list_it.Get();
-}
-
-void cGenebank::RemoveGenotype(cGenotype & in_genotype)
-{
-  // If we are supposed to defer analysis of this genotype, do so...
-  if (in_genotype.GetDeferAdjust() == true) return;
-
-  // If this genotype is still active, mark it no longer active and
-  // take it out of the hash table so it doesn't have any new organisms
-  // assigned to it.
-
-  if (in_genotype.GetActive() == true) {
-    int list_num = FindCRC(in_genotype.GetGenome());
-    active_genotypes[list_num].Remove(&in_genotype);
-    genotype_control->Remove(in_genotype);
-    in_genotype.Deactivate(stats.GetUpdate());
-    if (m_world->GetConfig().TRACK_MAIN_LINEAGE.Get()) {
-      genotype_control->InsertHistoric(in_genotype);
-    }
-  }
-
-  // If we are tracking the main lineage, we only want to delete a
-  // genotype when all of its decendents have also died out.
-
-  const int lineage_type = m_world->GetConfig().TRACK_MAIN_LINEAGE.Get();
-  if (lineage_type > 0) {
-    // If  there are more offspring genotypes, hold off on deletion...
-    if (in_genotype.GetNumOffspringGenotypes() != 0) return;
-
-    // If this is a dead end, delete it and recurse up...
-    cGenotype * parent = in_genotype.GetParentGenotype();
-    cGenotype * parent2 = in_genotype.GetParent2Genotype();
-
-    if (parent != NULL) {
-      parent->RemoveOffspringGenotype();
-
-      // Test to see if we need to update the coalescent genotype.
-      const int new_coal = genotype_control->UpdateCoalescent();
-      stats.SetCoalescentGenotypeDepth(new_coal);
-      // cout << "Set coalescent to " << found_gen->GetDepth() << endl;
-
-      if (parent->GetNumOrganisms() == 0) {
-	// Regardless, run RemoveGenotype on the parent.
-	RemoveGenotype(*parent);
-      }
-    }
-
-    if (lineage_type == 2 && parent2 != NULL) {
-      parent2->RemoveOffspringGenotype();
-
-      // Test to see if we need to update the coalescent genotype.
-      const int new_coal = genotype_control->UpdateCoalescent();
-      stats.SetCoalescentGenotypeDepth(new_coal);
-      // cout << "Set coalescent to " << found_gen->GetDepth() << endl;
-
-      if (parent2->GetNumOrganisms() == 0) {
-	// Regardless, run RemoveGenotype on the parent.
-	RemoveGenotype(*parent2);
-      }
-    }
-
-    genotype_control->RemoveHistoric(in_genotype);
-  }
-
-  // Handle the relevent statistics...
-  stats.RemoveGenotype(in_genotype.GetID(),
-	      in_genotype.GetParentID(), in_genotype.GetParentDistance(),
-	      in_genotype.GetDepth(), in_genotype.GetTotalOrganisms(),
-              in_genotype.GetTotalParasites(),
-	      stats.GetUpdate() - in_genotype.GetUpdateBorn(),
-              in_genotype.GetLength());
-  if (in_genotype.GetThreshold()) {
-    stats.RemoveThreshold(in_genotype.GetID());
-  }
-
-
-  // Speciation...  If a Threshold genotype was removed, the position of this
-  // species in the active list will at least shift, and it is possible that
-  // the species is made inactive, or removed all-togeather.  If it is a non-
-  // threshold genotype, then the species will only be effected if this was
-  // the last genotype of that species.
-
-  cSpecies * cur_species = in_genotype.GetSpecies();
-  if (cur_species) {
-
-    // First, re-adjust the species.
-
-    cur_species->RemoveGenotype();
-
-    // Then, check to see how this species changes if it is a threshold.
-
-    if (in_genotype.GetThreshold()) {
-      cur_species->RemoveThreshold(in_genotype);
-
-      // If we are out of thresholds, move this species to the inactive
-      // list for now.  Otherwise, just adjust it.
-
-      if (cur_species->GetNumThreshold() == 0) {
-	species_control->SetInactive(*cur_species);
-      }
-      else {
-	species_control->Adjust(*cur_species);
-      }
-    }
-
-    // Finally, remove the species completely if it has no genotypes left.
-
-    if (!cur_species->GetNumGenotypes()) {
-      species_control->SetGarbage(*cur_species);
-    }
-  }
-
-
-  delete &in_genotype;
-}
-
-void cGenebank::ThresholdGenotype(cGenotype & in_genotype)
-{
-  cSpecies * found_species = NULL;
-
-  in_genotype.SetName( GetLabel(in_genotype.GetLength(),
-				genotype_count[in_genotype.GetLength()]++) );
-  in_genotype.SetThreshold();
-
-  // If speciation is on, assign a species to the genotype now that it is
-  // threshold.
-
-  if (m_world->GetConfig().SPECIES_RECORDING.Get()) {
-    // Record the old species to know if it changes.
-
-    cSpecies * old_species = in_genotype.GetSpecies();
-
-    // Determine the "proper" species.
-
-    found_species = species_control->Find(in_genotype,
-					  m_world->GetConfig().SPECIES_RECORDING.Get());
-
-    // If no species was found, create a new one.
-
-    if (!found_species) {
-      found_species = new cSpecies(m_world, in_genotype.GetGenome(), stats.GetUpdate());
-      if (in_genotype.GetSpecies())
-	found_species->SetParentID(in_genotype.GetSpecies()->GetID());
-      species_control->SetActive(*found_species);
-      stats.AddSpecies(found_species->GetID());
-
-      // Since this is a new species, see if we should be printing it.
-
-      if (m_world->GetConfig().SPECIES_PRINT.Get()) {
-	cString filename;
-	filename.Set("genebank/spec-%04d", found_species->GetID());
-	cTestUtil::PrintGenome(m_world, in_genotype.GetGenome(), filename,
-			       &in_genotype, stats.GetUpdate());
-      }
-    }
-    else {
-      // If we are not creating a new species, but are adding a threshold
-      // to one which is currently in-active, make sure to move it back to
-      // the active list.
-
-      if (found_species->GetNumThreshold() == 0) {
-	species_control->SetActive(*found_species);
-      }
-    }
-
-    // Now that we know for sure what the species is, and that it is in
-    // the proper list, setup both the species and the genotype.
-
-    in_genotype.SetSpecies(found_species);
-    found_species->AddThreshold(in_genotype);
-
-    // Finally test to see if the species has been changed, and adjust
-    // accordingly.
-
-    if (found_species != old_species) {
-      found_species->AddGenotype();
-      if (old_species) {
-	old_species->RemoveGenotype();
-	if (old_species->GetNumGenotypes() == 0)
-	  species_control->SetGarbage(*old_species);
-      }
-    }
-    else {
-      if (found_species->GetNumThreshold() > 1) {
-	species_control->Adjust(*found_species);
-      }
-    }
-  }
-
-  // Do the relevent statistics...
-
-  if (m_world->GetConfig().SPECIES_RECORDING.Get()) {
-    stats.AddThreshold(in_genotype.GetID(), in_genotype.GetName()(),
-			 found_species->GetID());
-  } else {
-    stats.AddThreshold(in_genotype.GetID(), in_genotype.GetName()());
-  }
-
-  // Print the genotype?
-
-  if (m_world->GetConfig().GENOTYPE_PRINT.Get()) {
-    cString filename;
-    filename.Set("genebank/%s", in_genotype.GetName()());
-    cTestUtil::PrintGenome(m_world, in_genotype.GetGenome(), filename,
-			   &in_genotype, stats.GetUpdate());
-  }
-}
-
-bool cGenebank::AdjustGenotype(cGenotype & in_genotype)
-{
-  if (!genotype_control->Adjust(in_genotype)) return false;
-
-  if ((in_genotype.GetNumOrganisms() >= m_world->GetConfig().THRESHOLD.Get() ||
-       &in_genotype == genotype_control->GetBest()) &&
-      !(in_genotype.GetThreshold())) {
-    ThresholdGenotype(in_genotype);
-  }
-
-  return true;
-}
-
-bool cGenebank::SaveClone(ofstream& fp)
-{
-  // This method just save the counts at each size-class of genotypes.
-  // The rest is reconstructable.
-
-  // Save the numbers of organisms we're up to at each size.
-  fp << MAX_CREATURE_SIZE << " ";
-  for (int i = 0; i < MAX_CREATURE_SIZE; i++) {
-    fp << genotype_count[i] << " ";
-  }
-
-  return true;
-}
-
-bool cGenebank::LoadClone(ifstream & fp)
-{
-  // This method just restores the counts at each size-class of genotypes.
-  // The rest of the loading process should be handled elsewhere.
-
-  // Load the numbers of organisms we're up to at each size.
-  int max_size;
-  fp >> max_size;
-  assert (max_size <= MAX_CREATURE_SIZE); // MAX_CREATURE_SIZE too small
-  for (int i = 0; i < max_size && i < MAX_CREATURE_SIZE; i++) {
-    fp >> genotype_count[i];
-  }
-
-  return true;
-}
-
-bool cGenebank::DumpTextSummary(ofstream& fp)
-{
-  genotype_control->Reset(0);
-  for (int i = 0; i < genotype_control->GetSize(); i++) {
-    cGenotype * genotype = genotype_control->Get(0);
-    fp << genotype->GetGenome().AsString() << " "
-       << genotype->GetNumOrganisms() << " "
-       << genotype->GetID() << endl;
-    genotype_control->Next(0);
-  }
-
-  return true;
-}
-
-bool cGenebank::PrintGenotypes(ofstream& fp, cString & data_fields,
-			       int historic)
-{
-  bool print_id = false;
-  bool print_parent_id = false;
-  bool print_parent2_id = false;
-  bool print_parent_dist = false;
-  bool print_num_cpus = false;
-  bool print_total_cpus = false;
-  bool print_length = false;
-  bool print_merit = false;
-  bool print_gest_time = false;
-  bool print_fitness = false;
-  bool print_update_born = false;
-  bool print_update_dead = false;
-  bool print_depth = false;
-  bool print_lineage = false;
-  bool print_sequence = false;
-
-  cStringList fields(data_fields, ',');
-  if (fields.HasString("id") == true) print_id = true;
-  if (fields.HasString("parent_id") == true) print_parent_id = true;
-  if (fields.HasString("parent2_id") == true) print_parent2_id = true;
-  if (fields.HasString("parent_dist") == true) print_parent_dist = true;
-  if (fields.HasString("num_cpus") == true) print_num_cpus = true;
-  if (fields.HasString("total_cpus") == true) print_total_cpus = true;
-  if (fields.HasString("length") == true) print_length = true;
-  if (fields.HasString("merit") == true) print_merit = true;
-  if (fields.HasString("gest_time") == true) print_gest_time = true;
-  if (fields.HasString("fitness") == true) print_fitness = true;
-  if (fields.HasString("update_born") == true) print_update_born = true;
-  if (fields.HasString("update_dead") == true) print_update_dead = true;
-  if (fields.HasString("depth") == true) print_depth = true;
-  if (fields.HasString("lineage") == true) print_lineage = true;
-  if (fields.HasString("sequence") == true) print_sequence = true;
-  if (fields.HasString("all") == true) {
-    print_id = print_parent_id = print_parent2_id = print_parent_dist = true;
-    print_num_cpus = print_total_cpus = print_length = print_merit = true;
-    print_gest_time = print_fitness = print_update_born = true;
-    print_update_dead = print_depth = print_lineage = print_sequence = true;
-  }
-  
-  // Print all of the header information...
-  fp << "#filetype genotype_data" << endl
-     << "#format ";
-
-  if (print_id == true) fp << "id ";
-  if (print_parent_id == true) fp << "parent_id ";
-  if (print_parent2_id == true) fp << "parent2_id ";
-  if (print_parent_dist == true) fp << "parent_dist ";
-  if (print_num_cpus == true) fp << "num_cpus ";
-  if (print_total_cpus == true) fp << "total_cpus ";
-  if (print_length == true) fp << "length ";
-  if (print_merit == true) fp << "merit ";
-  if (print_gest_time == true) fp << "gest_time ";
-  if (print_fitness == true) fp << "fitness ";
-  if (print_update_born == true) fp << "update_born ";
-  if (print_update_dead == true) fp << "update_dead ";
-  if (print_depth == true) fp << "depth ";
-  if (print_lineage == true) fp << "lineage ";
-  if (print_sequence == true) fp << "sequence ";  
-  fp << endl;
-
-  // Print extra information about what data is in this file...
-  fp << "# Output is genotypes at update " << stats.GetUpdate();
-  if (historic == -1) fp << " including ALL ancestors";
-  else if (historic > 0) fp << " including ancestors for " 
-			    << historic << " updates.";
-  fp << endl;
-
-  // And give some information about what columns are available.
-  int cur_col = 1;
-  if (print_id) fp << "# " << cur_col++ << ": ID" << endl;
-  if (print_parent_id) fp << "# " << cur_col++ << ": parent ID" << endl;
-  if (print_parent2_id) fp << "# " << cur_col++ << ": parent2 ID" << endl;
-  if (print_parent_dist) fp << "# " << cur_col++ << ": parent distance" << endl;
-  if (print_num_cpus) fp << "# " << cur_col++ << ": number of orgranisms currently alive" << endl;
-  if (print_total_cpus) fp << "# " << cur_col++ << ": total number of organisms that ever existed" << endl;
-  if (print_length) fp << "# " << cur_col++ << ": length of genome" << endl;
-  if (print_merit) fp << "# " << cur_col++ << ": merit" << endl;
-  if (print_gest_time) fp << "# " << cur_col++ << ": gestation time" << endl;
-  if (print_fitness) fp << "# " << cur_col++ << ": fitness" << endl;
-  if (print_update_born) fp << "# " << cur_col++ << ": update born" << endl;
-  if (print_update_dead) fp << "# " << cur_col++ << ": update deactivated" << endl;
-  if (print_depth) fp << "# " << cur_col++ << ": depth in phylogentic tree" << endl;
-  if (print_lineage) fp << "# " << cur_col++ << ": lineage label of genotype" << endl;
-  if (print_sequence) fp << "# " << cur_col++ << ": genome of genotype" << endl;
-  fp << endl;
-
-  // Print the current population....
-  genotype_control->Reset(0);
-  for (int i = 0; i < genotype_control->GetSize(); i++) {
-    cGenotype * genotype = genotype_control->Get(0);
-
-    if (print_id)          fp << genotype->GetID() << " ";
-    if (print_parent_id)   fp << genotype->GetParentID() << " ";
-    if (print_parent2_id)  fp << genotype->GetAncestorID(1) << " ";
-    if (print_parent_dist) fp << genotype->GetParentDistance() << " ";
-    if (print_num_cpus)    fp << genotype->GetNumOrganisms() << " ";
-    if (print_total_cpus)  fp << genotype->GetTotalOrganisms() << " ";
-    if (print_length)      fp << genotype->GetLength() << " ";
-    if (print_merit)       fp << genotype->GetMerit() << " ";
-    if (print_gest_time)   fp << genotype->GetGestationTime() << " ";
-    if (print_fitness)     fp << genotype->GetFitness() << " ";
-    if (print_update_born) fp << genotype->GetUpdateBorn() << " ";
-    if (print_update_dead) fp << genotype->GetUpdateDeactivated() << " ";
-    if (print_depth)       fp << genotype->GetDepth() << " ";
-    if (print_lineage)     fp << genotype->GetLineageLabel() << " "; 
-    if (print_sequence)    fp << genotype->GetGenome().AsString() << " ";
-    fp << endl;
-    genotype_control->Next(0);
-  }
-
-  // Print the historic population if we are supposed to.
-  if (historic == 0) return true;
-
-  // Start by calculating the update we should start printing from...
-  int start_update = 0;
-  if (historic > 0) start_update = stats.GetUpdate() - historic;
-
-  // Now loop through the remaining genotypes...
-  genotype_control->ResetHistoric(0);
-  for (int i = 0; i < genotype_control->GetHistoricCount(); i++) {
-    // Get the next genotype.  Only print it if its in range...
-    cGenotype * genotype = genotype_control->Get(0);
-    if (genotype->GetUpdateDeactivated() < start_update) {
-      genotype_control->Next(0);
-      continue;
-    }
-
-    if (print_id)          fp << genotype->GetID() << " ";
-    if (print_parent_id)   fp << genotype->GetParentID() << " ";
-    if (print_parent2_id)  fp << genotype->GetAncestorID(1) << " ";
-    if (print_parent_dist) fp << genotype->GetParentDistance() << " ";
-    if (print_num_cpus)    fp << genotype->GetNumOrganisms() << " ";
-    if (print_total_cpus)  fp << genotype->GetTotalOrganisms() << " ";
-    if (print_length)      fp << genotype->GetLength() << " ";
-    if (print_merit)       fp << genotype->GetMerit() << " ";
-    if (print_gest_time)   fp << genotype->GetGestationTime() << " ";
-    if (print_fitness)     fp << genotype->GetFitness() << " ";
-    if (print_update_born) fp << genotype->GetUpdateBorn() << " ";
-    if (print_update_dead) fp << genotype->GetUpdateDeactivated() << " ";
-    if (print_depth)       fp << genotype->GetDepth() << " ";
-    if (print_lineage)     fp << genotype->GetLineageLabel() << " "; 
-    if (print_sequence)    fp << genotype->GetGenome().AsString() << " ";
-    fp << endl;
-
-    // Move to the next genotype...
-    genotype_control->Next(0);
-  }
-
-  
-  return true;
-}
-
-bool cGenebank::DumpDetailedSummary(ofstream& fp)
-{
-  genotype_control->Reset(0);
-  DumpDetailHeading(fp);
-  for (int i = 0; i < genotype_control->GetSize(); i++) {
-    DumpDetailedEntry(genotype_control->Get(0), fp);
-    genotype_control->Next(0);
-  }
-
-  return true;
-}
-
-bool cGenebank::DumpHistoricSummary(ofstream& fp, int back_dist)
-{
-  // Calculate the update we should start printing from...
-  int start_update = 0;
-  if (back_dist > 0) start_update = stats.GetUpdate() - back_dist;
-
-  // Loop through all defunct genotypes that we're saving.
-  DumpDetailHeading(fp);
-  genotype_control->ResetHistoric(0);
-  for (int i = 0; i < genotype_control->GetHistoricCount(); i++) {
-    // Get the next genotype.  Only print it if its in range...
-    cGenotype * cur_genotype = genotype_control->Get(0);
-    if (cur_genotype->GetUpdateDeactivated() < start_update) {
-      genotype_control->Next(0);
-      continue;
-    }
-    DumpDetailedEntry(cur_genotype, fp);
-
-    // Move to the next genotype...
-    genotype_control->Next(0);
-  }
-
-  return true;
-}
-
-bool cGenebank::DumpDetailedSexSummary(ofstream& fp)
-{
-  genotype_control->Reset(0);
-  DumpDetailSexHeading(fp);
-  for (int i = 0; i < genotype_control->GetSize(); i++) {
-    DumpDetailedSexEntry(genotype_control->Get(0), fp);
-    genotype_control->Next(0);
-  }
-
-  return true;
-}
-
-bool cGenebank::DumpHistoricSexSummary(ofstream& fp)
-{
-  genotype_control->ResetHistoric(0);
-  DumpDetailSexHeading(fp);
-  for (int i = 0; i < genotype_control->GetHistoricCount(); i++) {
-    DumpDetailedSexEntry(genotype_control->Get(0), fp);
-    genotype_control->Next(0);
-  }
-
-  return true;
-}
-
-void cGenebank::DumpDetailHeading (ofstream& fp)
-{
-  fp << "#filetype genotype_data" << endl
-     << "#format id parent_id parent_dist num_cpus total_cpus length merit gest_time fitness update_born update_dead depth sequence" << endl
-     << endl
-     << "#  1: ID" << endl
-     << "#  2: parent ID" << endl
-     << "#  3: parent distance" << endl
-     << "#  4: number of orgranisms currently alive" << endl
-     << "#  5: total number of organisms that ever existed" << endl
-     << "#  6: length of genome" << endl
-     << "#  7: merit" << endl
-     << "#  8: gestation time" << endl
-     << "#  9: fitness" << endl
-     << "# 10: update born" << endl
-     << "# 11: update deactivated" << endl
-     << "# 12: depth in phylogentic tree" << endl
-     << "# 13: genome of organism" << endl << endl;
-}
-
-void cGenebank::DumpDetailSexHeading (ofstream& fp)
-{
-  fp << "#filetype genotype_data" << endl
-     << "#format id parent_id parent2_id parent_dist num_cpus total_cpus length merit gest_time fitness update_born update_dead depth sequence" << endl
-     << endl
-     << "#  1: ID" << endl
-     << "#  2: parent 1 ID " << endl
-     << "#  3: parent 2 ID" << endl
-     << "#  4: parent 1 distance" << endl
-     << "#  5: number of orgranisms currently alive" << endl
-     << "#  6: total number of organisms that ever existed" << endl
-     << "#  7: length of genome" << endl
-     << "#  8: merit" << endl
-     << "#  9: gestation time" << endl
-     << "# 10: fitness" << endl
-     << "# 11: update born" << endl
-     << "# 12: update deactivated" << endl
-     << "# 13: depth in phylogentic tree" << endl
-     << "# 14: genome of organism" << endl << endl;
-}
-
-void cGenebank::DumpDetailedEntry(cGenotype * genotype, ofstream& fp)
-{
-  fp << genotype->GetID() << " "                //  1
-     << genotype->GetParentID() << " "          //  2
-    // << genotype->GetAncestorID(1) << " "          //  2b
-     << genotype->GetParentDistance() << " "    //  3
-     << genotype->GetNumOrganisms() << " "      //  4
-     << genotype->GetTotalOrganisms() << " "    //  5
-     << genotype->GetLength() << " "            //  6
-     << genotype->GetMerit() << " "             //  7
-     << genotype->GetGestationTime() << " "     //  8
-     << genotype->GetFitness() << " "           //  9
-     << genotype->GetUpdateBorn() << " "        // 10
-     << genotype->GetUpdateDeactivated() << " " // 11
-     << genotype->GetDepth() << " "             // 12
-     << genotype->GetGenome().AsString() << " " // 13
-     << endl;
-}
-
-void cGenebank::DumpDetailedSexEntry(cGenotype * genotype, ofstream& fp)
-{
-  fp << genotype->GetID() << " "                //  1
-     << genotype->GetAncestorID(0) << " "       //  2
-     << genotype->GetAncestorID(1) << " "       //  3
-     << genotype->GetParentDistance() << " "    //  4
-     << genotype->GetNumOrganisms() << " "      //  5
-     << genotype->GetTotalOrganisms() << " "    //  6
-     << genotype->GetLength() << " "            //  7
-     << genotype->GetMerit() << " "             //  8
-     << genotype->GetGestationTime() << " "     //  9
-     << genotype->GetFitness() << " "           // 10
-     << genotype->GetUpdateBorn() << " "        // 11
-     << genotype->GetUpdateDeactivated() << " " // 12
-     << genotype->GetDepth() << " "             // 13
-     << genotype->GetGenome().AsString() << " " // 14
-     << endl;
-}
-
-bool cGenebank::OK()
-{
-  bool ret_value = true;
-
-  // Check components...
-
-  if (!genotype_control->OK() || !species_control->OK()) {
-    ret_value = false;
-  }
-
-  // Now to double check the numbers of genotypes (and threshold) for each
-  // species.  This will only work if debug mode is on.
-
-#ifdef DEBUG
-  // Initialize debug routines in the species.
-
-  cSpecies * cur_species = NULL;
-  cSpecies * first_active = species_control->GetFirst();
-  cSpecies * first_inactive = species_control->GetFirstInactive();
-  cSpecies * first_garbage = species_control->GetFirstGarbage();
-
-  while (cur_species != first_active) {
-    if (!cur_species) cur_species = first_active;
-    cur_species->debug_num_genotypes = 0;
-    cur_species->debug_num_threshold = 0;
-    cur_species = cur_species->GetNext();
-  }
-
-  cur_species = NULL;
-  while (cur_species != first_inactive) {
-    if (!cur_species) cur_species = first_inactive;
-    cur_species->debug_num_genotypes = 0;
-    cur_species->debug_num_threshold = 0;
-    cur_species = cur_species->GetNext();
-  }
-
-  cur_species = NULL;
-  while (cur_species != first_garbage) {
-    if (!cur_species) cur_species = first_garbage;
-    cur_species->debug_num_genotypes = 0;
-    cur_species->debug_num_threshold = 0;
-    cur_species = cur_species->GetNext();
-  }
-
-
-  // Check the species for each genotype and place results in the species.
-
-  cGenotype * cur_gen = genotype_control->GetBest();
-  for (int i = 0; i < genotype_control->GetSize(); i++) {
-    if (cur_gen->GetSpecies()) {
-      cur_gen->GetSpecies()->debug_num_genotypes++;
-      if (cur_gen->GetThreshold()) {
-	cur_gen->GetSpecies()->debug_num_threshold++;
-      }
-    }
-    cur_gen = cur_gen->GetNext();
-  }
-
-  // Finally, make sure all the numbers match up.
-
-  cur_species = NULL;
-  while (cur_species != first_active) {
-    if (!cur_species) cur_species = first_active;
-    assert(cur_species->debug_num_genotypes == cur_species->GetNumGenotypes());
-    assert(cur_species->debug_num_threshold == cur_species->GetNumThreshold());
-    assert(cur_species->debug_num_genotypes >= cur_species->debug_num_threshold);
-
-    assert (cur_species->debug_num_threshold);
-    cur_species = cur_species->GetNext();
-  }
-
-  cur_species = NULL;
-  while (cur_species != first_inactive) {
-    if (!cur_species) cur_species = first_inactive;
-    assert(cur_species->debug_num_genotypes == cur_species->GetNumGenotypes());
-    assert(cur_species->debug_num_threshold == cur_species->GetNumThreshold());
-    assert(cur_species->debug_num_threshold);
-    assert(cur_species->debug_num_genotypes);
-  }
-
-  cur_species = NULL;
-  while (cur_species != first_garbage) {
-    if (!cur_species) cur_species = first_garbage;
-    assert(cur_species->debug_num_genotypes == 0 &&
-	   cur_species->debug_num_threshold == 0);
-  }
-
-#endif
-
-  assert (ret_value == true);
-
-  return ret_value;
-}
-
-int cGenebank::CountNumCreatures()
-{
-  int i;
-  int total = 0;
-
-  genotype_control->Reset(0);
-  for (i = 0; i < genotype_control->GetSize(); i++) {
-    total += genotype_control->Get(0)->GetNumOrganisms();
-    genotype_control->Next(0);
-  }
-
-  return total;
-}
-
-
-unsigned int cGenebank::FindCRC(const cGenome & in_genome) const
-{
-  unsigned int total = 0;
-
-  for (int i = 0; i < in_genome.GetSize(); i++) {
-    total += (in_genome[i].GetOp() + 3) * i;
-  }
-
-  return total % nGenotype::HASH_SIZE;
-}
-
-void cGenebank::SpeciesTest(char * message, cGenotype & genotype)
-{
-//  cSpecies * cur_species = genotype.GetSpecies();
-
-//    if (cur_species) {
-//      g_debug.Comment("UD %d: %s on genotype [%d] (size %d) of species [%d]",
-//  		    stats.GetUpdate(), message, genotype.GetID(),
-//  		    genotype.GetNumOrganisms(), cur_species->GetID());
-//    } else {
-//      g_debug.Comment("UD %d: %s on genotype [%d] (size %d) (no species)",
-//  	    stats.GetUpdate(), message, genotype.GetID(),
-//  	    genotype.GetNumOrganisms());
-//    }
-
-//    if (cur_species) {
-//      g_debug.Comment("   Species [%d] has %d gen and %d thresh. (list %d)",
-//  	    cur_species->GetID(), cur_species->GetNumGenotypes(),
-//  	    cur_species->GetNumThreshold(), cur_species->GetQueueType());
-//    }
-}

Deleted: development/source/main/cGenebank.h
===================================================================
--- development/source/main/cGenebank.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenebank.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,123 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 GENEBANK_HH
-#define GENEBANK_HH
-
-#include <fstream>
-
-#ifndef DEFS_HH
-#include "defs.h"
-#endif
-#ifndef GENOTYPE_CONTROL_HH
-#include "cGenotypeControl.h"
-#endif
-#ifndef SPECIES_CONTROL_HH
-#include "cSpeciesControl.h"
-#endif
-#ifndef STRING_HH
-#include "cString.h"
-#endif
-#ifndef TLIST_HH
-#include "tList.h"
-#endif
-
-template <class T> class tList; // array
-class cGenome;
-class cGenotype;
-class cGenotypeControl; // access
-class cSpeciesControl; // access
-class cStats;
-class cString; // aggregate
-class cWorld;
-
-class cGenebank {
-private:
-  cWorld* m_world;
-  unsigned int genotype_count[MAX_CREATURE_SIZE];
-  tList<cGenotype> active_genotypes[nGenotype::HASH_SIZE];
-  cGenotypeControl * genotype_control;
-  cSpeciesControl * species_control;
-  cStats & stats;
-
-private:
-  cString GetLabel(int in_size, int in_num);
-
-private:
-  // disabled copy constructor.
-  cGenebank(const cGenebank &);
-public:
-  cGenebank(cWorld* world);
-  ~cGenebank();
-
-  void UpdateReset();
-
-  /** 
-   * This function can be used to add a genotype that was created
-   * outside the genebank. In this case, the parameter in_list_num
-   * should not be given. Normally, genotypes are added through the 
-   * function AddGenotype(const cGenome & in_genome, 
-   * cGenotype * parent_genotype = NULL), which then calls this one.
-   **/
-  void AddGenotype(cGenotype *in_genotype, int list_num=-1);
-  cGenotype * AddGenotype(const cGenome & in_genome,
-			  cGenotype * parent_genotype,
-			  cGenotype * parent2_genotype);
-  cGenotype * InjectGenotype(const cGenome & in_genome, int lineage_label);
-  const cGenotype * FindGenotype(const cGenome & in_genome, int lineage_label,
-				 int list_num=-1) const;
-  cGenotype * FindGenotype(const cGenome & in_genome, int lineage_label,
-			   int list_num=-1);
-  void RemoveGenotype(cGenotype & in_genotype);
-  void ThresholdGenotype(cGenotype & in_genotype);
-  bool AdjustGenotype(cGenotype & in_genotype);
-
-  bool SaveClone(std::ofstream& fp);
-  bool LoadClone(std::ifstream & fp);
-  bool DumpTextSummary(std::ofstream& fp);
-  bool PrintGenotypes(std::ofstream& fp, cString & data_fields, int historic);
-  bool DumpDetailedSummary(std::ofstream& fp);
-  bool DumpDetailedSexSummary(std::ofstream& fp);
-  bool DumpHistoricSummary(std::ofstream& fp, int back_dist);
-  bool DumpHistoricSexSummary(std::ofstream& fp);
-  void DumpDetailHeading (std::ofstream& fp);
-  void DumpDetailSexHeading (std::ofstream& fp);
-  void DumpDetailedEntry(cGenotype * genotype, std::ofstream& fp);
-  void DumpDetailedSexEntry(cGenotype * genotype, std::ofstream& fp);
-  bool OK();
-
-  inline int GetSize() const { return genotype_control->GetSize(); }
-  inline cGenotype * GetBestGenotype() const
-    { return genotype_control->GetBest(); }
-  inline cGenotype * GetCoalescentGenotype() const
-    { return genotype_control->GetCoalescent(); }
-  inline cSpecies * GetFirstSpecies() const
-    { return species_control->GetFirst(); }
-
-  inline cGenotype * GetGenotype(int thread) const
-    { return genotype_control->Get(thread); }
-  inline cGenotype * NextGenotype(int thread) {
-    cGenotype * next = genotype_control->Next(thread);
-    return (next == genotype_control->GetBest()) ? (cGenotype*)NULL : next;
-  }
-  inline cGenotype * ResetThread(int thread)
-    { return genotype_control->Reset(thread); }
-
-  int CountNumCreatures();
-  inline int GetNumSpecies() const { return species_control->GetSize(); }
-  inline int CountSpecies() { return species_control->OK(); }
-  inline int FindPos(cGenotype & in_genotype, int max_depth = -1)
-    { return genotype_control->FindPos(in_genotype, max_depth); }
-  inline int FindPos(cSpecies & in_species, int max_depth = -1)
-    { return species_control->FindPos(in_species, max_depth); }
-
-  unsigned int FindCRC(const cGenome & in_genome) const;
-
-  void SpeciesTest(char * message, cGenotype & genotype);
-};
-
-#endif

Deleted: development/source/main/cGenotype.cc
===================================================================
--- development/source/main/cGenotype.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenotype.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,366 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 "cGenotype.h"
-
-#include "cCPUTestInfo.h"
-#include "cGenomeUtil.h"
-#include "cMerit.h"
-#include "cOrganism.h"
-#include "cPhenotype.h"
-#include "cTestCPU.h"
-#include "cTools.h"
-#include "cWorld.h"
-
-using namespace std;
-
-class cSpecies;
-
-///////////////////////////
-//  cGenotype
-///////////////////////////
-
-cGenotype::cGenotype(cWorld* world, int in_update_born, int in_id)
-  : m_world(world)
-  , genome(1)
-  , name("001-no_name")
-  , flag_threshold(false)
-  , is_active(true)
-  , defer_adjust(0)
-  , symbol(0)
-  , birth_data(in_update_born)
-  , num_organisms(0)
-  , last_num_organisms(0)
-  , total_organisms(0)
-  , total_parasites(0)
-  , species(NULL)
-  , next(NULL)
-  , prev(NULL)
-{
-  static int next_id = 1;
-  
-  if ( in_id >= 0 )
-    next_id = in_id;
-  
-  id_num = next_id++;
-}
-
-cGenotype::~cGenotype()
-{
-  // Reset some of the variables to make sure program will crash if a deleted
-  // cell is read!
-
-  symbol = '!';
-
-  num_organisms = -1;
-  total_organisms = -1;
-
-  next = NULL;
-  prev = NULL;
-}
-
-bool cGenotype::SaveClone(ofstream& fp)
-{
-  fp << id_num         << " ";
-  fp << genome.GetSize() << " ";
-
-  for (int i = 0; i < genome.GetSize(); i++) {
-    fp << ((int) genome[i].GetOp()) << " ";
-  }
-
-  return true;
-}
-
-bool cGenotype::LoadClone(ifstream & fp)
-{
-  int genome_size = 0;
-
-  fp >> id_num;
-  fp >> genome_size;
-
-  genome = cGenome(genome_size);
-  for (int i = 0; i < genome_size; i++) {
-    cInstruction temp_inst;
-    int inst_op;
-    fp >> inst_op;
-    temp_inst.SetOp((UCHAR) inst_op);
-    genome[i] = temp_inst;
-    // @CAO add something here to load arguments for instructions.
-  }
-
-  return true;
-}
-
-bool cGenotype::OK()
-{
-  bool ret_value = true;
-
-  // Check the components...
-
-  if (!genome.OK()) ret_value = false;
-
-  // And the statistics
-  assert( id_num >= 0 && num_organisms >= 0 && total_organisms >= 0 );
-  assert( birth_data.update_born >= -1 && birth_data.parent_distance >= -1 );
-  assert( sum_copied_size.Sum() >= 0 && sum_exe_size.Sum() >= 0 );
-  assert( sum_gestation_time.Sum() >= 0 && sum_repro_rate.Sum() >= 0 );
-  assert( sum_merit.Sum() >= 0 && sum_fitness.Sum() >= 0 );
-  assert( tmp_sum_copied_size.Sum() >= 0 && tmp_sum_exe_size.Sum() >= 0 );
-  assert( tmp_sum_gestation_time.Sum() >= 0 && tmp_sum_repro_rate.Sum() >= 0 );
-  assert( tmp_sum_merit.Sum() >= 0 && tmp_sum_fitness.Sum() >= 0 );
-
-  return ret_value;
-}
-
-void cGenotype::SetParent(cGenotype * parent, cGenotype * parent2)
-{
-  birth_data.parent_genotype = parent;
-  birth_data.parent2_genotype = parent2;
-
-  // If we have a real parent genotype, collect other data about parent.
-  if (parent == NULL) return;
-  birth_data.ancestor_ids[0] = parent->GetID();
-  birth_data.ancestor_ids[2] = parent->GetAncestorID(0);
-  birth_data.ancestor_ids[3] = parent->GetAncestorID(1);
-  if (parent2 != NULL) {
-    birth_data.ancestor_ids[1] = parent2->GetID();
-    birth_data.ancestor_ids[4] = parent2->GetAncestorID(0);
-    birth_data.ancestor_ids[5] = parent2->GetAncestorID(1);    
-  }
-
-  birth_data.parent_distance =
-    cGenomeUtil::FindEditDistance(genome, parent->genome);
-  birth_data.parent_species = parent->GetSpecies();
-  birth_data.gene_depth = parent->GetDepth() + 1;
-  birth_data.lineage_label = parent->GetLineageLabel();
-  parent->AddOffspringGenotype();
-  if (parent2 != NULL && m_world->GetConfig().TRACK_MAIN_LINEAGE.Get() == 2) {
-    parent2->AddOffspringGenotype();
-  }
-
-  // Initialize all stats to those of the parent genotype....
-  tmp_sum_copied_size.Add(    parent->GetCopiedSize());
-  tmp_sum_exe_size.Add(       parent->GetExecutedSize());
-  tmp_sum_gestation_time.Add( parent->GetGestationTime());
-  tmp_sum_repro_rate.Add(   1/parent->GetGestationTime());
-  tmp_sum_merit.Add(          parent->GetMerit());
-  tmp_sum_fitness.Add(        parent->GetFitness());
-}
-
-void cGenotype::Mutate()  // Check each location to be mutated.
-{
-  int i;
-
-  for (i = 0; i < genome.GetSize(); i++) {
-    if (true) { // m_world->GetRandom().GetUInt()) {     //@CAO always true!
-      genome[i].SetOp(m_world->GetRandom().GetUInt(m_world->GetNumInstructions()));
-      // Flag command as having been mutated? @CAO
-    }
-  }
-}
-
-void cGenotype::UpdateReset()
-{
-  last_num_organisms = num_organisms;
-  birth_data.birth_track.Next();
-  birth_data.death_track.Next();
-  birth_data.breed_out_track.Next();
-  birth_data.breed_true_track.Next();
-  birth_data.breed_in_track.Next();
-}
-
-void cGenotype::SetGenome(const cGenome & in_genome)
-{
-  genome = in_genome;
-  // Zero Stats
-  sum_copied_size.Clear();
-  sum_exe_size.Clear();
-  sum_gestation_time.Clear();
-  sum_repro_rate.Clear();
-  sum_merit.Clear();
-  sum_fitness.Clear();
-  tmp_sum_copied_size.Clear();
-  tmp_sum_exe_size.Clear();
-  tmp_sum_gestation_time.Clear();
-  tmp_sum_repro_rate.Clear();
-  tmp_sum_merit.Clear();
-  tmp_sum_fitness.Clear();
-
-  name.Set("%03d-no_name", genome.GetSize());
-}
-
-void cGenotype::CalcTestStats() const
-{
-  //  cerr << ".......Calculating test stats..." << endl;
-
-  cCPUTestInfo test_info;
-  m_world->GetTestCPU().TestGenome(test_info, genome);
-  test_data.is_viable = test_info.IsViable();
-
-  // Setup all possible test values.
-  cPhenotype & phenotype = test_info.GetTestOrganism()->GetPhenotype();
-  test_data.fitness = test_info.GetGenotypeFitness();
-  test_data.merit = phenotype.GetMerit().GetDouble();
-  test_data.gestation_time = phenotype.GetGestationTime();
-  test_data.executed_size = phenotype.GetExecutedSize();
-  test_data.copied_size = phenotype.GetCopiedSize();
-  test_data.colony_fitness = test_info.GetColonyFitness();
-  test_data.generations = test_info.GetMaxDepth();
-}
-
-
-bool cGenotype::GetTestViable() const {
-  if (test_data.fitness == -1) CalcTestStats();
-  return test_data.is_viable;
-}
-
-
-double cGenotype::GetTestFitness() const {
-  if (test_data.fitness == -1) CalcTestStats();
-  return test_data.fitness;
-}
-
-
-double cGenotype::GetTestMerit() const {
-  if (test_data.fitness == -1) CalcTestStats();
-  return test_data.merit;
-}
-
-
-int cGenotype::GetTestGestationTime() const {
-  if (test_data.fitness == -1) CalcTestStats();
-  return test_data.gestation_time;
-}
-
-
-int cGenotype::GetTestExecutedSize() const {
-  if (test_data.fitness == -1) CalcTestStats();
-  return test_data.executed_size;
-}
-
-
-int cGenotype::GetTestCopiedSize() const {
-  if (test_data.fitness == -1) CalcTestStats();
-  return test_data.copied_size;
-}
-
-
-double cGenotype::GetTestColonyFitness() const {
-  if (test_data.fitness == -1) CalcTestStats();
-  return test_data.colony_fitness;
-}
-
-
-int cGenotype::GetTestGenerations() const {
-  if (test_data.fitness == -1) CalcTestStats();
-  return test_data.generations;
-}
-
-void cGenotype::SetSpecies(cSpecies * in_species)
-{
-  species = in_species;
-}
-
-void cGenotype::AddMerit(const cMerit & in)
-{
-  sum_merit.Add(in.GetDouble());
-}
-
-void cGenotype::RemoveMerit(const cMerit & in)
-{
-  sum_merit.Subtract(in.GetDouble());
-}
-
-void cGenotype::Deactivate(int update)
-{
-  is_active = false;
-  birth_data.update_deactivated = update;
-}
-
-int cGenotype::GetPhyloDistance(cGenotype * test_genotype)
-{
-  if (GetID() == test_genotype->GetID()) {
-    return 0;
-  }
-  if (GetID() == test_genotype->GetAncestorID(0) ||  // Parent of test
-      GetID() == test_genotype->GetAncestorID(1) ||  // Parent of test
-      test_genotype->GetID() == GetAncestorID(0) ||  // Child of test
-      test_genotype->GetID() == GetAncestorID(1)     // Child of test
-      ) {
-    return 1;
-  }
-  if (GetID() == test_genotype->GetAncestorID(2) ||  // Grandparent of test
-      GetID() == test_genotype->GetAncestorID(3) ||  // Grandparent of test
-      GetID() == test_genotype->GetAncestorID(4) ||  // Grandparent of test
-      GetID() == test_genotype->GetAncestorID(5) ||  // Grandparent of test
-      test_genotype->GetID() == GetAncestorID(2) ||  // Grandchild of test
-      test_genotype->GetID() == GetAncestorID(3) ||  // Grandchild of test
-      test_genotype->GetID() == GetAncestorID(4) ||  // Grandchild of test
-      test_genotype->GetID() == GetAncestorID(5) ||  // Grandchild of test
-      GetAncestorID(0) == test_genotype->GetAncestorID(0) || // Sibling of test
-      GetAncestorID(0) == test_genotype->GetAncestorID(1) || // Sibling of test
-      GetAncestorID(1) == test_genotype->GetAncestorID(0) || // Sibling of test
-      GetAncestorID(1) == test_genotype->GetAncestorID(1)    // Sibling of test
-      ) {
-    return 2;
-  }
-  if (GetAncestorID(0) == test_genotype->GetAncestorID(2) || // Uncle of test
-      GetAncestorID(0) == test_genotype->GetAncestorID(3) || // Uncle of test
-      GetAncestorID(0) == test_genotype->GetAncestorID(4) || // Uncle of test
-      GetAncestorID(0) == test_genotype->GetAncestorID(5) || // Uncle of test
-      GetAncestorID(1) == test_genotype->GetAncestorID(2) || // Uncle of test
-      GetAncestorID(1) == test_genotype->GetAncestorID(3) || // Uncle of test
-      GetAncestorID(1) == test_genotype->GetAncestorID(4) || // Uncle of test
-      GetAncestorID(1) == test_genotype->GetAncestorID(5) || // Uncle of test
-      test_genotype->GetAncestorID(0) == GetAncestorID(2) || // Nephew of test
-      test_genotype->GetAncestorID(0) == GetAncestorID(3) || // Nephew of test
-      test_genotype->GetAncestorID(0) == GetAncestorID(4) || // Nephew of test
-      test_genotype->GetAncestorID(0) == GetAncestorID(5) || // Nephew of test
-      test_genotype->GetAncestorID(1) == GetAncestorID(2) || // Nephew of test
-      test_genotype->GetAncestorID(1) == GetAncestorID(3) || // Nephew of test
-      test_genotype->GetAncestorID(1) == GetAncestorID(4) || // Nephew of test
-      test_genotype->GetAncestorID(1) == GetAncestorID(5)    // Nephew of test
-      ) {
-    return 3;
-  }
-
-  if (GetAncestorID(2) == test_genotype->GetAncestorID(2) || // First Cousins
-      GetAncestorID(2) == test_genotype->GetAncestorID(3) ||
-      GetAncestorID(2) == test_genotype->GetAncestorID(4) ||
-      GetAncestorID(2) == test_genotype->GetAncestorID(5) ||
-      GetAncestorID(3) == test_genotype->GetAncestorID(2) ||
-      GetAncestorID(3) == test_genotype->GetAncestorID(3) ||
-      GetAncestorID(3) == test_genotype->GetAncestorID(4) ||
-      GetAncestorID(3) == test_genotype->GetAncestorID(5) ||
-      GetAncestorID(4) == test_genotype->GetAncestorID(2) ||
-      GetAncestorID(4) == test_genotype->GetAncestorID(3) ||
-      GetAncestorID(4) == test_genotype->GetAncestorID(4) ||
-      GetAncestorID(4) == test_genotype->GetAncestorID(5) ||
-      GetAncestorID(5) == test_genotype->GetAncestorID(2) ||
-      GetAncestorID(5) == test_genotype->GetAncestorID(3) ||
-      GetAncestorID(5) == test_genotype->GetAncestorID(4) ||
-      GetAncestorID(5) == test_genotype->GetAncestorID(5)
-      ) {
-    return 4;
-  }
-  
-  return 5;
-}
-
-
-int cGenotype::AddOrganism()
-{
-  total_organisms++;
-  return num_organisms++;
-}
-
-int cGenotype::RemoveOrganism()
-{
-  birth_data.death_track.Inc();
-  return num_organisms--;
-}
-

Deleted: development/source/main/cGenotype.h
===================================================================
--- development/source/main/cGenotype.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenotype.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,251 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 GENOTYPE_HH
-#define GENOTYPE_HH
-
-#include <fstream>
-
-#ifndef DOUBLE_SUM_HH
-#include "cDoubleSum.h"
-#endif
-#ifndef GENOME_HH
-#include "cGenome.h"
-#endif
-#ifndef GENOTYPE_BIRTH_DATA_HH
-#include "cGenotype_BirthData.h"
-#endif
-#ifndef GENOTYPE_TEST_DATA_HH
-#include "cGenotype_TestData.h"
-#endif
-#ifndef STRING_HH
-#include "cString.h"
-#endif
-
-class cSpecies;
-class cMerit;
-class cWorld;
-
-class cGenotype {
-private:
-  cWorld* m_world;
-  cGenome genome;
-  cString name;
-  bool flag_threshold;
-  bool is_active;      // Is this genotype still alive?
-  int defer_adjust;    // Don't adjust in the genebank until all are cleared.
-
-  int id_num;
-  char symbol;
-
-  mutable cGenotype_TestData test_data;
-  cGenotype_BirthData birth_data;
-
-  // Statistical info
-
-  int num_organisms;
-  int last_num_organisms;
-  int total_organisms;
-  int total_parasites;
-
-  cSpecies * species;
-
-  // Data Structure stuff...
-  cGenotype * next;
-  cGenotype * prev;
-
-
-  ////// Statistical info //////
-
-  // Collected on Divides
-  cDoubleSum sum_copied_size;
-  cDoubleSum sum_exe_size;
-
-  cDoubleSum sum_gestation_time;
-  cDoubleSum sum_repro_rate;  // should make gestation obsolete (not new)
-
-  cDoubleSum sum_merit;
-  cDoubleSum sum_fitness;
-
-  // Temporary (Approx stats used before any divides done)
-  // Set in "SetParent"
-  cDoubleSum tmp_sum_copied_size;
-  cDoubleSum tmp_sum_exe_size;
-
-  cDoubleSum tmp_sum_gestation_time;
-  cDoubleSum tmp_sum_repro_rate;
-
-  cDoubleSum tmp_sum_merit;
-  cDoubleSum tmp_sum_fitness;
-
-  void CalcTestStats() const;
-public:
-  /**
-   * Constructs an empty genotype. Normally, in_id should not specified as
-   * parameter, because cGenotype keeps track of the last id given out, and
-   * choses a new one based on that. However, in some cases it is necessary
-   * to specify an id (e.g., when loading a history file from disk). Note 
-   * that in this case, cGenotype does not check if the id has already been 
-   * used before.
-   **/
-  cGenotype(cWorld* world, int in_update_born = 0, int in_id = -1);
-  ~cGenotype();
-
-  bool SaveClone(std::ofstream& fp);
-  bool LoadClone(std::ifstream & fp);
-  bool OK();
-  void Mutate();
-  void UpdateReset();
-
-  void SetGenome(const cGenome & in_genome);
-  void SetSpecies(cSpecies * in_species);
-
-  // Test CPU info -- only used with limited options on.
-  bool GetTestViable() const;
-  double GetTestFitness() const;
-  double GetTestMerit() const;
-  int GetTestGestationTime() const;
-  int GetTestExecutedSize() const;
-  int GetTestCopiedSize() const;
-  double GetTestColonyFitness() const;
-  int GetTestGenerations() const;
-
-  void SetParent(cGenotype * parent, cGenotype * parent2);
-  void SetName(cString in_name)     { name = in_name; }
-  void SetNext(cGenotype * in_next) { next = in_next; }
-  void SetPrev(cGenotype * in_prev) { prev = in_prev; }
-  void SetSymbol(char in_symbol) { symbol = in_symbol; }
-  inline void SetThreshold();
-  void IncDeferAdjust() { defer_adjust++; }
-  void DecDeferAdjust() { defer_adjust--; assert(defer_adjust >= 0); }
-  void SetLineageLabel(int in_label) { birth_data.lineage_label = in_label; }
-
-  // Setting New Stats
-  void AddCopiedSize      (int in)   { sum_copied_size.Add(in); }
-  void AddExecutedSize         (int in)   { sum_exe_size.Add(in); }
-  void AddGestationTime   (int in)   { sum_gestation_time.Add(in);
-                                       sum_repro_rate.Add(1/(double)in); }
-  void AddMerit      (const cMerit & in);
-  void RemoveMerit   (const cMerit & in);
-  void AddFitness    (double in){
-    assert(in >= 0.0);
-    sum_fitness.Add(in);
-  }
-  void RemoveFitness (double in){
-    assert(in >= 0.0);
-    sum_fitness.Subtract(in);
-  }
-
-  //// Properties Native to Genotype ////
-  cGenome & GetGenome()             { return genome; }
-  const cGenome & GetGenome() const { return genome; }
-  int GetLength()             const { return genome.GetSize(); }
-
-  int GetBirths()    const { return birth_data.birth_track.GetTotal(); }
-  int GetBreedOut()  const { return birth_data.breed_out_track.GetTotal(); }
-  int GetBreedTrue() const { return birth_data.breed_true_track.GetTotal(); }
-  int GetBreedIn()   const { return birth_data.breed_in_track.GetTotal(); }
-
-  int GetThisBirths()    const { return birth_data.birth_track.GetCur(); }
-  int GetThisBreedOut()  const { return birth_data.breed_out_track.GetCur(); }
-  int GetThisBreedTrue() const { return birth_data.breed_true_track.GetCur(); }
-  int GetThisBreedIn()   const { return birth_data.breed_in_track.GetCur(); }
-
-  int GetThisDeaths() const { return birth_data.death_track.GetCur(); }
-
-  int GetLastNumOrganisms() const { return last_num_organisms; }
-  int GetLastBirths()    const { return birth_data.birth_track.GetLast(); }
-  int GetLastBreedOut()  const { return birth_data.breed_out_track.GetLast(); }
-  int GetLastBreedTrue() const { return birth_data.breed_true_track.GetLast();}
-  int GetLastBreedIn()   const { return birth_data.breed_in_track.GetLast(); }
-
-  inline void SetBreedStats(cGenotype & daughter); // called by ActivateChild
-
-  //// Properties Averaged Over Creatues ////
-  double GetCopiedSize()    const { return (sum_copied_size.Count()>0) ?
-	   sum_copied_size.Average() : tmp_sum_copied_size.Average(); }
-  double GetExecutedSize()  const { return (sum_exe_size.Count()>0) ?
-	   sum_exe_size.Average() : tmp_sum_exe_size.Average(); }
-  double GetGestationTime() const { return (sum_gestation_time.Count()>0) ?
-	   sum_gestation_time.Average() : tmp_sum_gestation_time.Average(); }
-  double GetReproRate()     const { return (sum_repro_rate.Count()>0) ?
-	   sum_repro_rate.Average() : tmp_sum_repro_rate.Average(); }
-  double GetMerit()         const { return (sum_merit.Count()>0) ?
-	   sum_merit.Average() : tmp_sum_merit.Average(); }
-  double GetFitness()       const { return (sum_fitness.Count()>0) ?
-	   sum_fitness.Average() : tmp_sum_fitness.Average(); }
-
-
-  // For tracking the genotype line back to the ancestor...
-  cGenotype * GetParentGenotype() { return birth_data.parent_genotype; }
-  cGenotype * GetParent2Genotype() { return birth_data.parent2_genotype; }
-  int GetNumOffspringGenotypes() const
-    { return birth_data.num_offspring_genotypes; }
-  void AddOffspringGenotype() { birth_data.num_offspring_genotypes++; }
-  void RemoveOffspringGenotype() { birth_data.num_offspring_genotypes--; }
-  bool GetActive() const { return is_active; }
-  bool GetDeferAdjust() const { return defer_adjust > 0; }
-  int GetUpdateDeactivated() { return birth_data.update_deactivated; }
-  void Deactivate(int update);
-
-  int GetUpdateBorn() const     { return birth_data.update_born; }
-  int GetParentID() const       { return birth_data.ancestor_ids[0]; }
-  int GetAncestorID(int anc) const { return birth_data.ancestor_ids[anc]; }
-  int GetParentDistance() const { return birth_data.parent_distance; }
-  int GetDepth() const          { return birth_data.gene_depth; }
-  int GetLineageLabel() const   { return birth_data.lineage_label; }
-  cString & GetName()           { return name; }
-  cSpecies * GetSpecies()       { return species; }
-  cSpecies * GetParentSpecies() { return birth_data.parent_species; }
-  cGenotype * GetNext()         { return next; }
-  cGenotype * GetPrev()         { return prev; }
-  bool GetThreshold() const     { return flag_threshold; }
-  int GetID() const             { return id_num; }
-  char GetSymbol() const        { return symbol; }
-
-  // Calculate a crude phylogentic distance based off of tracking parents
-  // and grand-parents, including sexual tracking.
-  int GetPhyloDistance(cGenotype * test_genotype);
-
-  int AddOrganism();
-  int RemoveOrganism();
-  int AddParasite()        { return ++total_parasites; }
-  void SwapOrganism()      { total_organisms++; }
-  int GetNumOrganisms()    { return num_organisms; }
-  int GetTotalOrganisms()  { return total_organisms; }
-  int GetTotalParasites()  { return total_parasites; }
-};
-
-// The genotype pointer template...
-
-
-
-// All the inline stuff...
-
-  ////////////////
- //  cGenotype //
-////////////////
-
-inline void cGenotype::SetThreshold()
-{
-  flag_threshold = true;
-  if (symbol == '.') symbol = '+';
-}
-
-
-inline void cGenotype::SetBreedStats(cGenotype & daughter)
-{
-  birth_data.birth_track.Inc();
-  if (daughter.id_num == id_num) {
-    birth_data.breed_true_track.Inc();
-  } else {
-    birth_data.breed_out_track.Inc();
-    daughter.birth_data.breed_in_track.Inc();
-  }
-}
-
-#endif

Deleted: development/source/main/cGenotypeBatch.h
===================================================================
--- development/source/main/cGenotypeBatch.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenotypeBatch.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,47 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 GENOTYPE_BATCH_HH
-#define GENOTYPE_BATCH_HH
-
-#ifndef STRING_HH
-#include "cString.h"
-#endif
-#ifndef TLIST_HH
-#include "tList.h"
-#endif
-
-// cGenotypeBatch      : Collection of cAnalyzeGenotypes
-
-template <class T> class tList; // aggregate
-class cString; // aggregate
-class cAnalyzeGenotype;
-
-class cGenotypeBatch {
-private:
-  tListPlus<cAnalyzeGenotype> genotype_list;
-  cString name;
-  bool is_lineage;
-  bool is_aligned;
-private:
-  // disabled copy constructor.
-  cGenotypeBatch(const cGenotypeBatch &);
-public:
-  cGenotypeBatch() : name(""), is_lineage(false), is_aligned(false) { ; }
-  ~cGenotypeBatch() { ; }
-
-  tListPlus<cAnalyzeGenotype> & List() { return genotype_list; }
-  cString & Name() { return name; }
-  bool IsLineage() { return is_lineage; }
-  bool IsAligned() { return is_aligned; }
-
-  void SetLineage(bool _val=true) { is_lineage = _val; }
-  void SetAligned(bool _val=true) { is_aligned = _val; }
-
-};
-
-#endif

Deleted: development/source/main/cGenotypeControl.cc
===================================================================
--- development/source/main/cGenotypeControl.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenotypeControl.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,277 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 "cGenotypeControl.h"
-
-#include "defs.h"
-#include "cGenebank.h"
-#include "cGenotype.h"
-#include "cWorld.h"
-
-cGenotypeControl::cGenotypeControl(cWorld* world, cGenebank & in_gb) : m_world(world), genebank(in_gb)
-{
-  size = 0;
-  best = NULL;
-  coalescent = NULL;
-  for (int i = 0; i < nGenotype::THREADS; i++) threads[i] = NULL;
-
-  historic_list = NULL;
-  historic_count = 0;
-}
-
-cGenotypeControl::~cGenotypeControl()
-{
-}
-
-bool cGenotypeControl::OK()
-{
-  int ret_value = true;
-
-  // Cycle through the list, making sure all connections are proper, size
-  // is correct, and all genotypes are OK().
-
-  cGenotype * cur_pos = best;
-  for (int i = 0; i < size; i++) {
-    if (!cur_pos->OK()) ret_value = false;
-    assert (cur_pos->GetNext()->GetPrev() == cur_pos);
-    cur_pos = cur_pos->GetNext();
-  }
-
-  assert (cur_pos == best);
-
-  return ret_value;
-}
-
-void cGenotypeControl::Insert(cGenotype & in_genotype, cGenotype * prev_genotype)
-{
-  if (prev_genotype == NULL) {
-    assert(size == 0); // Destroying a full genotype queue...
-
-    best = &in_genotype;
-    best->SetNext(best);
-    best->SetPrev(best);
-  }
-  else {
-    in_genotype.SetPrev(prev_genotype);
-    in_genotype.SetNext(prev_genotype->GetNext());
-    prev_genotype->SetNext(&in_genotype);
-    in_genotype.GetNext()->SetPrev(&in_genotype);
-  }
-
-  size++;
-}
-
-void cGenotypeControl::Remove(cGenotype & in_genotype)
-{
-  if (size == 1) {
-    best = NULL;
-  }
-  if (&in_genotype == best) {
-    best = best->GetNext();
-  }
-
-  in_genotype.GetNext()->SetPrev(in_genotype.GetPrev());
-  in_genotype.GetPrev()->SetNext(in_genotype.GetNext());
-  in_genotype.SetNext(NULL);
-  in_genotype.SetPrev(NULL);
-
-  size--;
-}
-
-void cGenotypeControl::RemoveHistoric(cGenotype & in_genotype)
-{
-  if (historic_count == 1) {
-    historic_list = NULL;
-  }
-  if (&in_genotype == historic_list) {
-    historic_list = historic_list->GetNext();
-  }
-
-  in_genotype.GetNext()->SetPrev(in_genotype.GetPrev());
-  in_genotype.GetPrev()->SetNext(in_genotype.GetNext());
-  in_genotype.SetNext(NULL);
-  in_genotype.SetPrev(NULL);
-
-  historic_count--;
-}
-
-void cGenotypeControl::InsertHistoric(cGenotype & in_genotype)
-{
-  if (historic_count == 0) {
-    in_genotype.SetNext(&in_genotype);
-    in_genotype.SetPrev(&in_genotype);
-  }
-  else {
-    in_genotype.SetPrev(historic_list->GetPrev());
-    in_genotype.SetNext(historic_list);
-    historic_list->GetPrev()->SetNext(&in_genotype);
-    historic_list->SetPrev(&in_genotype);
-  }
-
-  historic_list = &in_genotype;
-  historic_count++;
-}
-
-
-int cGenotypeControl::UpdateCoalescent()
-{
-  // Test to see if any updating needs to be done...
-  // Don't update active coalescent genotype, or if there is more than
-  // one offspring.
-  if (coalescent != NULL &&
-      (coalescent->GetNumOrganisms() > 0 ||
-       coalescent->GetNumOffspringGenotypes() > 1)) {
-    return coalescent->GetDepth();
-  }
-
-  // If there is no best, there is nothing to search through...
-  if (best == NULL) return -1;
-
-  // Find the new point...
-  cGenotype * test_gen = best;
-  cGenotype * found_gen = best;
-  cGenotype * parent_gen = best->GetParentGenotype();
-
-  while (parent_gen != NULL) {
-    // See if this genotype should be the new found genotype...
-    if (test_gen->GetNumOrganisms() > 0 ||
-	test_gen->GetNumOffspringGenotypes() > 1) {
-      found_gen = test_gen;
-    }
-
-    // Move to the next genotype...
-    test_gen = parent_gen;
-    parent_gen = test_gen->GetParentGenotype();
-  }
-
-  coalescent = found_gen;
-
-  return coalescent->GetDepth();
-}
-
-
-bool cGenotypeControl::CheckPos(cGenotype & in_genotype)
-{
-  int next_OK = false;
-  int prev_OK = false;
-
-  if (in_genotype.GetNumOrganisms() >= in_genotype.GetNext()->GetNumOrganisms()) {
-    next_OK =true;
-  }
-  if (in_genotype.GetNumOrganisms() <= in_genotype.GetPrev()->GetNumOrganisms()) {
-    prev_OK =true;
-  }
-
-  if ( (next_OK && prev_OK) ||
-       (&in_genotype == best && next_OK) ||
-       (&in_genotype == best->GetPrev() && prev_OK)) {
-    return true;
-  }
-
-  return false;
-}
-
-void cGenotypeControl::Insert(cGenotype & new_genotype)
-{
-  // If there is nothing in the list, add this.
-
-  if (size == 0) {
-    Insert(new_genotype, NULL);
-  }
-
-  // Otherwise tack it on the end.
-
-  else {
-    Insert(new_genotype, best->GetPrev());
-  }
-}
-
-bool cGenotypeControl::Adjust(cGenotype & in_genotype)
-{
-  cGenotype * cur_genotype = in_genotype.GetPrev();
-
-  // Check to see if this genotype should be removed completely.
-
-  if (in_genotype.GetNumOrganisms() == 0 &&
-      in_genotype.GetDeferAdjust() == false) {
-    genebank.RemoveGenotype(in_genotype);
-    return false;
-  }
-
-  // Do not adjust the position of this genotype if it was and still is the
-  // best genotype, or if it is otherwise in the proper spot...
-
-  if (CheckPos(in_genotype)) {
-    return true;
-  }
-
-  // Otherwise, remove it from the queue (for just the moment).
-
-  Remove(in_genotype);
-
-  // If this genotype is the best, put it there.
-
-  if (in_genotype.GetNumOrganisms() > best->GetNumOrganisms()) {
-    Insert(in_genotype, best->GetPrev());
-    best = &in_genotype;
-    return true;
-  }
-
-  // Finally, find out where this genotype *does* go.
-
-  while (cur_genotype->GetNumOrganisms() >= in_genotype.GetNumOrganisms() &&
-	 cur_genotype != best->GetPrev()) {
-    cur_genotype = cur_genotype->GetNext();
-  }
-  while (cur_genotype->GetNumOrganisms() < in_genotype.GetNumOrganisms() &&
-	 cur_genotype != best) {
-    cur_genotype = cur_genotype->GetPrev();
-  }
-
-  Insert(in_genotype, cur_genotype);
-
-  return true;
-}
-
-
-cGenotype * cGenotypeControl::Find(const cGenome & in_genome) const
-{
-  int i;
-  cGenotype * cur_genotype = best;
-
-  for (i = 0; i < size; i++) {
-    if (in_genome == cur_genotype->GetGenome()) {
-      return cur_genotype;
-    }
-    cur_genotype = cur_genotype->GetNext();
-  }
-
-  return NULL;
-}
-
-int cGenotypeControl::FindPos(cGenotype & in_genotype, int max_depth)
-{
-  cGenotype * temp_genotype = best;
-  if (max_depth < 0 || max_depth > size) max_depth = size;
-
-  for (int i = 0; i < max_depth; i++) {
-    if (temp_genotype == &in_genotype) return i;
-    temp_genotype = temp_genotype->GetNext();
-  }
-
-  return -1;
-}
-
-cGenotype * cGenotypeControl::Next(int thread)
-{
-  return threads[thread] = threads[thread]->GetNext();
-}
-
-cGenotype * cGenotypeControl::Prev(int thread)
-{
-  return threads[thread] = threads[thread]->GetPrev();
-}

Deleted: development/source/main/cGenotypeControl.h
===================================================================
--- development/source/main/cGenotypeControl.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenotypeControl.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,65 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 GENOTYPE_CONTROL_HH
-#define GENOTYPE_CONTROL_HH
-
-#ifndef nGenotype_h
-#include "nGenotype.h"
-#endif
-
-class cGenebank;
-class cGenome;
-class cGenotype;
-class cWorld;
-
-class cGenotypeControl {
-private:
-  cWorld* m_world;
-  int size;
-  cGenotype* best;
-  cGenotype* coalescent;
-  cGenotype* threads[nGenotype::THREADS];
-  cGenebank& genebank;
-
-  cGenotype * historic_list;
-  int historic_count;
-
-  void Insert(cGenotype & in_genotype, cGenotype * prev_genotype);
-  bool CheckPos(cGenotype & in_genotype);
-public:
-  cGenotypeControl(cWorld* world, cGenebank& in_gb);
-  ~cGenotypeControl();
-
-  bool OK();
-  void Remove(cGenotype & in_genotype);
-  void Insert(cGenotype & new_genotype);
-  bool Adjust(cGenotype & in_genotype);
-
-  void RemoveHistoric(cGenotype & in_genotype);
-  void InsertHistoric(cGenotype & in_genotype);
-  int GetHistoricCount() { return historic_count; }
-
-  int UpdateCoalescent();
-
-  inline int GetSize() const { return size; }
-  inline cGenotype * GetBest() const { return best; }
-  inline cGenotype * GetCoalescent() const { return coalescent; }
-
-  cGenotype * Find(const cGenome & in_genome) const;
-  int FindPos(cGenotype & in_genotype, int max_depth = -1);
-
-  inline cGenotype * Get(int thread) const { return threads[thread]; }
-  inline cGenotype * Reset(int thread)
-    { return threads[thread] = best; }
-  inline cGenotype * ResetHistoric(int thread)
-    { return threads[thread] = historic_list; }
-  cGenotype * Next(int thread);
-  cGenotype * Prev(int thread);
-};
-
-#endif

Deleted: development/source/main/cGenotype_BirthData.cc
===================================================================
--- development/source/main/cGenotype_BirthData.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenotype_BirthData.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,37 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 GENOTYPE_BIRTH_DATA_HH
-#include "cGenotype_BirthData.h"
-#endif
-
-#ifndef DEFS_HH
-#include "defs.h"
-#endif
-
-/////////////////////////
-//  cGenotype_BirthData
-/////////////////////////
-
-cGenotype_BirthData::cGenotype_BirthData(int in_update_born)
-  : update_born(in_update_born)
-  , parent_distance(-1)
-  , gene_depth(0)
-  , update_deactivated(-1)
-  , parent_genotype(NULL)
-  , parent_species(NULL)
-  , num_offspring_genotypes(0)
-{
-  // @CAO: we should do a test to see if we have a sexual population.  For now
-  // we will assume we do.
-  ancestor_ids.Resize(6);
-  ancestor_ids.SetAll(-1);
-}
-
-cGenotype_BirthData::~cGenotype_BirthData()
-{
-}

Deleted: development/source/main/cGenotype_BirthData.h
===================================================================
--- development/source/main/cGenotype_BirthData.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenotype_BirthData.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,50 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 GENOTYPE_BIRTH_DATA_HH
-#define GENOTYPE_BIRTH_DATA_HH
-
-#ifndef COUNT_TRACKER_HH
-#include "cCountTracker.h"
-#endif
-
-#ifndef TARRAY_HH
-#include "tArray.h"
-#endif
-
-class cGenotype;
-class cSpecies;
-class cGenotype_BirthData {
-public:
-  cGenotype_BirthData(int in_update_born);
-  ~cGenotype_BirthData();
-
-  cCountTracker birth_track;
-  cCountTracker death_track;
-  cCountTracker breed_in_track;
-  cCountTracker breed_true_track;
-  cCountTracker breed_out_track;
-
-  int update_born;      // Update genotype was first created
-  int parent_distance;  // Genetic distance from parent genotype
-  int gene_depth;       // depth in the phylogenetic tree from ancestor
-  int lineage_label;    // Unique label for the lineage of this genotype.
-
-  int update_deactivated;       // If not, when did it get deactivated?
-  cGenotype * parent_genotype;  // Pointer to parent genotype...
-  cGenotype * parent2_genotype; // Pointer to secondary parent genotype...
-  cSpecies * parent_species;
-  int num_offspring_genotypes;  // Num offspring genotypes still in memory.
-
-  // Ancestral IDs.  This array contains all of the information about the
-  // ids of the ancestors.  It will have one entry if this is an asexual
-  // population, otherwise:
-  // [0]=parent1, [1]=parent2, [2]&[3]=grandparents 1, [4]&[5]=grandparents 2
-  tArray<int> ancestor_ids;
-};
-
-#endif

Deleted: development/source/main/cGenotype_TestData.cc
===================================================================
--- development/source/main/cGenotype_TestData.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenotype_TestData.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,23 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 GENOTYPE_TEST_DATA_HH
-#include "cGenotype_TestData.h"
-#endif
-
-////////////////////////
-//  cGenotype_TestData
-////////////////////////
-
-cGenotype_TestData::cGenotype_TestData()
-  : fitness(-1)
-{
-}
-
-cGenotype_TestData::~cGenotype_TestData()
-{
-}

Deleted: development/source/main/cGenotype_TestData.h
===================================================================
--- development/source/main/cGenotype_TestData.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cGenotype_TestData.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,27 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 GENOTYPE_TEST_DATA_HH
-#define GENOTYPE_TEST_DATA_HH
-
-class cGenotype_TestData {
-public:
-  cGenotype_TestData();
-  ~cGenotype_TestData();
-
-  bool is_viable;
-
-  double fitness;
-  double merit;
-  int gestation_time;
-  int executed_size;
-  int copied_size;
-  double colony_fitness;
-  int generations;
-};
-
-#endif

Deleted: development/source/main/cInjectGenebank.cc
===================================================================
--- development/source/main/cInjectGenebank.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenebank.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,341 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 "cInjectGenebank.h"
-
-#include "cDataFile.h"
-#include "cGenome.h"
-#include "cInjectGenotype.h"
-#include "cStats.h"
-#include "cTestUtil.h"
-#include "cWorld.h"
-
-using namespace std;
-
-////////////////////
-//  cInjectGenebank
-////////////////////
-
-cInjectGenebank::cInjectGenebank(cWorld* world)
-  : m_world(world), stats(world->GetStats())
-{
-  for (int i = 0; i < MAX_CREATURE_SIZE; i++) {
-    inject_genotype_count[i] = 0;
-  }
-
-  inject_genotype_control = new cInjectGenotypeControl(*this);
-
-}
-
-cInjectGenebank::~cInjectGenebank()
-{
-  delete inject_genotype_control;
-}
-
-void cInjectGenebank::UpdateReset()
-{
-  static int genotype_dom_time = 0;
-  static int prev_dom = -1;
-
-  cInjectGenotype * best_inject_genotype = GetBestInjectGenotype();
-
-  if (best_inject_genotype && best_inject_genotype->GetID() != prev_dom) {
-    genotype_dom_time = 0;
-    prev_dom = best_inject_genotype->GetID();
-  }
-  else {
-    genotype_dom_time++;
-    if (genotype_dom_time == m_world->GetConfig().GENOTYPE_PRINT_DOM.Get()) {
-      cString filename;
-      filename.Set("genebank/%s", best_inject_genotype->GetName()());
-      cTestUtil::PrintGenome(m_world, best_inject_genotype, best_inject_genotype->GetGenome(), 
-			     filename, stats.GetUpdate());
-    }
-  }
-}
-
-cString cInjectGenebank::GetLabel(int in_size, int in_num)
-{
-  char alpha[6];
-  char full_name[12];
-  int i;
-
-  for (i = 4; i >= 0; i--) {
-    alpha[i] = (in_num % 26) + 'a';
-    in_num /= 26;
-  }
-  alpha[5] = '\0';
-
-  sprintf(full_name, "p%03d-%s", in_size, alpha);
-
-  return full_name;
-}
-
-void cInjectGenebank::AddInjectGenotype(cInjectGenotype * in_inject_genotype, int in_list_num)
-{
-  assert( in_inject_genotype != 0 );
-  
-  if ( in_list_num < 0 )
-    in_list_num = FindCRC(in_inject_genotype->GetGenome()) % nInjectGenotype::HASH_SIZE;
-  
-  active_inject_genotypes[in_list_num].Insert(*in_inject_genotype);
-  inject_genotype_control->Insert(*in_inject_genotype);
-  //stats.AddGenotype(in_inject_genotype->GetID());
-}
-
-
-cInjectGenotype * cInjectGenebank::AddInjectGenotype(const cGenome & in_genome,
-				   cInjectGenotype * parent_genotype)
-{
-  int list_num = FindCRC(in_genome) % nInjectGenotype::HASH_SIZE;
-  cInjectGenotype * found_genotype;
-
-  found_genotype = active_inject_genotypes[list_num].Find(in_genome);
-
-  if (!found_genotype) {
-    found_genotype = new cInjectGenotype(m_world, stats.GetUpdate());
-    found_genotype->SetGenome(in_genome);
-    found_genotype->SetParent(parent_genotype);
-    if(parent_genotype!=NULL)
-      {
-	parent_genotype->SetCanReproduce();
-      }
-    AddInjectGenotype( found_genotype, list_num );
-  }
-  return found_genotype;
-}
-
-cInjectGenotype * cInjectGenebank::FindInjectGenotype(const cGenome & in_genome) const
-{
-  int list_num = FindCRC(in_genome) % nInjectGenotype::HASH_SIZE;
-  return active_inject_genotypes[list_num].Find(in_genome);
-}
-
-void cInjectGenebank::RemoveInjectGenotype(cInjectGenotype & in_inject_genotype)
-{
-  // If this genotype is still active, mark it no longer active and
-  // take it out of the hash table so it doesn't have any new organisms
-  // assigned to it.
-
-  if (in_inject_genotype.GetActive() == true) {
-    int list_num = FindCRC(in_inject_genotype.GetGenome()) % nInjectGenotype::HASH_SIZE;
-    active_inject_genotypes[list_num].Remove(in_inject_genotype);
-    inject_genotype_control->Remove(in_inject_genotype);
-    //in_inject_genotype.Deactivate(stats.GetUpdate());
-    if (m_world->GetConfig().TRACK_MAIN_LINEAGE.Get()) {
-      inject_genotype_control->InsertHistoric(in_inject_genotype);
-    }
-  }
-
-  // If we are tracking the main lineage, we only want to delete a
-  // genotype when all of its decendents have also died out.
-
-  /*if (m_world->GetConfig().TRACK_MAIN_LINEAGE.Get()) {
-    // If  there are more offspring genotypes, hold off on deletion...
-    if (in_inject_genotype.GetNumOffspringGenotypes() != 0) return;
-
-    // If this is a dead end, delete it and recurse up...
-    cInjectGenotype * parent = in_inject_genotype.GetParentGenotype();
-    if (parent != NULL) {
-      parent->RemoveOffspringGenotype();
-
-      // Test to see if we need to update the coalescent genotype.
-      const int new_coal = inject_genotype_control->UpdateCoalescent();
-      stats.SetCoalescentGenotypeDepth(new_coal);
-      // cout << "Set coalescent to " << found_gen->GetDepth() << endl;
-
-      if (parent->GetNumInjected() == 0) {
-	// Regardless, run RemoveGenotype on the parent.
-	RemoveGenotype(*parent);
-      }
-    }
-
-    inject_genotype_control->RemoveHistoric(in_inject_genotype);
-  }
-
-  // Handle the relevent statistics...
-  stats.RemoveGenotype(in_inject_genotype.GetID(),
-	      in_inject_genotype.GetParentID(), in_inject_genotype.GetParentDistance(),
-	      in_inject_genotype.GetDepth(), in_inject_genotype.GetTotalOrganisms(),
-              in_inject_genotype.GetTotalParasites(),
-	      stats.GetUpdate() - in_inject_genotype.GetUpdateBorn(),
-              in_inject_genotype.GetLength());
-  if (in_inject_genotype.GetThreshold()) {
-  stats.RemoveThreshold(in_inject_genotype.GetID());
-  }*/
-
-  delete &in_inject_genotype;
-}
-
-void cInjectGenebank::ThresholdInjectGenotype(cInjectGenotype & in_inject_genotype)
-{
-  in_inject_genotype.SetName( GetLabel(in_inject_genotype.GetLength(),
-				inject_genotype_count[in_inject_genotype.GetLength()]++) );
-  in_inject_genotype.SetThreshold();
-
-  //stats.AddThreshold(in_inject_genotype.GetID(), in_inject_genotype.GetName()());
-  
-  // Print the genotype?
-
-  if (m_world->GetConfig().GENOTYPE_PRINT.Get()) {
-    cString filename;
-    filename.Set("genebank/%s", in_inject_genotype.GetName()());
-    //cTestUtil::PrintGenome(m_world, in_inject_genotype.GetGenome(), filename,
-    //			   &in_inject_genotype, stats.GetUpdate());
-  }
-}
-
-bool cInjectGenebank::AdjustInjectGenotype(cInjectGenotype & in_inject_genotype)
-{
-  if (!inject_genotype_control->Adjust(in_inject_genotype)) return false;
-
-  if ((in_inject_genotype.GetNumInjected() >= m_world->GetConfig().THRESHOLD.Get() ||
-       &in_inject_genotype == inject_genotype_control->GetBest()) &&
-      !(in_inject_genotype.GetThreshold())) {
-    ThresholdInjectGenotype(in_inject_genotype);
-  }
-
-  return true;
-}
-
-bool cInjectGenebank::SaveClone(ofstream& fp)
-{
-  // This method just save the counts at each size-class of genotypes.
-  // The rest is reconstructable.
-
-  // Save the numbers of organisms we're up to at each size.
-  fp << MAX_CREATURE_SIZE << " ";
-  for (int i = 0; i < MAX_CREATURE_SIZE; i++) {
-    fp << inject_genotype_count[i] << " ";
-  }
-
-  return true;
-}
-
-bool cInjectGenebank::LoadClone(ifstream & fp)
-{
-  // This method just restores the counts at each size-class of genotypes.
-  // The rest of the loading process should be handled elsewhere.
-
-  // Load the numbers of organisms we're up to at each size.
-  int max_size;
-  fp >> max_size;
-  assert (max_size <= MAX_CREATURE_SIZE); // MAX_CREATURE_SIZE too small
-  for (int i = 0; i < max_size && i < MAX_CREATURE_SIZE; i++) {
-    fp >> inject_genotype_count[i];
-  }
-
-  return true;
-}
-
-bool cInjectGenebank::DumpTextSummary(ofstream& fp)
-{
-  inject_genotype_control->Reset(0);
-  for (int i = 0; i < inject_genotype_control->GetSize(); i++) {
-    cInjectGenotype * genotype = inject_genotype_control->Get(0);
-    fp << genotype->GetGenome().AsString() << " "
-       << genotype->GetNumInjected() << " "
-       << genotype->GetID() << endl;
-    inject_genotype_control->Next(0);
-  }
-
-  return true;
-}
-
-bool cInjectGenebank::DumpDetailedSummary(const cString & file, int update)
-{
-  inject_genotype_control->Reset(0);
-  for (int i = 0; i < inject_genotype_control->GetSize(); i++) {
-    DumpDetailedEntry(inject_genotype_control->Get(0), file, update);
-    inject_genotype_control->Next(0);
-  }
-  return true;
-}
-
-/*bool cInjectGenebank::DumpHistoricSummary(ofstream& fp)
-{
-  inject_genotype_control->ResetHistoric(0);
-  for (int i = 0; i < inject_genotype_control->GetHistoricCount(); i++) {
-    DumpDetailedEntry(inject_genotype_control->Get(0), fp);
-    inject_genotype_control->Next(0);
-  }
-
-  return true;
-}*/
-
-void cInjectGenebank::DumpDetailedEntry(cInjectGenotype * genotype, const cString & filename, int update)
-{
-  //if(genotype->CanReproduce())
-  //  {
-      cDataFile & df = m_world->GetDataFile(filename);
-      
-      df.WriteComment( "Avida parasite dump data" );
-      df.WriteTimeStamp();
-      
-      df.Write( genotype->GetID(),                 "parasite genotype ID");
-      df.Write( genotype->GetName(),              "parasite genotype name");
-      df.Write( genotype->GetParentID(),           "parasite parent ID");
-      df.Write( genotype->GetNumInjected(),        "current number of injected creatures with this genotype");
-      df.Write( genotype->GetTotalInjected(),      "total number of injected creatures with this genotype");
-      df.Write( genotype->GetLength(),             "genotype length");
-      df.Write( genotype->GetUpdateBorn(),         "update this genotype was born");
-      df.Write( genotype->CanReproduce(),          "has this genotype reproduced?");
-      df.Write( genotype->GetGenome().AsString(),  "genome of this genotype");
-      df.Endl();
-      //}
-}
-
-bool cInjectGenebank::OK()
-{
-  bool ret_value = true;
-  int i;
-
-  // Check components...
-
-  if (!inject_genotype_control->OK()) {
-    ret_value = false;
-  }
-
-  // Loop through all of the reference lists for matching genotypes...
-
-  for (i = 0; i < nInjectGenotype::HASH_SIZE; i++) {
-    assert (active_inject_genotypes[i].OK());
-  }
-
-  assert (ret_value == true);
-
-  return ret_value;
-}
-
-int cInjectGenebank::CountNumCreatures()
-{
-  int i;
-  int total = 0;
-
-  inject_genotype_control->Reset(0);
-  for (i = 0; i < inject_genotype_control->GetSize(); i++) {
-    total += inject_genotype_control->Get(0)->GetNumInjected();
-    inject_genotype_control->Next(0);
-  }
-
-  return total;
-}
-
-
-unsigned int cInjectGenebank::FindCRC(const cGenome & in_genome) const
-{
-  unsigned int total = 13;
-  int i;
-
-  for (i = 0; i < in_genome.GetSize(); i++) {
-    total *= in_genome[i].GetOp() + 10 + i << 6;
-    total += 3;
-  }
-
-  return total;
-}
-

Deleted: development/source/main/cInjectGenebank.h
===================================================================
--- development/source/main/cInjectGenebank.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenebank.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,105 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 INJECT_GENEBANK_HH
-#define INJECT_GENEBANK_HH
-
-#include <fstream>
-
-#ifndef DEFS_HH
-#include "defs.h"
-#endif
-#ifndef nInjectGenotype_h
-#include "nInjectGenotype.h"
-#endif
-#ifndef INJECT_GENOTYPE_CONTROL_HH
-#include "cInjectGenotypeControl.h"
-#endif
-#ifndef INJECT_GENOTYPE_QUEUE_HH
-#include "cInjectGenotypeQueue.h"
-#endif
-#ifndef STRING_HH
-#include "cString.h"
-#endif
-
-class cGenome;
-class cStats;
-class cInjectGenotype;
-class cInjectGenotypeQueue; // array
-class cInjectGenotypeControl; // access
-class cStats;
-class cString; // aggregate
-class cInjectGenotype;
-class cGenome;
-class cWorld;
-
-class cInjectGenebank {
-private:
-  cWorld* m_world;
-  unsigned int inject_genotype_count[MAX_CREATURE_SIZE];
-  cInjectGenotypeQueue active_inject_genotypes[nInjectGenotype::HASH_SIZE];
-  cInjectGenotypeControl * inject_genotype_control;
-  cStats & stats;
-
-private:
-  cString GetLabel(int in_size, int in_num);
-
-public:
-  cInjectGenebank(cWorld* world);
-  ~cInjectGenebank();
-
-  void UpdateReset();
-
-  /** 
-   * This function can be used to add a injectgenotype that was created
-   * outside the genebank. In this case, the parameter in_list_num
-   * should not be given. Normally, injectgenotypes are added through the 
-   * function AddInjectGenotype(const cGenome & in_genome, 
-   * cInjectGenotype * parent_injectgenotype = NULL), which then calls this one.
-   **/
-  void AddInjectGenotype(cInjectGenotype *in_inject_genotype, int in_list_num = -1 );
-  cInjectGenotype * AddInjectGenotype(const cGenome & in_genome,
-			  cInjectGenotype * parent_inject_genotype = NULL);
-  cInjectGenotype * FindInjectGenotype(const cGenome & in_genome) const;
-  void RemoveInjectGenotype(cInjectGenotype & in_inject_genotype);
-  void ThresholdInjectGenotype(cInjectGenotype & in_inject_genotype);
-  bool AdjustInjectGenotype(cInjectGenotype & in_inject_genotype);
-
-  bool SaveClone(std::ofstream& fp);
-  bool LoadClone(std::ifstream & fp);
-  bool DumpTextSummary(std::ofstream& fp);
-  //bool DumpDetailedSummary(std::ofstream& fp);
-  bool DumpDetailedSummary(const cString & file, int update);
-  /*
-  bool DumpHistoricSummary(std::ofstream& fp);
-  */
-  //void DumpDetailedEntry(cInjectGenotype * inject_genotype, std::ofstream& fp);
-  void DumpDetailedEntry(cInjectGenotype * inject_genotype, const cString & file, int update);
-  bool OK();
-
-  inline int GetSize() const { return inject_genotype_control->GetSize(); }
-  inline cInjectGenotype * GetBestInjectGenotype() const
-    { return inject_genotype_control->GetBest(); }
-  inline cInjectGenotype * GetCoalescentInjectGenotype() const
-    { return inject_genotype_control->GetCoalescent(); }
-  
-  inline cInjectGenotype * GetInjectGenotype(int thread) const
-    { return inject_genotype_control->Get(thread); }
-  inline cInjectGenotype * NextInjectGenotype(int thread) {
-    cInjectGenotype * next = inject_genotype_control->Next(thread);
-    return (next == inject_genotype_control->GetBest()) ? (cInjectGenotype*)NULL : next;
-  }
-  inline cInjectGenotype * ResetThread(int thread)
-    { return inject_genotype_control->Reset(thread); }
-
-  int CountNumCreatures();
-  inline int FindPos(cInjectGenotype & in_inject_genotype, int max_depth = -1)
-    { return inject_genotype_control->FindPos(in_inject_genotype, max_depth); }
-   unsigned int FindCRC(const cGenome & in_genome) const;
-};
-
-#endif

Deleted: development/source/main/cInjectGenotype.cc
===================================================================
--- development/source/main/cInjectGenotype.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenotype.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,151 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 "cInjectGenotype.h"
-
-#include "cTools.h"
-#include "cWorld.h"
-
-using namespace std;
-
-cInjectGenotype::cInjectGenotype(cWorld* world, int in_update_born, int in_id)
-  : m_world(world)
-  , genome(1)
-  , name("p001-no_name")
-  , flag_threshold(false)
-  , is_active(true)
-      , can_reproduce(false)
-  , defer_adjust(0)
-  , symbol(0)
-  , birth_data(in_update_born)
-  , num_injected(0)
-  , last_num_injected(0)
-  , total_injected(0)
-  , next(NULL)
-  , prev(NULL)
-{
-  static int next_id = 1;
-  
-  if ( in_id >= 0 )
-    next_id = in_id;
-  
-  id_num = next_id++;
-}
-
-cInjectGenotype::~cInjectGenotype()
-{
-  // Reset some of the variables to make sure program will crash if a deleted
-  // cell is read!
-  symbol = '!';
-
-  num_injected = -1;
-  total_injected = -1;
-
-  next = NULL;
-  prev = NULL;
-}
-
-bool cInjectGenotype::SaveClone(ofstream& fp)
-{
-  fp << id_num         << " ";
-  fp << genome.GetSize() << " ";
-
-  for (int i = 0; i < genome.GetSize(); i++) {
-    fp << ((int) genome[i].GetOp()) << " ";
-  }
-
-  return true;
-}
-
-bool cInjectGenotype::LoadClone(ifstream & fp)
-{
-  int genome_size = 0;
-
-  fp >> id_num;
-  fp >> genome_size;
-
-  genome = cGenome(genome_size);
-  for (int i = 0; i < genome_size; i++) {
-    cInstruction temp_inst;
-    int inst_op;
-    fp >> inst_op;
-    temp_inst.SetOp((UCHAR) inst_op);
-    genome[i] = temp_inst;
-    // @CAO add something here to load arguments for instructions.
-  }
-
-  return true;
-}
-
-bool cInjectGenotype::OK()
-{
-  bool ret_value = true;
-
-  // Check the components...
-
-  if (!genome.OK()) ret_value = false;
-
-  // And the statistics
-  assert( id_num >= 0 && num_injected >= 0 && total_injected >= 0 );
-  assert( birth_data.update_born >= -1);
-
-  return ret_value;
-}
-
-void cInjectGenotype::SetParent(cInjectGenotype * parent)
-{
-  birth_data.parent_genotype = parent;
-
-  // If we have a real parent genotype, collect other data about parent.
-  if (parent == NULL) return;
-  birth_data.parent_id = parent->GetID();
-  birth_data.gene_depth = parent->GetDepth() + 1;
-  parent->AddOffspringGenotype();
-}
-
-void cInjectGenotype::Mutate()  // Check each location to be mutated.
-{
-  int i;
-
-  for (i = 0; i < genome.GetSize(); i++) {
-      genome[i].SetOp(m_world->GetRandom().GetUInt(m_world->GetNumInstructions()));
-    }
-  
-}
-
-void cInjectGenotype::UpdateReset()
-{
-  last_num_injected = num_injected;
-  birth_data.birth_track.Next();
-  birth_data.death_track.Next();
-}
-
-void cInjectGenotype::SetGenome(const cGenome & in_genome)
-{
-  genome = in_genome;
-
-  name.Set("p%03d-no_name", genome.GetSize());
-}
-
-void cInjectGenotype::Deactivate(int update)
-{
-  is_active = false;
-  birth_data.update_deactivated = update;
-}
-
-int cInjectGenotype::AddParasite()
-{
-  total_injected++;
-  return num_injected++;
-}
-
-int cInjectGenotype::RemoveParasite()
-{
-  //birth_data.death_track.Inc();
-  return num_injected--;
-}
-

Deleted: development/source/main/cInjectGenotype.h
===================================================================
--- development/source/main/cInjectGenotype.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenotype.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,256 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 INJECT_GENOTYPE_HH
-#define INJECT_GENOTYPE_HH
-
-#include <fstream>
-
-#ifndef GENOME_HH
-#include "cGenome.h"
-#endif
-#ifndef INJECT_GENOTYPE_BIRTH_DATA_HH
-#include "cInjectGenotype_BirthData.h"
-#endif
-#ifndef STRING_HH
-#include "cString.h"
-#endif
-
-/*class cInjectGenotype_TestData {
-public:
-  cGenotype_TestData();
-  ~cGenotype_TestData();
-
-  bool is_viable;
-
-  double fitness;
-  double merit;
-  int gestation_time;
-  int executed_size;
-  int copied_size;
-  double colony_fitness;
-  int generations;
-  };*/
-
-class cGenome; // aggregate
-class cString; // aggregate
-class cInjectGenotype_BirthData; // aggregate
-class cWorld;
-
-class cInjectGenotype {
-private:
-  cWorld* m_world;
-  cGenome genome;
-  cString name;
-  bool flag_threshold;
-  bool is_active;      // Is this genotype still alive?
-  bool can_reproduce;  // Can this genotype reproduce?
-  int defer_adjust;    // Don't adjust in the genebank until all are cleared.
-
-  int id_num;
-  char symbol;
-
-  //mutable cGenotype_TestData test_data;
-  cInjectGenotype_BirthData birth_data;
-
-  // Statistical info
-
-  int num_injected;
-  int last_num_injected;
-  int total_injected;
-  //int total_parasites;
-
-  //cSpecies * species;
-
-  // Data Structure stuff...
-  cInjectGenotype * next;
-  cInjectGenotype * prev;
-
-
-  ////// Statistical info //////
-
-  // Collected on Divides
-  //cDoubleSum sum_copied_size;
-  //cDoubleSum sum_exe_size;
-
-  //cDoubleSum sum_gestation_time;
-  //cDoubleSum sum_repro_rate;  // should make gestation obsolete (not new)
-
-  //cDoubleSum sum_merit;
-  //cDoubleSum sum_fitness;
-
-  // Temporary (Approx stats used before any divides done)
-  // Set in "SetParent"
-  //cDoubleSum tmp_sum_copied_size;
-  //cDoubleSum tmp_sum_exe_size;
-
-  //cDoubleSum tmp_sum_gestation_time;
-  //cDoubleSum tmp_sum_repro_rate;
-
-  //cDoubleSum tmp_sum_merit;
-  //cDoubleSum tmp_sum_fitness;
-
-  void CalcTestStats() const;
-public:
-  /**
-   * Constructs an empty genotype. Normally, in_id should not specified as
-   * parameter, because cGenotype keeps track of the last id given out, and
-   * choses a new one based on that. However, in some cases it is necessary
-   * to specify an id (e.g., when loading a history file from disk). Note 
-   * that in this case, cGenotype does not check if the id has already been 
-   * used before.
-   **/
-  cInjectGenotype(cWorld* world, int in_update_born = 0, int in_id = -1);
-  ~cInjectGenotype();
-
-  bool SaveClone(std::ofstream& fp);
-  bool LoadClone(std::ifstream & fp);
-  bool OK();
-  void Mutate();
-  void UpdateReset();
-
-  void SetGenome(const cGenome & in_genome);
-  //void SetSpecies(cSpecies * in_species);
-
-  // Test CPU info -- only used with limited options on.
-  //bool GetTestViable() const;
-  //double GetTestFitness() const;
-  //double GetTestMerit() const;
-  //int GetTestGestationTime() const;
-  //int GetTestExecutedSize() const;
-  //int GetTestCopiedSize() const;
-  //double GetTestColonyFitness() const;
-  //int GetTestGenerations() const;
-
-  void SetParent(cInjectGenotype * parent);
-  void SetUpdateBorn (int update) { birth_data.update_born = update; }
-  void SetName(cString in_name)     { name = in_name; }
-  void SetNext(cInjectGenotype * in_next) { next = in_next; }
-  void SetPrev(cInjectGenotype * in_prev) { prev = in_prev; }
-  void SetSymbol(char in_symbol) { symbol = in_symbol; }
-  void SetCanReproduce() { can_reproduce = true; }
-  inline void SetThreshold();
-  void IncDeferAdjust() { defer_adjust++; }
-  void DecDeferAdjust() { defer_adjust--; assert(defer_adjust >= 0); }
-
-  // Setting New Stats
-  //void AddCopiedSize      (int in)   { sum_copied_size.Add(in); }
-  //void AddExecutedSize         (int in)   { sum_exe_size.Add(in); }
-  //void AddGestationTime   (int in)   { sum_gestation_time.Add(in);
-  //                            sum_repro_rate.Add(1/(double)in); }
-  //void AddMerit      (const cMerit & in);
-  //void RemoveMerit   (const cMerit & in);
-  //void AddFitness    (double in){
-  //  assert(in >= 0.0);
-  //  sum_fitness.Add(in);
-  //}
-  //void RemoveFitness (double in){
-  //  assert(in >= 0.0);
-  //  sum_fitness.Subtract(in);
-  //}
-  
-  //// Properties Native to Genotype ////
-  cGenome & GetGenome()             { return genome; }
-  const cGenome & GetGenome() const { return genome; }
-  int GetLength()             const { return genome.GetSize(); }
-  
-  //int GetBirths()    const { return birth_data.birth_track.GetTotal(); }
-  //int GetBreedOut()  const { return birth_data.breed_out_track.GetTotal(); }
-  //int GetBreedTrue() const { return birth_data.breed_true_track.GetTotal(); }
-  //int GetBreedIn()   const { return birth_data.breed_in_track.GetTotal(); }
-  
-  //int GetThisBirths()    const { return birth_data.birth_track.GetCur(); }
-  //int GetThisBreedOut()  const { return birth_data.breed_out_track.GetCur(); }
-  //int GetThisBreedTrue() const { return birth_data.breed_true_track.GetCur(); }
-  //int GetThisBreedIn()   const { return birth_data.breed_in_track.GetCur(); }
-  
-  //int GetThisDeaths() const { return birth_data.death_track.GetCur(); }
-  
-  //int GetLastNumOrganisms() const { return last_num_organisms; }
-  //int GetLastBirths()    const { return birth_data.birth_track.GetLast(); }
-  //int GetLastBreedOut()  const { return birth_data.breed_out_track.GetLast(); }
-  //int GetLastBreedTrue() const { return birth_data.breed_true_track.GetLast();}
-  //int GetLastBreedIn()   const { return birth_data.breed_in_track.GetLast(); }
-  
-  //inline void SetBreedStats(cGenotype & daughter); // called by ActivateChild
-  
-  //// Properties Averaged Over Creatues ////
-  //double GetCopiedSize()    const { return (sum_copied_size.Count()>0) ?
-  //   sum_copied_size.Average() : tmp_sum_copied_size.Average(); }
-  //double GetExecutedSize()  const { return (sum_exe_size.Count()>0) ?
-  //   sum_exe_size.Average() : tmp_sum_exe_size.Average(); }
-  //double GetGestationTime() const { return (sum_gestation_time.Count()>0) ?
-  //   sum_gestation_time.Average() : tmp_sum_gestation_time.Average(); }
-  //double GetReproRate()     const { return (sum_repro_rate.Count()>0) ?
-  //   sum_repro_rate.Average() : tmp_sum_repro_rate.Average(); }
-  //double GetMerit()         const { return (sum_merit.Count()>0) ?
-  //   sum_merit.Average() : tmp_sum_merit.Average(); }
-  //double GetFitness()       const { return (sum_fitness.Count()>0) ?
-  //   sum_fitness.Average() : tmp_sum_fitness.Average(); }
-  
-  
-  // For tracking the genotype line back to the ancestor...
-  cInjectGenotype * GetParentGenotype() { return birth_data.parent_genotype; }
-  int GetNumOffspringGenotypes() const
-    { return birth_data.num_offspring_genotypes; }
-  void AddOffspringGenotype() { birth_data.num_offspring_genotypes++; }
-  void RemoveOffspringGenotype() { birth_data.num_offspring_genotypes--; }
-  bool GetActive() const { return is_active; }
-  // bool GetDeferAdjust() const { return defer_adjust > 0; }
-  int GetUpdateDeactivated() { return birth_data.update_deactivated; }
-  void Deactivate(int update);
-
-  bool CanReproduce()           { return can_reproduce; }
-  int GetUpdateBorn()           { return birth_data.update_born; }
-  int GetParentID()             { return birth_data.parent_id; }
-  //int GetParentDistance()       { return birth_data.parent_distance; }
-  int GetDepth()                { return birth_data.gene_depth; }
-  cString & GetName()           { return name; }
-  cInjectGenotype * GetNext()         { return next; }
-  cInjectGenotype * GetPrev()         { return prev; }
-  bool GetThreshold() const     { return flag_threshold; }
-  int GetID() const             { return id_num; }
-  char GetSymbol() const        { return symbol; }
-
-  int AddParasite();
-  int RemoveParasite();
-  //int AddParasite()        { return ++total_parasites; }
-  //void SwapOrganism()      { total_organisms++; }
-  int GetNumInjected()    { return num_injected; }
-  int GetTotalInjected()  { return total_injected; }
-  //int GetTotalParasites()  { return total_parasites; }
-};
-
-// The genotype pointer template...
-
-
-
-// All the inline stuff...
-
-  ////////////////
- //  cGenotype //
-////////////////
-
-inline void cInjectGenotype::SetThreshold()
-{
-  flag_threshold = true;
-  if (symbol == '.') symbol = '+';
-}
-
-/*
-inline void cGenotype::SetBreedStats(cGenotype & daughter)
-{
-  birth_data.birth_track.Inc();
-  if (daughter.id_num == id_num) {
-    birth_data.breed_true_track.Inc();
-  } else {
-    birth_data.breed_out_track.Inc();
-    daughter.birth_data.breed_in_track.Inc();
-  }
-}*/
-
-#endif

Deleted: development/source/main/cInjectGenotypeControl.cc
===================================================================
--- development/source/main/cInjectGenotypeControl.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenotypeControl.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,288 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 INJECT_GENOTYPE_CONTROL_HH
-#include "cInjectGenotypeControl.h"
-#endif
-
-#ifndef DEFS_HH
-#include "defs.h"
-#endif
-#ifndef INJECT_GENEBANK_HH
-#include "cInjectGenebank.h"
-#endif
-#ifndef INJECT_GENOTYPE_HH
-#include "cInjectGenotype.h"
-#endif
-
-////////////////////////////
-//  cInjectGenotypeControl
-////////////////////////////
-
-cInjectGenotypeControl::cInjectGenotypeControl(cInjectGenebank & in_gb) : genebank(in_gb)
-{
-  size = 0;
-  best = NULL;
-  coalescent = NULL;
-  for (int i = 0; i < nInjectGenotype::THREADS; i++) threads[i] = NULL;
-
-  historic_list = NULL;
-  historic_count = 0;
-}
-
-cInjectGenotypeControl::~cInjectGenotypeControl()
-{
-}
-
-bool cInjectGenotypeControl::OK()
-{
-  int ret_value = true;
-
-  // Cycle through the list, making sure all connections are proper, size
-  // is correct, and all genotypes are OK().
-
-  cInjectGenotype * cur_pos = best;
-  for (int i = 0; i < size; i++) {
-    if (!cur_pos->OK()) ret_value = false;
-    assert (cur_pos->GetNext()->GetPrev() == cur_pos);
-    cur_pos = cur_pos->GetNext();
-  }
-
-  assert (cur_pos == best);
-
-  return ret_value;
-}
-
-void cInjectGenotypeControl::Insert(cInjectGenotype & in_inject_genotype, cInjectGenotype * prev_genotype)
-{
-  if (prev_genotype == NULL) {
-    assert(size == 0); // Destroying a full genotype queue...
-
-    best = &in_inject_genotype;
-    best->SetNext(best);
-    best->SetPrev(best);
-  }
-  else {
-    in_inject_genotype.SetPrev(prev_genotype);
-    in_inject_genotype.SetNext(prev_genotype->GetNext());
-    prev_genotype->SetNext(&in_inject_genotype);
-    in_inject_genotype.GetNext()->SetPrev(&in_inject_genotype);
-  }
-
-  size++;
-}
-
-void cInjectGenotypeControl::Remove(cInjectGenotype & in_inject_genotype)
-{
-  if (size == 1) {
-    best = NULL;
-  }
-  if (&in_inject_genotype == best) {
-    best = best->GetNext();
-  }
-
-  in_inject_genotype.GetNext()->SetPrev(in_inject_genotype.GetPrev());
-  in_inject_genotype.GetPrev()->SetNext(in_inject_genotype.GetNext());
-  in_inject_genotype.SetNext(NULL);
-  in_inject_genotype.SetPrev(NULL);
-
-  size--;
-}
-
-void cInjectGenotypeControl::RemoveHistoric(cInjectGenotype & in_inject_genotype)
-{
-  if (historic_count == 1) {
-    historic_list = NULL;
-  }
-  if (&in_inject_genotype == historic_list) {
-    historic_list = historic_list->GetNext();
-  }
-
-  in_inject_genotype.GetNext()->SetPrev(in_inject_genotype.GetPrev());
-  in_inject_genotype.GetPrev()->SetNext(in_inject_genotype.GetNext());
-  in_inject_genotype.SetNext(NULL);
-  in_inject_genotype.SetPrev(NULL);
-
-  historic_count--;
-}
-
-void cInjectGenotypeControl::InsertHistoric(cInjectGenotype & in_inject_genotype)
-{
-  if (historic_count == 0) {
-    in_inject_genotype.SetNext(&in_inject_genotype);
-    in_inject_genotype.SetPrev(&in_inject_genotype);
-  }
-  else {
-    in_inject_genotype.SetPrev(historic_list->GetPrev());
-    in_inject_genotype.SetNext(historic_list);
-    historic_list->GetPrev()->SetNext(&in_inject_genotype);
-    historic_list->SetPrev(&in_inject_genotype);
-  }
-
-  historic_list = &in_inject_genotype;
-  historic_count++;
-}
-
-/*int cInjectGenotypeControl::UpdateCoalescent()
-{
-  // Test to see if any updating needs to be done...
-  // Don't update active coalescent genotype, or if there is more than
-  // one offspring.
-  if (coalescent != NULL &&
-      (coalescent->GetNumInjected() > 0) ||
-      coalescent->GetNumOffspringGenotypes() > 1) ) {
-    return coalescent->GetDepth();
-  }
-
-  // If there is no best, there is nothing to search through...
-  if (best == NULL) return -1;
-
-  // Find the new point...
-  cInjectGenotype * test_gen = best;
-  cInjectGenotype * found_gen = best;
-  cInjectGenotype * parent_gen = best->GetParentGenotype();
-
-  while (parent_gen != NULL) {
-    // See if this genotype should be the new found genotype...
-    if (test_gen->GetNumOrganisms() > 0 ||
-	test_gen->GetNumOffspringGenotypes() > 1) {
-      found_gen = test_gen;
-    }
-
-    // Move to the next genotype...
-    test_gen = parent_gen;
-    parent_gen = test_gen->GetParentGenotype();
-  }
-
-  coalescent = found_gen;
-
-  return coalescent->GetDepth();
-}*/
-
-
-bool cInjectGenotypeControl::CheckPos(cInjectGenotype & in_inject_genotype)
-{
-  int next_OK = false;
-  int prev_OK = false;
-
-  if (in_inject_genotype.GetNumInjected() >= in_inject_genotype.GetNext()->GetNumInjected()) {
-    next_OK =true;
-  }
-  if (in_inject_genotype.GetNumInjected() <= in_inject_genotype.GetPrev()->GetNumInjected()) {
-    prev_OK =true;
-  }
-
-  if ((&in_inject_genotype == best && next_OK) ||
-      (next_OK && prev_OK) ||
-      (&in_inject_genotype == best->GetPrev() && prev_OK)) {
-    return true;
-  }
-
-  return false;
-}
-
-void cInjectGenotypeControl::Insert(cInjectGenotype & new_genotype)
-{
-  // If there is nothing in the list, add this.
-
-  if (size == 0) {
-    Insert(new_genotype, NULL);
-  }
-
-  // Otherwise tack it on the end.
-
-  else {
-    Insert(new_genotype, best->GetPrev());
-  }
-}
-
-bool cInjectGenotypeControl::Adjust(cInjectGenotype & in_inject_genotype)
-{
-  //if (in_inject_genotype.GetDeferAdjust() == true) return true;
-
-  cInjectGenotype * cur_inject_genotype = in_inject_genotype.GetPrev();
-
-  // Check to see if this genotype should be removed completely.
-
-  if (in_inject_genotype.GetNumInjected() == 0) {
-    genebank.RemoveInjectGenotype(in_inject_genotype);
-    return false;
-  }
-
-  // Do not adjust if this was and still is the best genotype, or is
-  // otherwise in the proper spot...
-
-  if (CheckPos(in_inject_genotype)) {
-    return true;
-  }
-
-  // Otherwise, remove it from the queue for just the moment.
-
-  Remove(in_inject_genotype);
-
-  // Also, if this genotype is the best, put it there.
-
-  if (in_inject_genotype.GetNumInjected() > best->GetNumInjected()) {
-    Insert(in_inject_genotype, best->GetPrev());
-    best = &in_inject_genotype;
-    return true;
-  }
-
-  // Finally, find out where this genotype *does* go.
-
-  while (cur_inject_genotype->GetNumInjected() >= in_inject_genotype.GetNumInjected() &&
-	 cur_inject_genotype != best->GetPrev()) {
-    cur_inject_genotype = cur_inject_genotype->GetNext();
-  }
-  while (cur_inject_genotype->GetNumInjected() < in_inject_genotype.GetNumInjected() &&
-	 cur_inject_genotype != best) {
-    cur_inject_genotype = cur_inject_genotype->GetPrev();
-  }
-
-  Insert(in_inject_genotype, cur_inject_genotype);
-
-  return true;
-}
-
-
-cInjectGenotype * cInjectGenotypeControl::Find(const cGenome & in_genome) const
-{
-  int i;
-  cInjectGenotype * cur_inject_genotype = best;
-
-  for (i = 0; i < size; i++) {
-    if (in_genome == cur_inject_genotype->GetGenome()) {
-      return cur_inject_genotype;
-    }
-    cur_inject_genotype = cur_inject_genotype->GetNext();
-  }
-
-  return NULL;
-}
-
-int cInjectGenotypeControl::FindPos(cInjectGenotype & in_inject_genotype, int max_depth)
-{
-  cInjectGenotype * temp_genotype = best;
-  if (max_depth < 0 || max_depth > size) max_depth = size;
-
-  for (int i = 0; i < max_depth; i++) {
-    if (temp_genotype == &in_inject_genotype) return i;
-    temp_genotype = temp_genotype->GetNext();
-  }
-
-  return -1;
-}
-
-cInjectGenotype * cInjectGenotypeControl::Next(int thread)
-{
-  return threads[thread] = threads[thread]->GetNext();
-}
-
-cInjectGenotype * cInjectGenotypeControl::Prev(int thread)
-{
-  return threads[thread] = threads[thread]->GetPrev();
-}

Deleted: development/source/main/cInjectGenotypeControl.h
===================================================================
--- development/source/main/cInjectGenotypeControl.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenotypeControl.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,64 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 INJECT_GENOTYPE_CONTROL_HH
-#define INJECT_GENOTYPE_CONTROL_HH
-
-#ifndef nInjectGenotype_h
-#include "nInjectGenotype.h"
-#endif
-
-class cGenome;
-class cInjectGenotype;
-class cInjectGenebank;
-class cInjectGenotypeControl {
-private:
-  int size;
-  cInjectGenotype * best;
-  cInjectGenotype * coalescent;
-  cInjectGenotype * threads[nInjectGenotype::THREADS];
-  cInjectGenebank & genebank;
-
-  cInjectGenotype * historic_list;
-  int historic_count;
-
-  void Insert(cInjectGenotype & in_inject_genotype, cInjectGenotype * prev_inject_genotype);
-  bool CheckPos(cInjectGenotype & in_inject_genotype);
-public:
-  cInjectGenotypeControl(cInjectGenebank & in_gb);
-  ~cInjectGenotypeControl();
-
-  bool OK();
-  void Remove(cInjectGenotype & in_inject_genotype);
-  void Insert(cInjectGenotype & new_inject_genotype);
-  bool Adjust(cInjectGenotype & in_inject_genotype);
-
-  void RemoveHistoric(cInjectGenotype & in_inject_genotype);
-  void InsertHistoric(cInjectGenotype & in_inject_genotype);
-  int GetHistoricCount() { return historic_count; }
-
-  /*
-  int UpdateCoalescent();
-  */
-
-  inline int GetSize() const { return size; }
-  inline cInjectGenotype * GetBest() const { return best; }
-  inline cInjectGenotype * GetCoalescent() const { return coalescent; }
-
-  cInjectGenotype * Find(const cGenome & in_genome) const;
-  int FindPos(cInjectGenotype & in_inject_genotype, int max_depth = -1);
-
-  inline cInjectGenotype * Get(int thread) const { return threads[thread]; }
-  inline cInjectGenotype * Reset(int thread)
-    { return threads[thread] = best; }
-  inline cInjectGenotype * ResetHistoric(int thread)
-    { return threads[thread] = historic_list; }
-  cInjectGenotype * Next(int thread);
-  cInjectGenotype * Prev(int thread);
-};
-
-#endif

Deleted: development/source/main/cInjectGenotypeElement.h
===================================================================
--- development/source/main/cInjectGenotypeElement.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenotypeElement.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,35 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 INJECT_GENOTYPE_ELEMENT_HH
-#define INJECT_GENOTYPE_ELEMENT_HH
-
-#ifndef DEFS_HH
-#include "defs.h"
-#endif
-
-class cInjectGenotype;
-class cInjectGenotypeElement {
-private:
-  cInjectGenotype * inject_genotype;
-  cInjectGenotypeElement * next;
-  cInjectGenotypeElement * prev;
-public:
-  inline cInjectGenotypeElement(cInjectGenotype * in_gen=NULL) : inject_genotype(in_gen) {
-    next = NULL;  prev = NULL;
-  }
-  inline ~cInjectGenotypeElement() { ; }
-
-  inline cInjectGenotype * GetInjectGenotype() const { return inject_genotype; }
-  inline cInjectGenotypeElement * GetNext() const { return next; }
-  inline cInjectGenotypeElement * GetPrev() const { return prev; }
-
-  inline void SetNext(cInjectGenotypeElement * in_next) { next = in_next; }
-  inline void SetPrev(cInjectGenotypeElement * in_prev) { prev = in_prev; }
-};
-
-#endif

Deleted: development/source/main/cInjectGenotypeQueue.cc
===================================================================
--- development/source/main/cInjectGenotypeQueue.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenotypeQueue.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,104 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 INJECT_GENOTYPE_QUEUE_HH
-#include "cInjectGenotypeQueue.h"
-#endif
-
-#ifndef INJECT_GENOTYPE_HH
-#include "cInjectGenotype.h"
-#endif
-
-#include <assert.h>
-
-/////////////////////
-//  cInjectGenotypeQueue
-/////////////////////
-
-cInjectGenotypeQueue::cInjectGenotypeQueue()
-{
-  size = 0;
-  root.SetNext(&root);
-  root.SetPrev(&root);
-}
-
-
-cInjectGenotypeQueue::~cInjectGenotypeQueue()
-{
-  while (root.GetNext() != &root) {
-    Remove(root.GetNext());
-  }
-}
-
-bool cInjectGenotypeQueue::OK()
-{
-  bool result = true;
-  int count = 0;
-
-  for (cInjectGenotypeElement * temp_element = root.GetNext();
-       temp_element != &root;
-       temp_element = temp_element->GetNext()) {
-    assert (temp_element->GetNext()->GetPrev() == temp_element);
-    assert (temp_element->GetInjectGenotype()->GetID() >= 0);
-
-    count++;
-    assert (count <= size);
-  }
-
-  assert (count == size);
-
-  return result;
-}
-
-void cInjectGenotypeQueue::Insert(cInjectGenotype & in_inject_genotype)
-{
-  cInjectGenotypeElement * new_element = new cInjectGenotypeElement(&in_inject_genotype);
-  new_element->SetNext(root.GetNext());
-  new_element->SetPrev(&root);
-  root.GetNext()->SetPrev(new_element);
-  root.SetNext(new_element);
-  size++;
-}
-
-void cInjectGenotypeQueue::Remove(cInjectGenotype & in_inject_genotype)
-{
-  cInjectGenotypeElement * cur_element;
-
-  for (cur_element = root.GetNext();
-       cur_element != &root;
-       cur_element = cur_element->GetNext()) {
-    if (cur_element->GetInjectGenotype() == &in_inject_genotype) break;
-  }
-
-  assert (cur_element != &root);
-
-  Remove(cur_element);
-}
-
-void cInjectGenotypeQueue::Remove(cInjectGenotypeElement * in_element)
-{
-  in_element->GetPrev()->SetNext(in_element->GetNext());
-  in_element->GetNext()->SetPrev(in_element->GetPrev());
-  in_element->SetNext(NULL);
-  in_element->SetPrev(NULL);
-  delete(in_element);
-
-  size--;
-}
-
-cInjectGenotype * cInjectGenotypeQueue::Find(const cGenome & in_genome) const
-{
-  for (cInjectGenotypeElement * cur_element = root.GetNext();
-       cur_element != &root;
-       cur_element = cur_element->GetNext()) {
-    if (cur_element->GetInjectGenotype()->GetGenome() == in_genome) {
-      return cur_element->GetInjectGenotype();
-    }
-  }
-
-  return NULL;
-}

Deleted: development/source/main/cInjectGenotypeQueue.h
===================================================================
--- development/source/main/cInjectGenotypeQueue.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenotypeQueue.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,34 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 INJECT_GENOTYPE_QUEUE_HH
-#define INJECT_GENOTYPE_QUEUE_HH
-
-#ifndef INJECT_GENOTYPE_ELEMENT_HH
-#include "cInjectGenotypeElement.h"
-#endif
-
-class cInjectGenotype;
-class cGenome;
-class cInjectGenotypeQueue {
-private:
-  int size;
-  cInjectGenotypeElement root;
-
-  void Remove(cInjectGenotypeElement * in_element);
-public:
-  cInjectGenotypeQueue();
-  ~cInjectGenotypeQueue();
-
-  bool OK();
-
-  void Insert(cInjectGenotype & in_inject_genotype);
-  void Remove(cInjectGenotype & in_inject_genotype);
-  cInjectGenotype * Find(const cGenome & in_genome) const;
-};
-
-#endif

Deleted: development/source/main/cInjectGenotype_BirthData.cc
===================================================================
--- development/source/main/cInjectGenotype_BirthData.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenotype_BirthData.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,32 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 INJECT_GENOTYPE_BIRTH_DATA_HH
-#include "cInjectGenotype_BirthData.h"
-#endif
-
-#ifndef DEFS_HH
-#include "defs.h"
-#endif
-
-/////////////////////////
-//  cInjectGenotype_BirthData
-/////////////////////////
-
-cInjectGenotype_BirthData::cInjectGenotype_BirthData(int in_update_born)
-  : update_born(in_update_born)
-  , parent_id(-1)
-  , gene_depth(0)
-  , update_deactivated(-1)
-  , parent_genotype(NULL)
-  , num_offspring_genotypes(0)
-{
-}
-
-cInjectGenotype_BirthData::~cInjectGenotype_BirthData()
-{
-}

Deleted: development/source/main/cInjectGenotype_BirthData.h
===================================================================
--- development/source/main/cInjectGenotype_BirthData.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInjectGenotype_BirthData.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,38 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 INJECT_GENOTYPE_BIRTH_DATA_HH
-#define INJECT_GENOTYPE_BIRTH_DATA_HH
-
-#ifndef COUNT_TRACKER_HH
-#include "cCountTracker.h"
-#endif
-
-class cInjectGenotype;
-class cInjectGenotype_BirthData {
-public:
-  cInjectGenotype_BirthData(int in_update_born);
-  ~cInjectGenotype_BirthData();
-
-  cCountTracker birth_track;
-  cCountTracker death_track;
-  //cCountTracker breed_in_track;
-  //cCountTracker breed_true_track;
-  //cCountTracker breed_out_track;
-
-  int update_born;      // Update genotype was first created
-  int parent_id;        // ID of parent genotype
-  //int parent_distance;  // Genetic distance from parent genotype
-  int gene_depth;       // depth in the phylogenetic tree from ancestor
-
-  int update_deactivated;      // If not, when did it get deactivated?
-  cInjectGenotype * parent_genotype; // Pointer to parent genotype...
-  //cSpecies * parent_species;
-  int num_offspring_genotypes; // Num offspring genotypes still in memory.
-};
-
-#endif

Modified: development/source/main/cInstSet.cc
===================================================================
--- development/source/main/cInstSet.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInstSet.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -27,7 +27,7 @@
   , m_inst_lib(in_inst_set.m_inst_lib)
   , m_lib_name_map(in_inst_set.m_lib_name_map)
   , m_lib_nopmod_map(in_inst_set.m_lib_nopmod_map)
-  , mutation_chart2(in_inst_set.mutation_chart2)
+  , m_mutation_chart(in_inst_set.m_mutation_chart)
 {
 }
 
@@ -40,7 +40,7 @@
   m_inst_lib = _in.m_inst_lib;
   m_lib_name_map = _in.m_lib_name_map;
   m_lib_nopmod_map = _in.m_lib_nopmod_map;
-  mutation_chart2 = _in.mutation_chart2;
+  m_mutation_chart = _in.m_mutation_chart;
   return *this;
 }
 
@@ -53,8 +53,8 @@
   // number of times.
   tArray<int> test_redundancy2(m_lib_name_map.GetSize());
   test_redundancy2.SetAll(0);
-  for (int i = 0; i < mutation_chart2.GetSize(); i++) {
-    int test_id = mutation_chart2[i];
+  for (int i = 0; i < m_mutation_chart.GetSize(); i++) {
+    int test_id = m_mutation_chart[i];
     test_redundancy2[test_id]++;
   }
   for (int i = 0; i < m_lib_name_map.GetSize(); i++) {
@@ -66,11 +66,11 @@
 
 cInstruction cInstSet::GetRandomInst() const
 {
-  int inst_op = mutation_chart2[m_world->GetRandom().GetUInt(mutation_chart2.GetSize())];
+  int inst_op = m_mutation_chart[m_world->GetRandom().GetUInt(m_mutation_chart.GetSize())];
   return cInstruction(inst_op);
 }
 
-int cInstSet::Add2(
+int cInstSet::AddInst(
   const int lib_fun_id,
   const int redundancy,
   const int ft_cost,
@@ -92,16 +92,16 @@
   m_lib_name_map[inst_id].ft_cost = ft_cost;
   m_lib_name_map[inst_id].prob_fail = prob_fail;
 
-  const int total_redundancy = mutation_chart2.GetSize();
-  mutation_chart2.Resize(total_redundancy + redundancy);
+  const int total_redundancy = m_mutation_chart.GetSize();
+  m_mutation_chart.Resize(total_redundancy + redundancy);
   for (int i = 0; i < redundancy; i++) {
-    mutation_chart2[total_redundancy + i] = inst_id;
+    m_mutation_chart[total_redundancy + i] = inst_id;
   }
 
   return inst_id;
 }
 
-int cInstSet::AddNop2(
+int cInstSet::AddNop(
   const int lib_nopmod_id,
   const int redundancy,
   const int ft_cost,
@@ -112,7 +112,7 @@
   // Assert nops are at the _beginning_ of an inst_set.
   assert(m_lib_name_map.GetSize() == m_lib_nopmod_map.GetSize());
 
-  const int inst_id = Add2(lib_nopmod_id, redundancy, ft_cost, cost, prob_fail);
+  const int inst_id = AddInst(lib_nopmod_id, redundancy, ft_cost, cost, prob_fail);
 
   m_lib_nopmod_map.Resize(inst_id + 1);
   m_lib_nopmod_map[inst_id] = lib_nopmod_id;

Modified: development/source/main/cInstSet.h
===================================================================
--- development/source/main/cInstSet.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cInstSet.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -39,7 +39,7 @@
 public:
   cWorld* m_world;
   cInstLibBase *m_inst_lib;
-  class cInstEntry2 {
+  class cInstEntry {
   public:
     int lib_fun_id;
     int redundancy;           // Weight in instruction set (not impl.)
@@ -47,9 +47,9 @@
     int ft_cost;              // time spent first time exec (in add to cost)
     double prob_fail;         // probability of failing to execute inst
   };
-  tArray<cInstEntry2> m_lib_name_map;
+  tArray<cInstEntry> m_lib_name_map;
   tArray<int> m_lib_nopmod_map;
-  tArray<int> mutation_chart2;     // ID's represented by redundancy values.
+  tArray<int> m_mutation_chart;     // ID's represented by redundancy values.
   // Static components...
   static cInstruction inst_error2;
   // static const cInstruction inst_none;
@@ -125,14 +125,14 @@
   }
 
   // Insertion of new instructions...
-  int Add2(
+  int AddInst(
     const int lib_fun_id,
     const int redundancy=1,
     const int ft_cost=0,
     const int cost=0,
     const double prob_fail=0.0
   );
-  int AddNop2(
+  int AddNop(
     const int lib_nopmod_id,
     const int redundancy=1,
     const int ft_cost=0,

Deleted: development/source/main/cLineage.cc
===================================================================
--- development/source/main/cLineage.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cLineage.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,155 +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 LINEAGE_HH
-#include "cLineage.h"
-#endif
-#ifndef GENOTYPE_HH
-#include "cGenotype.h"
-#endif
-
-using namespace std;
-
-
-bool gt_gentype::operator()(const cGenotype * g1, const cGenotype * g2) const
-{
-  return g1->GetID() > g2->GetID();
-}
-
-int cLineage::m_max_id = 0;
-
-cLineage::cLineage(double start_fitness, int parent_id, int id, int update,
-		   double generation,  double lineage_stat1, double lineage_stat2)
-  : m_parent_id(parent_id)
-  , m_update_born(update)
-  , m_num_CPUs(0)
-  , m_total_CPUs(0)
-  , m_total_genotypes(0)
-  , m_generation_born(generation)
-  , m_lineage_stat1(lineage_stat1)
-  , m_lineage_stat2(lineage_stat2)
-{
-  if ( id < 0 )
-    m_id = m_max_id++;
-  else{
-    m_id = id;
-    if ( id >= m_max_id )
-      m_max_id = id + 1;
-  }
-  m_start_fitness = m_max_fitness = m_max_fitness_ever = start_fitness;
-  m_ave_fitness = 0;
-  m_ave_fitness_changed = true;
-  m_threshold = false;
-}
-
-cLineage::~cLineage()
-{
-}
-
-void cLineage::AddCreature(cGenotype * genotype)
-{
-  // add the new genotype to the map if necessary, otherwise
-  // find its position
-  pair<map<const cGenotype *, int, gt_gentype>::iterator, bool> p =
-    m_genotype_map.insert( pair<const cGenotype*, int>( genotype, 0 ) );
-
-  // did we add a new genotype?
-  if ( ( p.second ) == true )
-    m_total_genotypes += 1;
-
-  // increase the count for the given genotype by one.
-  (*(p.first)).second += 1;
-
-  // The above lines could be written like that:
-  //     m_genotype_map[ genotype ] += 1;
-  // if we didn't want to count how often we add a new genotype
-
-  double fitness = genotype->GetTestColonyFitness();
-
-  // adjust the current maximum fitness
-  if ( fitness > m_max_fitness )
-    m_max_fitness = fitness;
-   // adjust overall maxiumum fitness
-  if ( fitness> m_max_fitness_ever )
-    m_max_fitness_ever = fitness;
-  // the average fitness has changed as well
-  m_ave_fitness_changed = true;
-
-  m_num_CPUs++;
-  m_total_CPUs++;
-}
-
-bool cLineage::RemoveCreature(cGenotype * genotype)
-{
-  // we return true if the removal of this creature triggers a
-  // recalculation of the best lineage
-  bool result = false;
-
-  map<const cGenotype *, int, gt_gentype>::iterator cur = m_genotype_map.find( genotype );
-
-  // is the genotype part of the map?
-  if ( cur == m_genotype_map.end() ){
-    cerr << "Removing creature from lineage whose genotype is not part of the lineage!" << endl;
-    cerr << "  " << genotype->GetName()() << " " << GetID() << endl;
-    return false;
-  }
-
-  // yes, decrease the count
-  (*cur).second -= 1;
-  // and adjust the average fitness
-  m_ave_fitness_changed = true;
-
-  double fitness = genotype->GetTestColonyFitness();
-
-  // did we reach zero?
-  if ( (*cur).second == 0 ){
-    // yes, remove the entry
-    m_genotype_map.erase( cur );
-    // make sure that the maximum fitness is correct
-    if (fitness == m_max_fitness) CalcCurrentFitness();
-    // adjust the return value
-    result = true;
-  }
-
-  // and now the total cpu count
-  m_num_CPUs--;
-
-  return result;
-}
-
-int cLineage::CountNumCreatures() const
-{
-  int creature_count = 0;
-
-  map<const cGenotype *, int, gt_gentype>::const_iterator it =
-    m_genotype_map.begin();
-
-  for ( ; it!=m_genotype_map.end(); it++ )
-    creature_count += (*it).second;
-
-  return creature_count;
-}
-
-void cLineage::CalcCurrentFitness() const
-{
-  m_max_fitness = 0.0;
-  map<const cGenotype *, int, gt_gentype>::const_iterator it =
-    m_genotype_map.begin();
-
-  // we calculate the average fitness as well, since it is so easy.
-  m_ave_fitness = 0;
-  for ( ; it!=m_genotype_map.end(); it++ ){
-    double fitness = (*it).first->GetTestColonyFitness();
-    if (fitness > m_max_fitness) m_max_fitness = fitness;
-    if (fitness > m_max_fitness_ever) m_max_fitness_ever = fitness;
-    m_ave_fitness += fitness * (*it).second;
-  }
-  m_ave_fitness /= (double) m_num_CPUs;
-  m_ave_fitness_changed = false;
-}
-
-

Deleted: development/source/main/cLineage.h
===================================================================
--- development/source/main/cLineage.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cLineage.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,168 +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 LINEAGE_HH
-#define LINEAGE_HH
-
-#include <map>
-
-class cGenotype;
-
-// struct to compare to genotypes
-struct gt_gentype
-{
-  bool operator()(const cGenotype * g1, const cGenotype * g2) const;
-};
-
-class cLineage {
-private:
-  static int m_max_id;
-  int m_id;
-  int m_parent_id;
-  int m_update_born;
-  int m_num_CPUs;
-  int m_total_CPUs;
-  int m_total_genotypes;
-  double m_start_fitness;
-  mutable double m_max_fitness;
-  mutable double m_ave_fitness;
-  double m_generation_born;
-
-  std::map<const cGenotype *, int, gt_gentype> m_genotype_map;
-  bool m_threshold;
-  mutable bool m_ave_fitness_changed;
-  mutable double m_max_fitness_ever;
-  double m_lineage_stat1;
-  double m_lineage_stat2;
-
-  void CalcCurrentFitness() const;
-public:
-  /**
-   * Creates a new lineage with a given start fitness and parent id.
-   * The first genotype has to be added with AddGenotype later.
-   *
-   * @param start_fitness The initial fitness of the lineage.
-   * @param parent_id The id of the parent's lineage.
-   * @param id The requested id for this lineage. If negative, a generated
-   * value is used. Attention: if you request lineage id's, it is your
-   * responsibility not to request two identical ones for different lineages
-   * (the class @ref cLineageControl does that correctly).
-   **/
-  cLineage(double start_fitness, int parent_id, int id,
-	   int update, double generation,
-	   double lineage_stat1 = 0.0, double lineage_stat2 = 0.0);
-  ~cLineage();
-
-  /**
-   * Adds one instance of the given genotype to the lineage.
-   **/
-  void AddCreature( cGenotype * genotype );
-
-  /**
-   * Removes on instance of the given genotype from the lineage.
-   *
-   * @return True if the removal of this creature potentially creates a new
-   * best lineage, otherwise false.
-   **/
-  bool RemoveCreature( cGenotype * genotype );
-  void SetThreshold() { m_threshold = true; }
-
-  /**
-   * @return The id of the lineage.
-   **/
-  int GetID() const { return m_id; }
-
-  /**
-   * @return The id of the parent lineage.
-   **/
-  int GetParentID() const { return m_parent_id; }
-
-  /**
-   * @return An integer that is one larger than the maximum id used so far.
-   **/
-  int GetMaxID() const { return m_max_id; }
-
-  /**
-   * @return The update at which the lineage was created.
-   **/
-  int GetUpdateBorn() const { return m_update_born; }
-
-  /**
-   * @return The generation at which the lineage was created.
-   **/
-  double GetGenerationBorn() const { return m_generation_born; }
-
-  /**
-   * @return The initial fitness of the lineage.
-   **/
-  double GetStartFitness() const { return m_start_fitness; }
-
-  /**
-   * @return The current maximum fitness of the lineage.
-   **/
-  double GetMaxFitness() const { return m_max_fitness; }
-  
-  /**
-   * @return The average fitness of the lineage.
-   **/
-  double GetAveFitness() const {
-    if ( m_ave_fitness_changed )
-      CalcCurrentFitness();
-    return m_ave_fitness; }
-
-  /**
-   * @return The current number of genotypes in the lineage.
-   **/
-  int GetNumGenotypes() const { return m_genotype_map.size(); }
-
-  /**
-   * @return The current number of creatures in the lineage.
-   **/
-  int GetNumCreatures() const { return m_num_CPUs; }
-
-  /**
-   * Counts the number of creatures in the lineage.
-   *
-   * Should always equal GetNumCreatures(), otherwise something
-   * is wrong.
-   **/
-  int CountNumCreatures() const;
-
-  /**
-   * @return The total number of creatures that have ever existed
-   * in this lineage.
-   **/
-  int GetTotalCreatures() const { return m_total_CPUs; }
-
-  /**
-   * @return The total number of genotypes that have ever been part
-   * of this lineage.
-   **/
-  int GetTotalGenotypes() const { return m_total_genotypes; }
-
-  bool GetThreshold() const { return m_threshold; }
-    
-  /**
-   * @return The maximum fitness ever attained by this lineage
-   **/
-  double GetMaxFitnessEver() const { return m_max_fitness_ever; }
-
-  /**
-   * @return The value of the first fitness criteria for
-   * the creation of this lineage
-   **/
-  double GetLineageStat1 () const { return m_lineage_stat1; }
-
-  /**
-   * @return The value of the second fitness criteria for
-   * the creation of this lineage
-   **/
-  double GetLineageStat2 () const { return m_lineage_stat2; }
-
-};
-
-#endif

Deleted: development/source/main/cLineageControl.cc
===================================================================
--- development/source/main/cLineageControl.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cLineageControl.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,391 +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 "cLineageControl.h"
-
-#include "cString.h"
-
-#include "cLineage.h"
-#include "cStats.h"
-#include "cGenebank.h"
-#include "cGenotype.h"
-#include "cOrganism.h"
-
-#include "nHardware.h"   // for macro nHardware::FITNESS_NEUTRAL_MAX
-
-
-using namespace std;
-
-
-/////////////////////
-//  cLineageControl
-/////////////////////
-
-cLineageControl::cLineageControl(cWorld* world, cGenebank& genebank)
-  : m_world(world)
-  , m_best_lineage(NULL)
-  , m_max_fitness_lineage(NULL)
-  , m_dominant_lineage(NULL)
-  , m_genebank( genebank )
-  , m_stats(world->GetStats())
-{
-}
-
-cLineageControl::~cLineageControl()
-{
-}
-
-
-cLineage *
-cLineageControl::AddLineage( double start_fitness, int parent_lin_id, int id, double lineage_stat1, double lineage_stat2 )
-{
-  cLineage * new_lineage = new cLineage( start_fitness, parent_lin_id, id,
-            		 m_stats.GetUpdate(), m_stats.GetGeneration(), lineage_stat1, lineage_stat2 );
-
-  // the best/ dominant lineage are automatically corrected
-  // when a creature is added to this lineage
-  m_lineage_list.push_back(new_lineage);
-
-  m_stats.AddLineage();
-
-  return new_lineage;
-}
-
-
-void
-cLineageControl::AddCreaturePrivate( cGenotype *genotype,
-				     cLineage * lineage )
-{
-  assert( lineage != 0 );
-
-  // add to the lineage
-  lineage->AddCreature( genotype );
-
-  // This would be nice, but the current Avida code doesn't allow for it.
-  // Try to implement it in a new version...
-  // update the cpu
-  //  cpu->SetLineage( lineage );
-  //  cpu->SetLineageLabel( lineage->GetID() );
-
-  // test whether this makes the new lineage the best
-  if ( !m_best_lineage ||
-       lineage->GetAveFitness() > m_best_lineage->GetAveFitness() )
-    m_best_lineage = lineage;
-
-  // test whether this makes the new lineage the dominant
-  if ( !m_dominant_lineage ||
-       lineage->GetNumCreatures() > m_dominant_lineage->GetNumCreatures() )
-    m_dominant_lineage = lineage;
-
-  // test whether thiw makes the new lineage the one with the maximum fitness
-  if ( !m_max_fitness_lineage ||
-       lineage->GetMaxFitness() > m_max_fitness_lineage->GetMaxFitness() )
-    m_max_fitness_lineage = lineage;
-
-}
-
-void cLineageControl::UpdateLineages()
-{
-  m_best_lineage = NULL;
-  m_dominant_lineage = NULL;
-  m_max_fitness_lineage = NULL;
-
-  list<cLineage *>::iterator it = m_lineage_list.begin();
-  list<cLineage *>::iterator del_it;
-
-  while( it != m_lineage_list.end() ){
-    bool del = false;
-
-    // mark the lineage for removal if empty
-    if ( (*it)->GetNumCreatures() == 0 ){
-      del_it = it;
-      del = true;
-    }
-    else { // otherwise it is a candidate for the best/ dominant/... lineage
-      if ( !m_best_lineage ||
-	   (*it)->GetAveFitness() > m_best_lineage->GetAveFitness() )
-	m_best_lineage = (*it);
-
-      if ( !m_dominant_lineage ||
-	   (*it)->GetNumCreatures() > m_dominant_lineage->GetNumCreatures() )
-	m_dominant_lineage = (*it);
-
-      if ( !m_max_fitness_lineage ||
-	   (*it)->GetMaxFitness() > m_max_fitness_lineage->GetMaxFitness() )
-	m_max_fitness_lineage = (*it);
-
-    }
-    // proceed to the next lineage
-    it++;
-
-    // now do the removal if necessary
-    if ( del ){
-      delete (*del_it); // delete the lineage
-      m_lineage_list.erase( del_it ); // and remove its reference
-    }
-  }
-
-#ifdef DEBUG
-  if ( !m_lineage_list.empty() ){
-    assert( m_dominant_lineage != 0 );
-    assert( m_best_lineage != 0 );
-    assert( m_max_fitness_lineage != 0 );
-  }
-#endif
-
-}
-
-
-cLineage*
-cLineageControl::AddCreature( cGenotype * child_genotype, cGenotype *parent_genotype, cLineage * parent_lineage, int parent_lin_id )
-{
-  // Collect any information we can about the parent.
-  double parent_fitness = 0.0;
-  //  int parent_lin_id = 0;
-
-  // at this point, the cpu has still the lineage from the
-  // parent
-  //  cLineage * parent_lineage = cpu->GetLineage();
-
-#ifdef DEBUG
-  if (parent_lineage != NULL){
-    assert( parent_lin_id == parent_lineage->GetID() );
-  }
-#endif
-
-  if (parent_genotype != NULL) {
-    assert( parent_genotype->GetNumOrganisms() > 0 );
-    parent_fitness = parent_genotype->GetTestColonyFitness();
-  }
-  //cGenotype * child_genotype = cpu->GetActiveGenotype();
-  double child_fitness = child_genotype->GetTestColonyFitness();
-  cLineage * child_lineage = parent_lineage;
-  bool create_lineage = false;
-  double lineage_stat1 = child_fitness;
-  double lineage_stat2 = child_fitness;
-
-  // if we don't have a child lineage, we are probably dealing
-  // with manual assignement of the lineage label
-  if ( child_lineage == NULL ){
-    child_lineage = FindLineage( parent_lin_id );
-    // lineage doesn't exist...
-    if ( child_lineage == NULL ){
-      // create it
-      cout << "Creating new lineage 'by hand'!\nRequested lineage label: " << parent_lin_id;
-      child_lineage = AddLineage(child_fitness, -1, parent_lin_id, 0, 0);
-      cout << ", actual lineage label: " << child_lineage->GetID() << endl;
-
-    }
-  }
-  // otherwise, check for conditions that cause the creation of a new lineage
-  else {
-    switch ( m_world->GetConfig().LINEAGE_CREATION_METHOD.Get() ) {
-    case 0: // manual creation only
-      break;
-    case 1: // new lineage whenever a parent has offspring of greater fitness
-      if ( child_fitness > parent_fitness ){
-	create_lineage = true;
-	lineage_stat1 = parent_fitness;
-	lineage_stat2 = 0;
-      }
-      break;
-    case 2: // new lineage whenever a new child exceeds the
-      // currently highest fitness in the population
-      if ( child_fitness > m_max_fitness_lineage->GetMaxFitness() ){
-	create_lineage = true;
-	lineage_stat1 = m_max_fitness_lineage->GetMaxFitness();
-	lineage_stat2 = 0;
-      }
-      break;
-    case 3: // new lineage whenever a new child exceeds the
-      // highest fitness, or when it is a child of the
-      // of the dominant lineage and exceeds that highest fitness
-      if ( child_fitness > m_max_fitness_lineage->GetMaxFitness() ||
-	   ( parent_lineage == m_dominant_lineage
-	     && child_fitness > m_dominant_lineage->GetMaxFitness() ) ){
-	create_lineage = true;
-	lineage_stat1 = m_max_fitness_lineage->GetMaxFitness();
-	lineage_stat2 = m_dominant_lineage->GetMaxFitness();
-      }
-      break;
-    case 4: // new lineage whenever a new child exceeds the
-      // fitness of the dominant creature (and the fitness of its own lineage)
-      if (child_fitness > m_genebank.GetBestGenotype()->GetTestColonyFitness()
-	  && child_fitness > parent_lineage->GetMaxFitness() ){
-	create_lineage = true;
-	lineage_stat1=m_genebank.GetBestGenotype()->GetTestColonyFitness();
-	lineage_stat2=parent_lineage->GetMaxFitness();
-      }
-      break;
-    case 5: // new lineage whenever a new child exceeds the
-      // fitness of the dominant lineage (and the fitness of its own lineage)
-      if ( child_fitness > m_dominant_lineage->GetMaxFitness()
-	   && child_fitness > parent_lineage->GetMaxFitness() ){
-	create_lineage = true;
-	lineage_stat1=m_dominant_lineage->GetMaxFitness();
-	lineage_stat2=parent_lineage->GetMaxFitness();
-      }
-      break;
-    case 6: // new lineage whenever a new child exceeds the
-      // fitness of its own lineage
-      if ( child_fitness > parent_lineage->GetMaxFitness() ){
-	create_lineage = true;
-	lineage_stat1=parent_lineage->GetMaxFitness();
-	lineage_stat2 = 0;
-      }
-      break;
-    case 7: // new lineage whenever a new child exceeds the
-      // maximum fitness ever attained by its parent lineage
-      if (child_fitness > parent_lineage->GetMaxFitnessEver() ) {
-	create_lineage = true;
-	lineage_stat1 = parent_lineage->GetMaxFitnessEver();
-	lineage_stat2 = 0;
-      }
-      break;
-    }
-  }
-  if ( create_lineage ){
-    child_lineage = AddLineage(child_fitness, parent_lin_id, -1, lineage_stat1, lineage_stat2);
-    //    cout << "Lineage " << child_lineage->GetID() << " created."
-    //	 << " Genotype: " << child_genotype->GetName()() << endl;
-  }
-
-  AddCreaturePrivate( child_genotype, child_lineage );
-
-  return child_lineage;
-}
-
-
-void
-cLineageControl::RemoveCreature( cOrganism * cpu )
-{
-  cLineage * cur_lineage = cpu->GetLineage();
-
-  if (cur_lineage) {
-    // remove the creature
-    if ( cur_lineage->RemoveCreature( cpu->GetGenotype() )
-    	 || cur_lineage == m_dominant_lineage
-	 || cur_lineage == m_best_lineage )
-      // If this lineage no longer exists, tell stats...
-      if (cur_lineage->GetNumCreatures() == 0) {
-	m_stats.RemoveLineage( cur_lineage->GetID(),
-			       cur_lineage->GetParentID(),
-			       cur_lineage->GetUpdateBorn(),
-			       cur_lineage->GetGenerationBorn(),
-			       cur_lineage->GetTotalCreatures(),
-			       cur_lineage->GetTotalGenotypes(),
-			       cur_lineage->GetStartFitness(),
-			       cur_lineage->GetLineageStat1(),
-			       cur_lineage->GetLineageStat2() );
-      }
-
-      // recalc the best/dominant lineage if necessary
-      UpdateLineages();
-    cpu->SetLineage( 0 );
-    cpu->SetLineageLabel( -1 );
-  }
-
-}
-
-
-cLineage *
-cLineageControl::FindLineage( int lineage_id ) const
-{
-  list<cLineage *>::const_iterator it = m_lineage_list.begin();
-
-  for ( ; it != m_lineage_list.end(); it++ )
-    if ( (*it)->GetID() == lineage_id )
-      break;
-
-  if ( it == m_lineage_list.end() ){
-    cout << "Lineage " << lineage_id << " not found." << endl;
-    return 0;
-  }
-  else
-    return ( *it );
-}
-
-
-void cLineageControl::PrintLineageTotals(const cString &filename, bool verbose)
-{
-  ofstream& fp = m_world->GetDataFileOFStream(filename);
-  assert(fp.good());
-
-  fp << m_stats.GetUpdate();
-  const list<cLineage *> & lineage_list = GetLineageList();
-
-  if ( verbose ){ // in verbose format, we print only those
-    // lineages that are actually present, but
-    // we print much more info
-    fp << ": " << m_stats.SumGeneration().Average() << "\n";
-
-    // let's calculate the average fitness in the population also
-    double fitness_sum = 0;
-    double fitness = 0;
-    int total_num_organisms = 0;
-    int num_organisms = 0;
-
-
-    list<cLineage *>::const_iterator it = lineage_list.begin();
-    for ( ; it != lineage_list.end(); it++ ){
-      num_organisms = (*it)->GetNumCreatures();
-      fitness = (*it)->GetAveFitness();
-      fitness_sum += fitness * num_organisms;
-      total_num_organisms += num_organisms;
-      fp << " "
-	 << (*it)->GetID()           << " "
-	 << (*it)->GetParentID()     << " "
-	 << (*it)->GetStartFitness() << " "
-	 << (*it)->GetMaxFitness()   << " "
-	 << fitness                  << " "
-	 << num_organisms            << " "
-	 << (*it)->GetTotalCreatures()    << "\n";
-    }
-    fp << "#Dom: " << GetDominantLineage()->GetID()
-       << ", Max: " << GetMaxFitnessLineage()->GetID()
-       << ", Best: " << GetBestLineage()->GetID()
-       << "\n#Pop. fitness: " << fitness_sum / (double) total_num_organisms
-       << "\n" << endl;
-  }
-  else {
-    fp << " ";
-    int cur_id = 0;
-
-    list<cLineage *>::const_iterator it = lineage_list.begin();
-    for ( ; it != lineage_list.end(); it++ ){
-      int next_id = (*it)->GetID();
-      // wind up the current id to the next id
-      for ( ; cur_id < next_id; cur_id++ )
-	fp << "-1 "; // output -1 when we don't have the data
-      fp << (*it)->GetTotalCreatures() << " ";
-      cur_id += 1;
-    }
-    fp << endl;
-  }
-}
-
-
-void cLineageControl::PrintLineageCurCounts(const cString & filename)
-{
-  ofstream& fp = m_world->GetDataFileOFStream(filename);
-  assert(fp.good());
-
-  fp << m_stats.GetUpdate() << " ";
-  const list<cLineage *> & lineage_list = GetLineageList();
-
-  list<cLineage *>::const_iterator it = lineage_list.begin();
-  int cur_id = 0;
-  for ( ; it != lineage_list.end(); it++ ){
-    int next_id = (*it)->GetID();
-    // wind up the current id to the next id
-    for ( ; cur_id < next_id; cur_id++ )
-      fp << "0 ";
-    fp << (*it)->GetNumCreatures() << " ";
-    cur_id += 1;
-  }	
-  fp << endl;
-}

Deleted: development/source/main/cLineageControl.h
===================================================================
--- development/source/main/cLineageControl.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cLineageControl.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,110 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 LINEAGE_CONTROL_HH
-#define LINEAGE_CONTROL_HH
-
-#include <list>
-
-class cLineage;
-class cGenebank;
-class cStats;
-class cGenotype;
-class cOrganism;
-class cString;
-class cWorld;
-
-class cLineageControl {
-private:
-  cWorld* m_world;
-  std::list<cLineage *> m_lineage_list;
-  cLineage * m_best_lineage;  // the lineage with the highest average fitness
-  cLineage * m_max_fitness_lineage; // lineage with the single highest fitness
-  cLineage * m_dominant_lineage; // the lineage with the largest number of creatures.
-
-  // references to the genebank and stats used by Avida
-  cGenebank & m_genebank;
-  cStats & m_stats;
-
-  /**
-   * Adds a new lineage to the control.
-   **/
-  cLineage * AddLineage( double start_fitness, int parent_lin_id, int id = -1, 
-			 double lineage_stat1 = 0.0, double lineage_stat2 = 0.0  );
-
-  /**
-   * Determines the best lineage (lineage with the highest fitness),
-   * the dominant lineage, and removes empty lineages.
-   **/
-  void UpdateLineages();
-
-  /**
-   * Does the actual adding of a creature to the lineage, after AddCreature
-   * has done all the preliminary work.
-   **/
-  void AddCreaturePrivate( cGenotype *genotype, cLineage * lineage );
-
-  cLineageControl();
-  cLineageControl( const cLineageControl & );
-  cLineageControl & operator=( const cLineageControl & );
-public:
-  cLineageControl(cWorld* world, cGenebank& genebank);
-  ~cLineageControl();
-
-
-  // manipulators
-  /**
-   * Adds a creature to the correct lineage. The parent genotype is necessary
-   * to determine when a new lineage should be created.
-   *
-   * Attention: the creature is not updated, this has to happen somewhere else!
-   **/
-  cLineage* AddCreature( cGenotype * child_genotype, cGenotype *parent_genotype, cLineage * parent_lineage, int parent_lin_id );
-
-  /**
-   * Removes a creature from the corresponding lineage.
-   **/
-  void RemoveCreature( cOrganism * cpu );
-
-  // accessors
-  /**
-   * Finds the lineage with the given id.
-   * Returns 0 if the lineage does not exist.
-   **/
-  cLineage * FindLineage( int lineage_id ) const;
-
-  /**
-   * @return The lineage with the fastest replicating genotype.
-   **/
-  cLineage * GetMaxFitnessLineage() const { return m_max_fitness_lineage; }
-
-  /**
-   * @return The lineage with the highest average fitness.
-   **/
-  cLineage * GetBestLineage() const { return m_best_lineage; }
-
-  /**
-   * @return The most abundant lineage.
-   **/
-  cLineage * GetDominantLineage() const { return m_dominant_lineage; }
-
-  /**
-   * @return The current number of lineages.
-   **/
-  int GetSize() const { return m_lineage_list.size(); }
-
-  /**
-   * @return A list of the single lineages.
-   **/
-  const std::list<cLineage *> & GetLineageList() const { return m_lineage_list; }
-
-
-  void PrintLineageTotals(const cString & filename, bool verbose=false);
-  void PrintLineageCurCounts(const cString & filename);
-};
-
-#endif

Modified: development/source/main/cOrganism.cc
===================================================================
--- development/source/main/cOrganism.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cOrganism.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -30,9 +30,6 @@
 //  cOrganism
 ///////////////
 
-int cOrganism::instance_count(0);
-
-
 cOrganism::cOrganism(cWorld* world, const cGenome & in_genome)
   : m_world(world)
   , genotype(NULL)
@@ -59,7 +56,6 @@
   // Initialization of structures...
   hardware = pop_interface.NewHardware(this);
   cpu_stats.Setup(hardware->GetNumInst());
-  instance_count++;
   pop_interface.SetCellID(-1);  // No cell at the moment...
 
   if (m_world->GetConfig().DEATH_METHOD.Get() > 0) {
@@ -81,7 +77,6 @@
 {
   assert(is_running == false);
   delete hardware;
-  instance_count--;
 }
 
 
@@ -302,101 +297,3 @@
 
   phenotype.IncErrors();
 }
-
-
-//// Save and Load ////
-void cOrganism::SaveState(ofstream& fp)
-{
-  assert(fp.good());
-
-  fp <<"cOrganism"<<endl;
-
-  //// Save If it is alive ////
-  if( genotype == NULL ){
-    fp <<false<<endl;
-  }
-  else{  // if there is a genotype here (ie. not dead)
-    fp <<true<<endl;
-
-    fp << input_pointer;
-
-    // IO buffers
-    input_buf.SaveState(fp);
-    output_buf.SaveState(fp);
-
-    //// Save Genotype Genome ////
-//    fp << genotype->GetLength() << endl;
-    
-//      cInstUtil::SaveInternalGenome(fp, hardware->GetInstSet(),
-//  				  genotype->GetGenome());
-
-    //// Save Actual Creature Memory & MemFlags ////
-//   fp <<hardware->GetMemory().GetSize()<<endl;
-//   cInstUtil::PrintGenome(hardware->GetInstSet(), hardware->GetMemory(), fp);
-//      fp <<"|"; // marker
-//      for( int i=0; i<hardware->GetMemory().GetSize(); ++i ){
-//        fp << hardware->GetMemory().GetFlags(i);
-//      }
-//      fp <<endl;
-
-    //// Save Hardware (Inst_Pointer, Stacks, and the like)
-    hardware->SaveState(fp);
-
-    //// Save Phenotype  ////
-    phenotype.SaveState(fp);
-
-  }
-}
-
-
-void cOrganism::LoadState(ifstream & fp)
-{
-  hardware->Reset();
-
-  assert(fp.good());
-
-  cString foo;
-  fp >>foo;
-  assert( foo == "cOrganism" );
-
-  //// Is there a creature there ////
-  bool alive_flag = 0;
-  fp >>alive_flag;
-  if( alive_flag ){
-
-    // IO buffers
-    //    fp.get(input_pointer);
-    input_buf.LoadState(fp);
-    output_buf.LoadState(fp);
-
-    //// Load Genotype ////
-    cGenome in_code =
-      cInstUtil::LoadInternalGenome(fp, hardware->GetInstSet());
-//    cGenotype * new_genotype = environment->AddGenotype(in_code);
-//    ChangeGenotype(new_genotype);
-
-    //// Load Actual Creature Memory & MemFlags ////
-//    {	
-//      in_code = cInstUtil::LoadInternalGenome(fp, hardware->GetInstSet());
-//      hardware->GetMemory() = in_code;
-//      CA_FLAG_TYPE flags;
-//      char marker;  fp >>marker;  assert( marker == '|' );
-//      for( int i=0; i<hardware->GetMemory().GetSize(); ++i ){
-//    	  fp.get(flags);
-//  	  hardware->SetMemFlags(i, flags);
-//      }
-//    }
-
-    //// Load Hardware (Inst_Pointer, Stacks, and the like)
-    hardware->LoadState(fp);
-
-    //// Load Phenotype  ////
-    assert(fp.good());
-//      phenotype.Clear(genotype->GetLength());
-    phenotype.LoadState(fp);
-
-    //// Adjust Time Slice ////
-//    environment->AdjustTimeSlice();
-
-  } // end if not a dead creature
-}

Modified: development/source/main/cOrganism.h
===================================================================
--- development/source/main/cOrganism.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cOrganism.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -99,7 +99,6 @@
   bool initialized;      // Has this CPU been initialized yet, w/hardware.
 #endif
   bool is_running;       // Does this organism have the CPU?
-  static int instance_count;
 
 public:
   void PrintStatus(std::ostream& fp, const cString & next_name);
@@ -216,11 +215,7 @@
   const cPhenotype & GetPhenotype() const { return phenotype; }
   cPhenotype & GetPhenotype() { return phenotype; }
 
-  void SaveState(std::ofstream& fp);
-  void LoadState(std::ifstream & fp);
-
   // --------  DEBUG ---------
-  static int GetInstanceCount() { return instance_count; }
   void SetRunning(bool in_running) { is_running = in_running; }
   bool GetIsRunning() { return is_running; }
 };

Modified: development/source/main/cPopulation.cc
===================================================================
--- development/source/main/cPopulation.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cPopulation.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -8,23 +8,21 @@
 #include "cPopulation.h"
 
 #include "cChangeList.h"
+#include "cClassificationManager.h"
 #include "cConstSchedule.h"
 #include "cDataFile.h"
 #include "cEnvironment.h"
 #include "functions.h"
-#include "cGenebank.h"
 #include "cGenomeUtil.h"
 #include "cGenotype.h"
 #include "cHardwareBase.h"
 #include "cHardwareManager.h"
 #include "cHardware4Stack.h"
 #include "cInitFile.h"
-#include "cInjectGenebank.h"
 #include "cInjectGenotype.h"
 #include "cInstUtil.h"
 #include "cIntegratedSchedule.h"
 #include "cLineage.h"
-#include "cLineageControl.h"
 #include "cOrganism.h"
 #include "cPhenotype.h"
 #include "cPopulationCell.h"
@@ -54,17 +52,6 @@
 , num_organisms(0)
 , sync_events(false)
 {
-  // Setup the genebank.
-  genebank = new cGenebank(world);
-  inject_genebank = new cInjectGenebank(world);
-  birth_chamber.SetGenebank(genebank);
-  
-  // are we logging lineages?
-  if (world->GetConfig().LOG_LINEAGES.Get()) {
-    lineage_control = new cLineageControl(world, *genebank);
-  }
-  else lineage_control = NULL;    // no lineage logging
-  
   // Setup the default mutation rates...
   cMutationRates& default_mut_rates = environment.GetMutRates();
   default_mut_rates.SetCopyMutProb  ( world->GetConfig().COPY_MUT_PROB.Get() );
@@ -76,7 +63,7 @@
   default_mut_rates.SetDivideInsProb( world->GetConfig().DIVIDE_INS_PROB.Get() );
   default_mut_rates.SetDivideDelProb( world->GetConfig().DIVIDE_DEL_PROB.Get() );
   default_mut_rates.SetParentMutProb( world->GetConfig().PARENT_MUT_PROB.Get() );
-    
+  
   // Avida specific information.
   world_x = world->GetConfig().WORLD_X.Get();
   world_y = world->GetConfig().WORLD_Y.Get();
@@ -239,10 +226,6 @@
 cPopulation::~cPopulation()
 {
   for (int i = 0; i < cell_array.GetSize(); i++) KillOrganism(cell_array[i]);
-  
-  if ( lineage_control != NULL ) delete lineage_control;
-  delete genebank;
-  delete inject_genebank;
   delete schedule;
 }
 
@@ -393,7 +376,7 @@
     ActivateOrganism(child_array[i], GetCell(target_cells[i]));
     cGenotype * child_genotype = child_array[i]->GetGenotype();
     child_genotype->DecDeferAdjust();
-    genebank->AdjustGenotype(*child_genotype);
+    m_world->GetClassificationManager().AdjustGenotype(*child_genotype);
   }
   
   return parent_alive;
@@ -430,7 +413,7 @@
   if(target_organism->InjectHost(parent_cpu.GetLabel(), injected_code)) {
     // If the parent genotype is not correct for the child, adjust it.
     if (parent_genotype == NULL || parent_genotype->GetGenome() != injected_code) {
-      child_genotype = inject_genebank->AddInjectGenotype(injected_code, parent_genotype);
+      child_genotype = m_world->GetClassificationManager().GetInjectGenotype(injected_code, parent_genotype);
     }
     
     target_organism->AddParasite(child_genotype);
@@ -438,57 +421,24 @@
     child_cpu.SetThreadOwner(child_genotype);
     //if(parent_genotype!=NULL)
     //  parent_genotype->RemoveParasite();
-    inject_genebank->AdjustInjectGenotype(*child_genotype);
+    m_world->GetClassificationManager().AdjustInjectGenotype(*child_genotype);
   }
   else
     return false;
   
   return true;
-  
-  // And set the genotype now that we know it.
-  //child_array[i]->SetGenotype(child_genotype);
-  //parent_genotype->SetBreedStats(*child_genotype);
-  
-  // We want to make sure that the child's genotype is not deleted from the
-  // genebank before the child is placed.
-  //child_genotype->IncDeferAdjust();
-  
-  // **THIS WILL BE NECESSARY IF/WHEN WE IMPLEMENT PARASITE LINEAGES.**
-  // Do lineage tracking for the new creature, if necessary.  Must occur
-  // before old organism is removed.
-  //LineageSetupOrganism( child_array[i], parent_organism.GetLineage(),
-  //			  parent_organism.GetLineageLabel(), parent_genotype );
-  
-  // **THIS WILL BE NECESSARY ONCE WE IMPLEMENT PARASITE MUTATION RATES.**
-  //child_array[i]->MutationRates().
-  //  Copy(GetCell(target_cells[i]).MutationRates());
-  
-  // Do any statistics on the parent that just gave birth...
-  //parent_genotype->AddGestationTime( parent_phenotype.GetGestationTime() );
-  //parent_genotype->AddFitness(       parent_phenotype.GetFitness()       );
-  //parent_genotype->AddMerit(         parent_phenotype.GetMerit()         );
-  //parent_genotype->AddCopiedSize(    parent_phenotype.GetCopiedSize()    );
-  //parent_genotype->AddExecutedSize(  parent_phenotype.GetExecutedSize()  );
-  
-  // Place all of the offspring...
-  /*for (int i = 0; i < child_array.GetSize(); i++) {
-    ActivateOrganism(child_array[i], GetCell(target_cells[i]));
-  cGenotype * child_genotype = child_array[i]->GetGenotype();
-  child_genotype->DecDeferAdjust();
-  genebank->AdjustGenotype(*child_genotype);
-  }*/
 }
 
 bool cPopulation::ActivateInject(const int cell_id, const cGenome & injected_code)
 {
-  cInjectGenotype * child_genotype = inject_genebank->AddInjectGenotype(injected_code);
+  cInjectGenotype * child_genotype = m_world->GetClassificationManager().GetInjectGenotype(injected_code);
   cHardware4Stack & child_cpu = (cHardware4Stack &) cell_array[cell_id].GetOrganism()->GetHardware();
   if(cell_array[cell_id].GetOrganism()->InjectHost(cCodeLabel(), injected_code))
   {
     cell_array[cell_id].GetOrganism()->AddParasite(child_genotype);
     child_genotype->AddParasite();
     child_cpu.SetThreadOwner(child_genotype);
-    inject_genebank->AdjustInjectGenotype(*child_genotype);
+    m_world->GetClassificationManager().AdjustInjectGenotype(*child_genotype);
   }
   else
     return false;
@@ -505,8 +455,7 @@
   // If the organism does not have a genotype, give it one!  No parent
   // information is provided so we must set parents to NULL.
   if (in_organism->GetGenotype() == NULL) {
-    cGenotype * new_genotype =
-    genebank->AddGenotype(in_organism->GetGenome(), NULL, NULL);
+    cGenotype* new_genotype = m_world->GetClassificationManager().GetGenotype(in_organism->GetGenome(), NULL, NULL);
     in_organism->SetGenotype(new_genotype);
   }
   cGenotype * in_genotype = in_organism->GetGenotype();
@@ -529,14 +478,14 @@
   // Setup the inputs in the target cell.
   environment.SetupInputs(target_cell.input_array);
   
-  // Update the genebank...
+  // Update the archive...
   in_genotype->AddOrganism();
   
   if (old_genotype != NULL) {
     old_genotype->DecDeferAdjust();
-    genebank->AdjustGenotype(*old_genotype);
+    m_world->GetClassificationManager().AdjustGenotype(*old_genotype);
   }
-  genebank->AdjustGenotype(*in_genotype);
+  m_world->GetClassificationManager().AdjustGenotype(*in_genotype);
   
   // Initialize the time-slice for this new organism.
   schedule->Adjust(target_cell.GetID(),in_organism->GetPhenotype().GetMerit());
@@ -550,7 +499,7 @@
   
   // Statistics...
   m_world->GetStats().RecordBirth(target_cell.GetID(), in_genotype->GetID(),
-                    in_organism->GetPhenotype().ParentTrue());
+                                  in_organism->GetPhenotype().ParentTrue());
 }
 
 void cPopulation::KillOrganism(cPopulationCell & in_cell)
@@ -564,36 +513,30 @@
   cOrganism * organism = in_cell.GetOrganism();
   cGenotype * genotype = organism->GetGenotype();
   m_world->GetStats().RecordDeath(in_cell.GetID(), genotype->GetID(),
-                    organism->GetPhenotype().GetAge());
+                                  organism->GetPhenotype().GetAge());
   
-  
   // Do the lineage handling
-  if (lineage_control != NULL) {
-    lineage_control->RemoveCreature( organism );
-  }
+  if (m_world->GetConfig().LOG_LINEAGES.Get()) { m_world->GetClassificationManager().RemoveLineageOrganism(organism); }
   
   // Do statistics
   num_organisms--;
   
-  //if (organism->GetPhenotype().IsParasite() == true) {
-  //  genotype->AddParasite();
-  //}
   genotype->RemoveOrganism();
 
-for(int i=0; i<organism->GetNumParasites(); i++) {
-  organism->GetParasite(i).RemoveParasite();
-}
+  for(int i=0; i<organism->GetNumParasites(); i++) {
+    organism->GetParasite(i).RemoveParasite();
+  }
 
-// And clear it!
-in_cell.RemoveOrganism();
-if (organism->GetIsRunning() == false) delete organism;
-else organism->GetPhenotype().SetToDelete();
+  // And clear it!
+  in_cell.RemoveOrganism();
+  if (organism->GetIsRunning() == false) delete organism;
+  else organism->GetPhenotype().SetToDelete();
 
-// Alert the scheduler that this cell has a 0 merit.
-schedule->Adjust( in_cell.GetID(), cMerit(0) );
+  // Alert the scheduler that this cell has a 0 merit.
+  schedule->Adjust( in_cell.GetID(), cMerit(0) );
 
-// Update the genebank (note: genotype adjustment may be defered)
-genebank->AdjustGenotype(*genotype);
+  // Update the archive (note: genotype adjustment may be defered)
+  m_world->GetClassificationManager().AdjustGenotype(*genotype);
 }
 
 void cPopulation::Kaboom(cPopulationCell & in_cell)
@@ -876,7 +819,7 @@
 void cPopulation::PrintDemeStats()
 {
   cStats& stats = m_world->GetStats();
-
+  
   cDataFile & df_fit = m_world->GetDataFile("deme_fitness.dat");
   cDataFile & df_life_fit = m_world->GetDataFile("deme_lifetime_fitness.dat");
   cDataFile & df_merit = m_world->GetDataFile("deme_merit.dat");
@@ -990,14 +933,11 @@
  * and setting the organism's lineage label and the lineage pointer.
  **/
 
-void cPopulation::LineageSetupOrganism(cOrganism * organism, cLineage * lin,
-                                       int lin_label, cGenotype *parent_genotype)
+void cPopulation::LineageSetupOrganism(cOrganism* organism, cLineage* lin, int lin_label, cGenotype* parent_genotype)
 {
-  // If we have some kind of lineage control, adjust the default values
-  // passed in.
-  if ( lineage_control ){
-    lin = lineage_control->
-    AddCreature(organism->GetGenotype(), parent_genotype, lin, lin_label);
+  // If we have some kind of lineage control, adjust the default values passed in.
+  if (m_world->GetConfig().LOG_LINEAGES.Get()){
+    lin = m_world->GetClassificationManager().GetLineage(organism->GetGenotype(), parent_genotype, lin, lin_label);
     lin_label = lin->GetID();
   }
   
@@ -1181,13 +1121,13 @@
   for (int i = 0; i < cell_array.GetSize(); i++) {
     // Only look at cells with organisms in them.
     if (cell_array[i].IsOccupied() == false) {
-
+      
       // Genotype map needs zero for all non-occupied cells
-
+      
       stats.SetGenoMapElement(i, 0);
       continue;
     }
-
+    
     cOrganism * organism = cell_array[i].GetOrganism();
     const cPhenotype & phenotype = organism->GetPhenotype();
     const cMerit cur_merit = phenotype.GetMerit();
@@ -1273,7 +1213,7 @@
   stats.SetResources(resource_count.GetResources());
   stats.SetSpatialRes(resource_count.GetSpatialRes());
   stats.SetResourcesGeometry(resource_count.GetResourcesGeometry());
-}
+  }
 
 
 void cPopulation::UpdateGenotypeStats()
@@ -1291,8 +1231,8 @@
   
   double entropy = 0.0;
   
-  cGenotype * cur_genotype = genebank->GetBestGenotype();
-  for (int i = 0; i < genebank->GetSize(); i++) {
+  cGenotype * cur_genotype = m_world->GetClassificationManager().GetBestGenotype();
+  for (int i = 0; i < m_world->GetClassificationManager().GetGenotypeCount(); i++) {
     const int abundance = cur_genotype->GetNumOrganisms();
     
     // If we're at a dead genotype, we've hit the end of the list!
@@ -1331,15 +1271,15 @@
   stats.SumSpeciesAge().Clear();
   
   // Loop through all species that need to be reset prior to calculations.
-  cSpecies * cur_species = genebank->GetFirstSpecies();
-  for (int i = 0; i < genebank->GetNumSpecies(); i++) {
+  cSpecies * cur_species = m_world->GetClassificationManager().GetFirstSpecies();
+  for (int i = 0; i < m_world->GetClassificationManager().GetNumSpecies(); i++) {
     cur_species->ResetStats();
     cur_species = cur_species->GetNext();
   }
   
   // Collect info from genotypes and send it to their species.
-  cGenotype * genotype = genebank->GetBestGenotype();
-  for (int i = 0; i < genebank->GetSize(); i++) {
+  cGenotype * genotype = m_world->GetClassificationManager().GetBestGenotype();
+  for (int i = 0; i < m_world->GetClassificationManager().GetGenotypeCount(); i++) {
     if (genotype->GetSpecies() != NULL) {
       genotype->GetSpecies()->AddOrganisms(genotype->GetNumOrganisms());
     }
@@ -1347,8 +1287,8 @@
   }
   
   // Loop through all of the species in the soup, taking info on them.
-  cur_species = genebank->GetFirstSpecies();
-  for (int i = 0; i < genebank->GetNumSpecies(); i++) {
+  cur_species = m_world->GetClassificationManager().GetFirstSpecies();
+  for (int i = 0; i < m_world->GetClassificationManager().GetNumSpecies(); i++) {
     const int abundance = cur_species->GetNumOrganisms();
     // const int num_genotypes = cur_species->GetNumGenotypes();
     
@@ -1373,7 +1313,7 @@
 void cPopulation::UpdateDominantStats()
 {
   cStats& stats = m_world->GetStats();
-  cGenotype * dom_genotype = genebank->GetBestGenotype();
+  cGenotype * dom_genotype = m_world->GetClassificationManager().GetBestGenotype();
   if (dom_genotype == NULL) return;
   
   stats.SetDomGenotype(dom_genotype);
@@ -1399,26 +1339,15 @@
 void cPopulation::UpdateDominantParaStats()
 {
   cStats& stats = m_world->GetStats();
-  cInjectGenotype * dom_inj_genotype = inject_genebank->GetBestInjectGenotype();
+  cInjectGenotype * dom_inj_genotype = m_world->GetClassificationManager().GetBestInjectGenotype();
   if (dom_inj_genotype == NULL) return;
   
   stats.SetDomInjGenotype(dom_inj_genotype);
-  //stats.SetDomMerit(dom_genotype->GetMerit());
-  //stats.SetDomGestation(dom_genotype->GetGestationTime());
-  //stats.SetDomReproRate(dom_genotype->GetReproRate());
-  //stats.SetDomFitness(dom_genotype->GetFitness());
-  //stats.SetDomCopiedSize(dom_genotype->GetCopiedSize());
-  //stats.SetDomExeSize(dom_genotype->GetExecutedSize());
   
   stats.SetDomInjSize(dom_inj_genotype->GetLength());
   stats.SetDomInjID(dom_inj_genotype->GetID());
   stats.SetDomInjName(dom_inj_genotype->GetName());
-  //stats.SetDomInjBirths(dom_inj_genotype->GetThisBirths());
-  //stats.SetDomBreedTrue(dom_genotype->GetThisBreedTrue());
-  //stats.SetDomBreedIn(dom_genotype->GetThisBreedIn());
-  //stats.SetDomBreedOut(dom_genotype->GetThisBreedOut());
   stats.SetDomInjAbundance(dom_inj_genotype->GetNumInjected());
-  //stats.SetDomInjGeneDepth(dom_inj_genotype->GetDepth());
   stats.SetDomInjSequence(dom_inj_genotype->GetGenome().AsString());
 }
 
@@ -1426,7 +1355,7 @@
 {
   cStats& stats = m_world->GetStats();
   // Reset the Genebank to prepare it for stat collection.
-  genebank->UpdateReset();
+  m_world->GetClassificationManager().UpdateReset();
   
   UpdateOrganismStats();
   UpdateGenotypeStats();
@@ -1436,8 +1365,8 @@
   
   // Do any final calculations...
   stats.SetNumCreatures(GetNumOrganisms());
-  stats.SetNumGenotypes(genebank->GetSize());
-  stats.SetNumThreshSpecies(genebank->GetNumSpecies());
+  stats.SetNumGenotypes(m_world->GetClassificationManager().GetGenotypeCount());
+  stats.SetNumThreshSpecies(m_world->GetClassificationManager().GetNumSpecies());
   
   // Have stats calculate anything it now can...
   stats.CalcEnergy();
@@ -1452,14 +1381,14 @@
   // Save the current update
   fp << m_world->GetStats().GetUpdate() << " ";
   
-  // Save the genebank info.
-  genebank->SaveClone(fp);
+  // Save the archive info.
+  m_world->GetClassificationManager().SaveClone(fp);
   
   // Save the genotypes manually.
-  fp << genebank->GetSize() << " ";
+  fp << m_world->GetClassificationManager().GetGenotypeCount() << " ";
   
-  cGenotype * cur_genotype = genebank->GetBestGenotype();
-  for (int i = 0; i < genebank->GetSize(); i++) {
+  cGenotype * cur_genotype = m_world->GetClassificationManager().GetBestGenotype();
+  for (int i = 0; i < m_world->GetClassificationManager().GetGenotypeCount(); i++) {
     cur_genotype->SaveClone(fp);
     
     // Advance...
@@ -1492,8 +1421,8 @@
   // Clear out the population
   for (int i = 0; i < cell_array.GetSize(); i++) KillOrganism(cell_array[i]);
   
-  // Load the genebank info.
-  genebank->LoadClone(fp);
+  // Load the archive info.
+  m_world->GetClassificationManager().LoadClone(fp);
   
   // Load up the genotypes.
   int num_genotypes = 0;
@@ -1501,8 +1430,7 @@
   
   cGenotype** genotype_array = new cGenotype*[num_genotypes];
   for (int i = 0; i < num_genotypes; i++) {
-    genotype_array[i] = new cGenotype(m_world);
-    genotype_array[i]->LoadClone(fp);
+    genotype_array[i] = cGenotype::LoadClone(m_world, fp);
   }
   
   // Now load them into the organims.  @CAO make sure cell_array.GetSize() is right!
@@ -1599,9 +1527,7 @@
     if ( m_world->GetStats().GetUpdate() > tmp.update_dead )
       tmp.update_dead = m_world->GetStats().GetUpdate();
     
-    tmp.genotype =
-      new cGenotype(m_world, tmp.update_born, tmp.id_num);
-    tmp.genotype->SetGenome( genome );
+    tmp.genotype = m_world->GetClassificationManager().GetGenotypeLoaded(genome, tmp.update_born, tmp.id_num);
     tmp.genotype->SetName( name );
     
     genotype_vect.push_back( tmp );
@@ -1633,13 +1559,12 @@
   bool soup_full = false;
   it = genotype_vect.begin();
   for ( ; it != genotype_vect.end(); it++ ){
-    genebank->AddGenotype( (*it).genotype );
     if ( (*it).num_cpus == 0 ){ // historic organism
                                 // remove immediately, so that it gets transferred into the
                                 // historic database. We change the update temporarily to the
                                 // true death time of this organism, so that all stats are correct.
       m_world->GetStats().SetCurrentUpdate( (*it).update_dead );
-      genebank->RemoveGenotype( *(*it).genotype );
+      m_world->GetClassificationManager().RemoveGenotype( *(*it).genotype );
       m_world->GetStats().SetCurrentUpdate( cur_update );
     }
     else{ // otherwise, we insert as many organisms as we need
@@ -1685,8 +1610,8 @@
   // Save the update
   fp << m_world->GetStats().GetUpdate() << endl;
   
-  // looping through all cells saving state.
-  for (int i = 0; i < cell_array.GetSize(); i++)  cell_array[i].SaveState(fp);
+  // looping through all cells saving state @DMB - these did nothing...
+  //for (int i = 0; i < cell_array.GetSize(); i++)  cell_array[i].SaveState(fp);
   
   return true;
 }
@@ -1704,8 +1629,8 @@
   // Clear out the current population
   for (int i = 0; i < cell_array.GetSize(); i++) KillOrganism( cell_array[i] );
   
-  // looping through all organims
-  for (int i = 0; i < cell_array.GetSize(); i++) cell_array[i].LoadState(fp);
+  // looping through all organims @DMB - these did nothing...
+  //for (int i = 0; i < cell_array.GetSize(); i++) cell_array[i].LoadState(fp);
   
   sync_events = true;
   
@@ -1736,7 +1661,7 @@
 bool cPopulation::OK()
 {
   // First check all sub-objects...
-  if (!genebank->OK() || !schedule->OK()) return false;
+  if (!schedule->OK()) return false;
   
   // Next check organisms...
   for (int i = 0; i < cell_array.GetSize(); i++) {
@@ -1910,7 +1835,6 @@
 
 // This function injects a new organism into the population at cell_id based
 // on the genotype passed in.
-
 void cPopulation::InjectGenotype(int cell_id, cGenotype *new_genotype)
 {
   assert(cell_id >= 0 && cell_id < cell_array.GetSize());
@@ -1977,11 +1901,10 @@
 }
 
 
-void cPopulation::InjectGenome(int cell_id, const cGenome & genome,
-                               int lineage_label)
+void cPopulation::InjectGenome(int cell_id, const cGenome& genome, int lineage_label)
 {
   // Setup the genotype...
-  cGenotype * new_genotype = genebank->InjectGenotype(genome, lineage_label);
+  cGenotype* new_genotype = m_world->GetClassificationManager().GetGenotypeInjected(genome, lineage_label);
   
   // The rest is done by InjectGenotype();
   InjectGenotype( cell_id, new_genotype );

Modified: development/source/main/cPopulation.h
===================================================================
--- development/source/main/cPopulation.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cPopulation.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -38,12 +38,9 @@
 class cBirthChamber; // aggregate
 class cChangeList;
 class cEnvironment;
-class cGenebank;
 class cGenome;
 class cGenotype;
-class cInjectGenebank;
 class cLineage;
-class cLineageControl;
 template <class T> class tList; // aggregate
 class cOrganism;
 class cPopulationInterface; // aggregate
@@ -63,9 +60,6 @@
   cBirthChamber birth_chamber;         // Global birth chamber.
 
   // Data Tracking...
-  cGenebank * genebank;                // Tracks genotypes
-  cInjectGenebank * inject_genebank;   // Tracks all injected code
-  cLineageControl * lineage_control;   // Tracks Linages
   tList<cPopulationCell> reaper_queue; // Death order in some mass-action runs
 
   // Default organism setups...
@@ -103,7 +97,7 @@
   void UpdateDominantParaStats();
 
   /**
-   * Attention: InjectGenotype does *not* add the genotype to the genebank.
+   * Attention: InjectGenotype does *not* add the genotype to the archive.
    * It assumes thats where you got the genotype from.
    **/
   void InjectGenotype(int cell_id, cGenotype * genotype);
@@ -183,9 +177,6 @@
   double GetResource(int id) const {
     return resource_count.Get(id); }
 
-  cGenebank & GetGenebank() { return *genebank; }
-  cInjectGenebank & GetInjectGenebank() { return *inject_genebank; }
-  cLineageControl * GetLineageControl() { return lineage_control; }
   cEnvironment & GetEnvironment() { return environment; }
   int GetNumOrganisms() { return num_organisms; }
 

Modified: development/source/main/cPopulationCell.cc
===================================================================
--- development/source/main/cPopulationCell.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cPopulationCell.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -129,16 +129,3 @@
   // Nothing for the moment...
   return true;
 }
-
-bool cPopulationCell::SaveState(ofstream& fp)
-{
-  // Nothing for the moment...
-  return false;
-}
-
-
-bool cPopulationCell::LoadState(ifstream & fp)
-{
-  // Nothing for the moment...
-  return false;
-}

Modified: development/source/main/cPopulationCell.h
===================================================================
--- development/source/main/cPopulationCell.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cPopulationCell.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -68,9 +68,6 @@
   bool IsOccupied() const { return organism != NULL; }
 
   bool OK();
-
-  bool SaveState(std::ofstream& fp);
-  bool LoadState(std::ifstream & fp);
 };
 
 #endif

Modified: development/source/main/cPopulationInterface.cc
===================================================================
--- development/source/main/cPopulationInterface.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cPopulationInterface.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -171,8 +171,7 @@
   return 0;
 }
 
-bool cPopulationInterface::InjectParasite(cOrganism * parent, 
-					  const cGenome & injected_code)
+bool cPopulationInterface::InjectParasite(cOrganism * parent, const cGenome & injected_code)
 {
   if (InTestPop()) return false;
   

Deleted: development/source/main/cSpecies.cc
===================================================================
--- development/source/main/cSpecies.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cSpecies.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,173 +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 "cSpecies.h"
-
-#include "cCPUTestInfo.h"
-#include "functions.h"
-#include "cGenotype.h"
-#include "cGenomeUtil.h"
-#include "cTestCPU.h"
-
-using namespace std;
-
-cSpecies::cSpecies(cWorld* world, const cGenome & in_genome, int update )
-  : m_world(world)
-  , genome(in_genome)
-  , update_born(update)
-{
-  static int species_count = 0;
-  id_num = species_count++;
-  parent_id = -1;
-  symbol = '+';
-
-  num_genotypes = 0;
-  num_threshold = 0;
-  total_organisms = 0;
-  total_genotypes = 0;
-
-  queue_type = SPECIES_QUEUE_NONE;
-
-  next = NULL;
-  prev = NULL;
-
-  // Track distance of each genome as it is passed in...
-
-  for (int i = 0; i < SPECIES_MAX_DISTANCE; i++) {
-    genotype_distance[i] = 0;
-  }
-}
-
-cSpecies::~cSpecies()
-{
-  int i, total_count = 0;
-  for (i = 0; i < SPECIES_MAX_DISTANCE; i++) {
-    total_count += genotype_distance[i];
-  }
-
-#ifdef TEST
-  // Only print out the non-trivial species.
-
-  if (total_count > 1) {
-    FILE * fp = stats.GetTestFP();
-
-    fprintf(fp, "Species %3d: ", id_num);
-    for (i = 0; i < SPECIES_MAX_DISTANCE; i++) {
-      fprintf(fp, "%2d ", genotype_distance[i]);
-    }
-    fprintf(fp, "\n");
-    fflush(fp);
-  }
-#endif
-}
-
-// This method compares a second genome to this species and determines
-// how different it is.  A -1 indicates a critical failure (like one of
-// the genomes being considered is not viable), otherwise the count
-// Of failed crossovers is returned.
-// @CAO Todo: Check phenotypes, allow failure proportional to size.
-
-int cSpecies::Compare(const cGenome & test_genome, int max_fail_count)
-{
-  cCPUTestInfo test_info;
-
-  // First, make some phenotypic comparisons between organisms.
-  // For now, just check that they both copy-true.
-
-  m_world->GetTestCPU().TestGenome(test_info, test_genome);
-
-  // If the organisms aren't viable, return a -1...
-  if (test_info.IsViable() == false) {
-    return -1;
-  }
-
-  // Find the optimal offset between organisms, and related variables.
-  // @CAO: For the moment, lets not worry about offsets...
-  // The first line of B is at line 'offset' of A. 
-  //int offset = cGenomeUtil::FindBestOffset(genome, test_genome);
-
-
-  // Figure out how much of the organisms overlap, and how much doesn't.
-  int overlap = Min(genome.GetSize(), test_genome.GetSize());
-  int fail_count = Max(genome.GetSize(), test_genome.GetSize()) - overlap;
-
-
-  // Do the crossovers at all posible points.
-  // Start with the first direction crossover...
-
-  bool cross1_viable = true;
-  bool cross2_viable = true;
-  cGenome cross_genome1(genome);
-  cGenome cross_genome2(test_genome);
-
-  for (int i = 0; i < overlap; i++) {
-    // If this position has changed, check if crossovers here are viable.
-    if (test_genome[i] != genome[i]) {
-      // Continue crossing over on each side...
-      cross_genome1[i] = test_genome[i];
-      cross_genome2[i] = genome[i];
-   
-      // Run each side, and determine viability...
-      m_world->GetTestCPU().TestGenome(test_info, cross_genome1);
-      cross1_viable = test_info.IsViable();
-
-      m_world->GetTestCPU().TestGenome(test_info, cross_genome2);
-      cross2_viable = test_info.IsViable();
-    }
-
-    if (cross1_viable == false) fail_count++;
-    if (cross2_viable == false) fail_count++;
-
-    if (max_fail_count != -1 && fail_count > max_fail_count) break;
-  }
-
-
-  return fail_count;
-}
-
-bool cSpecies::OK()
-{
-  assert(id_num >= 0);  // Species has negative ID value!
-  assert(genome.OK());  // Species genome not registering as OK!
-
-  // Assert valid statistics in species.
-  assert(total_organisms >= 0 && total_genotypes >= 0 &&
-	 num_threshold >= 0 && num_genotypes >= 0);
-
-  // Finally, make sure the species is registered as being in a queue.
-
-  assert(queue_type >= 0 && queue_type <= 3); // Species not in a proper queue
-
-  return true;
-}
-
-void cSpecies::AddThreshold(cGenotype & in_genotype)
-{
-  const int distance = 
-    cGenomeUtil::FindEditDistance(genome, in_genotype.GetGenome());
-
-  if (distance >= 0 && distance < SPECIES_MAX_DISTANCE)
-    genotype_distance[distance]++;
-
-  num_threshold++;
-}
-
-void cSpecies::RemoveThreshold(cGenotype & in_genotype)
-{
-  total_genotypes++;
-  total_organisms += in_genotype.GetTotalOrganisms();
-  num_threshold--;
-}
-
-void cSpecies::AddGenotype()
-{
-  num_genotypes++;
-}
-
-void cSpecies::RemoveGenotype() {
-  num_genotypes--;
-}

Deleted: development/source/main/cSpecies.h
===================================================================
--- development/source/main/cSpecies.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cSpecies.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,90 +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 SPECIES_HH
-#define SPECIES_HH
-
-#include <fstream>
-
-#ifndef GENOME_HH
-#include "cGenome.h"
-#endif
-
-#define SPECIES_QUEUE_NONE     0
-#define SPECIES_QUEUE_ACTIVE   1
-#define SPECIES_QUEUE_INACTIVE 2
-#define SPECIES_QUEUE_GARBAGE  3
-
-#define SPECIES_MAX_DISTANCE 20
-
-class cGenotype;
-class cWorld;
-
-class cSpecies {
-private:
-  cWorld* m_world;
-  int id_num;
-  int parent_id;
-  cGenome genome;
-  int update_born;
-
-  int total_organisms;
-  int total_genotypes;
-  int num_threshold;
-  int num_genotypes;
-  int num_organisms;
-  int queue_type;
-  char symbol;
-  int genotype_distance[SPECIES_MAX_DISTANCE];
-
-  cSpecies * next;
-  cSpecies * prev;
-  
-public:
-  cSpecies(cWorld* world, const cGenome & in_genome, int update);
-  ~cSpecies();
-
-  int Compare(const cGenome & test_genome, int max_fail_count=-1);
-  bool OK();
-
-  void AddThreshold(cGenotype & in_genotype);
-  void RemoveThreshold(cGenotype & in_genotype);
-  void AddGenotype();
-  void RemoveGenotype();
-
-  void AddOrganisms(int in_num) { num_organisms += in_num; }
-  void ResetStats() { num_organisms = 0; }
-
-  cSpecies * GetNext() { return next; }
-  cSpecies * GetPrev() { return prev; }
-
-  int GetID() { return id_num; }
-  int GetParentID() { return parent_id; }
-  const cGenome & GetGenome() { return genome; }
-  int GetUpdateBorn() { return update_born; }
-  int GetNumGenotypes() { return num_genotypes; }
-  int GetNumThreshold() { return num_threshold; }
-  int GetNumOrganisms() { return num_organisms; }
-  int GetTotalOrganisms() { return total_organisms; }
-  int GetTotalGenotypes() { return total_genotypes; }
-  int GetQueueType() { return queue_type; }
-  char GetSymbol() { return symbol; }
-
-  void SetQueueType(int in_qt) { queue_type = in_qt; }
-  void SetNext(cSpecies * in_next) { next = in_next; }
-  void SetPrev(cSpecies * in_prev) { prev = in_prev; }
-  void SetSymbol(char in_symbol) { symbol = in_symbol; }
-  void SetParentID(int in_id) { parent_id = in_id; }
-
-#ifdef DEBUG
-  // These are used in cGenebank::OK()
-  int debug_num_genotypes;
-  int debug_num_threshold;
-#endif
-};
-
-#endif

Deleted: development/source/main/cSpeciesControl.cc
===================================================================
--- development/source/main/cSpeciesControl.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cSpeciesControl.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,150 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 "cSpeciesControl.h"
-
-#include "defs.h"
-#include "cGenotype.h"
-#include "nSpecies.h"
-#include "cSpecies.h"
-#include "cStats.h"
-#include "cWorld.h"
-
-#include <assert.h>
-
-cSpeciesControl::cSpeciesControl(cWorld* world, cGenebank & in_gb) : m_world(world), genebank(in_gb)
-{
-}
-
-cSpeciesControl::~cSpeciesControl()
-{
-}
-
-void cSpeciesControl::Remove(cSpecies & in_species)
-{
-  switch (in_species.GetQueueType()) {
-  case SPECIES_QUEUE_ACTIVE:
-    active_queue.Remove(in_species);
-    break;
-  case SPECIES_QUEUE_INACTIVE:
-    inactive_queue.Remove(in_species);
-    break;
-  case SPECIES_QUEUE_GARBAGE:
-    garbage_queue.Remove(in_species);
-    break;
-  default:
-    break;
-  }
-
-  in_species.SetQueueType(SPECIES_QUEUE_NONE);
-}
-
-void cSpeciesControl::Adjust(cSpecies & in_species)
-{
-  // Only adjust if this species is in the active queue.
-
-  if (in_species.GetQueueType() == SPECIES_QUEUE_ACTIVE) {
-    active_queue.Adjust(in_species);
-  }
-}
-
-void cSpeciesControl::SetActive(cSpecies & in_species)
-{
-  Remove(in_species);
-  active_queue.InsertRear(in_species);
-  in_species.SetQueueType(SPECIES_QUEUE_ACTIVE);
-}
-
-void cSpeciesControl::SetInactive(cSpecies & in_species)
-{
-  Remove(in_species);
-  inactive_queue.InsertRear(in_species);
-  in_species.SetQueueType(SPECIES_QUEUE_INACTIVE);
-}
-
-void cSpeciesControl::SetGarbage(cSpecies & in_species)
-{
-  Remove(in_species);
-  garbage_queue.InsertRear(in_species);
-  in_species.SetQueueType(SPECIES_QUEUE_GARBAGE);
-}
-
-bool cSpeciesControl::OK()
-{
-  int ret_value = true;
-
-  // Check the queues.
-
-  assert (active_queue.OK(SPECIES_QUEUE_ACTIVE));
-  assert (inactive_queue.OK(SPECIES_QUEUE_INACTIVE));
-  assert (garbage_queue.OK(SPECIES_QUEUE_GARBAGE));
-
-  return ret_value;
-}
-
-int cSpeciesControl::FindPos(cSpecies & in_species, int max_depth)
-{
-  cSpecies * temp_species = active_queue.GetFirst();
-  if (max_depth < 0 || max_depth > active_queue.GetSize()) {
-    max_depth = active_queue.GetSize();
-  }
-
-  for (int i = 0; i < max_depth; i++) {
-    if (temp_species == &in_species) return i;
-    temp_species = temp_species->GetNext();
-  }
-
-  return -1;
-}
-
-cSpecies * cSpeciesControl::Find(cGenotype & in_genotype, int record_level)
-{
-  cSpecies * found_species = NULL;
-  int cur_count, best_count = MAX_CREATURE_SIZE;
-  cSpecies * cur_species;
-  const int species_threshold = m_world->GetConfig().SPECIES_THRESHOLD.Get();
-
-  if (record_level == nSpecies::RECORD_FULL) {
-    cur_species = active_queue.GetFirst();
-    int size = active_queue.GetSize();
-    for (int i = 0; i < size; i++) {
-      cur_count = cur_species->Compare(in_genotype.GetGenome(), species_threshold);
-      if (cur_count != -1 && cur_count <= species_threshold && cur_count < best_count) {
-        found_species = cur_species;
-        best_count = cur_count;
-      }
-      cur_species = cur_species->GetNext();
-    }
-  }
-
-  if (record_level == nSpecies::RECORD_LIMITED) {
-    cur_species = in_genotype.GetSpecies();
-
-    if (cur_species) {
-      int num_diff = cur_species->Compare(in_genotype.GetGenome(), species_threshold);
-      if (num_diff != -1 && num_diff <= species_threshold) {
-        found_species = cur_species;
-      }
-    }
-  }
-
-  return found_species;
-}
-
-void cSpeciesControl::Purge(cStats & stats)
-{
-  cSpecies * cur_species = garbage_queue.GetFirst();
-  for (int i = 0; i < garbage_queue.GetSize(); i++) {
-    stats.RemoveSpecies(cur_species->GetID(),
-			cur_species->GetParentID(),
-			cur_species->GetTotalGenotypes(),
-			cur_species->GetTotalOrganisms(),
-			stats.GetUpdate() - cur_species->GetUpdateBorn());
-    cur_species = cur_species->GetNext();
-  }
-  garbage_queue.Purge();
-}

Deleted: development/source/main/cSpeciesControl.h
===================================================================
--- development/source/main/cSpeciesControl.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cSpeciesControl.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,53 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 SPECIES_CONTROL_HH
-#define SPECIES_CONTROL_HH
-
-#ifndef SPECIES_QUEUE_HH
-#include "cSpeciesQueue.h"
-#endif
-
-class cGenebank;
-class cGenotype;
-class cSpecies;
-class cStats;
-class cWorld;
-
-class cSpeciesControl {
-private:
-  cWorld* m_world;
-  cSpeciesQueue active_queue;
-  cSpeciesQueue inactive_queue;
-  cSpeciesQueue garbage_queue;
-  cGenebank & genebank;
-public:
-  cSpeciesControl(cWorld* world, cGenebank & in_gb);
-  ~cSpeciesControl();
-
-  void Remove(cSpecies & in_species);
-  void Adjust(cSpecies & in_species);
-  void SetInactive(cSpecies & in_species);
-  void SetActive(cSpecies & in_species);
-  void SetGarbage(cSpecies & in_species);
-  void Purge(cStats & stats);
-
-  bool OK();
-
-  int FindPos(cSpecies & in_species, int max_depth = -1);
-  cSpecies * Find(cGenotype & in_genotype, int record_level);
-
-  inline cSpecies * GetFirst() const { return active_queue.GetFirst(); }
-  inline cSpecies * GetFirstInactive() const
-    { return inactive_queue.GetFirst(); }
-  inline cSpecies * GetFirstGarbage() const
-    { return garbage_queue.GetFirst(); }
-  inline int GetSize() const { return active_queue.GetSize(); }
-  inline int GetInactiveSize() const { return inactive_queue.GetSize(); }
-};
-
-#endif

Deleted: development/source/main/cSpeciesQueue.cc
===================================================================
--- development/source/main/cSpeciesQueue.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cSpeciesQueue.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,173 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 SPECIES_QUEUE_HH
-#include "cSpeciesQueue.h"
-#endif
-
-#ifndef DEFS_HH
-#include "defs.h"
-#endif
-#ifndef SPECIES_HH
-#include "cSpecies.h"
-#endif
-
-///////////////////
-//  cSpeciesQueue
-///////////////////
-
-cSpeciesQueue::cSpeciesQueue()
-{
-  size = 0;
-  first = NULL;
-}
-
-cSpeciesQueue::~cSpeciesQueue()
-{
-}
-
-void cSpeciesQueue::InsertRear(cSpecies & new_species)
-{
-  // If the queue doesn't exist, create it with this species as the only
-  // element.
-
-  if (!first) {
-    first = &new_species;
-    first->SetNext(first);
-    first->SetPrev(first);
-  }
-
-  // Otherwise, put this species at the end of the queue.
-
-  else {
-    new_species.SetNext(first);
-    new_species.SetPrev(first->GetPrev());
-    first->GetPrev()->SetNext(&new_species);
-    first->SetPrev(&new_species);
-  }
-
-  size++;
-}
-
-void cSpeciesQueue::Remove(cSpecies & in_species)
-{
-  size--;
-
-  // If the queue is now empty, delete it properly.
-  if (size == 0) {
-    first = NULL;
-    return;
-  }
-
-  // If we are removing the first element of the queue, slide the queue to
-  // the new first before removing it.
-
-  if (first == &in_species) {
-    first = in_species.GetNext();
-  }
-
-  // Remove the in_species
-
-  in_species.GetPrev()->SetNext(in_species.GetNext());
-  in_species.GetNext()->SetPrev(in_species.GetPrev());
-  in_species.SetNext(NULL);
-  in_species.SetPrev(NULL);
-}
-
-void cSpeciesQueue::Adjust(cSpecies & in_species)
-{
-  // First move it up the list if need be...
-
-  cSpecies * prev_species = in_species.GetPrev();
-  while (&in_species != first &&
-	 in_species.GetNumThreshold() > prev_species->GetNumThreshold()) {
-    // Swap the position of this species with the previous one.
-    if (prev_species == first) first = &in_species;
-
-    // Outer connections...
-    prev_species->SetNext(in_species.GetNext());
-    in_species.GetNext()->SetPrev(prev_species);
-    in_species.SetPrev(prev_species->GetPrev());
-    prev_species->GetPrev()->SetNext(&in_species);
-
-    // Inner connections...
-    prev_species->SetPrev(&in_species);
-    in_species.SetNext(prev_species);
-
-    prev_species = in_species.GetPrev();
-  }
-	
-  // Then see if it needs to be moved down.
-  cSpecies * next_species = in_species.GetNext();
-  while (next_species != first &&
-	 in_species.GetNumThreshold() < next_species->GetNumThreshold()) {
-    // Swap the position of this species with the next one.
-    if (&in_species == first) first = next_species;
-
-    // Outer Connections...
-    in_species.SetNext(next_species->GetNext());
-    next_species->GetNext()->SetPrev(&in_species);
-    next_species->SetPrev(in_species.GetPrev());
-    in_species.GetPrev()->SetNext(next_species);
-
-    // Inner Connections...
-    in_species.SetPrev(next_species);
-    next_species->SetNext(&in_species);
-
-    next_species = in_species.GetNext();
-  }
-}
-
-void cSpeciesQueue::Purge()
-{
-  cSpecies * cur_species = first;
-  cSpecies * next_species = NULL;
-
-  // Loop through the species deleting them until there is only one left.
-  for (int i = 1; i < size; i++) {
-    next_species = cur_species->GetNext();
-    delete cur_species;
-    cur_species = next_species;
-  }
-
-  // And delete that last one.
-  delete cur_species;
-  first = NULL;
-  size = 0;
-}
-
-bool cSpeciesQueue::OK(int queue_type)
-{
-  cSpecies * cur_species = NULL;
-  int count = 0;
-  bool ret_value = true;
-
-  while (first && cur_species != first) {
-    // If we are just starting, set cur_species to the first element.
-    if (!cur_species) cur_species = first;
-
-    // Check that the list is correct in both directions...
-
-    assert (cur_species->GetNext()->GetPrev() == cur_species);
-
-    // Check to make sure the current species is OK() and that it should
-    // indeed be in this list.
-
-    if (!cur_species->OK()) ret_value = false;
-
-    assert (queue_type == cur_species->GetQueueType());
-    count++;
-
-    assert (count <= size);
-
-    cur_species = cur_species->GetNext();
-  }
-
-  assert (count == size);
-
-  return ret_value;
-}

Deleted: development/source/main/cSpeciesQueue.h
===================================================================
--- development/source/main/cSpeciesQueue.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cSpeciesQueue.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,30 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// Copyright (C) 1993 - 2003 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 SPECIES_QUEUE_HH
-#define SPECIES_QUEUE_HH
-
-class cSpecies;
-class cSpeciesQueue {
-private:
-  int size;
-  cSpecies * first;
-public:
-  cSpeciesQueue();
-  ~cSpeciesQueue();
-
-  void InsertRear(cSpecies & new_species);
-  void Remove(cSpecies & in_species);
-  void Adjust(cSpecies & in_species);
-  void Purge();
-  bool OK(int queue_type);
-
-  inline int GetSize() const { return size; }
-  inline cSpecies * GetFirst() const { return first; }
-};
-
-#endif

Modified: development/source/main/cStats.cc
===================================================================
--- development/source/main/cStats.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cStats.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -267,12 +267,6 @@
   num_deaths++;
 }
 
-void cStats::AddGenotype(int id_num)
-{
-  id_num = -1;  // @CAO do we still need id_num here?
-  tot_genotypes++;
-}
-
 void cStats::RemoveGenotype(int id_num, int parent_id,
    int parent_dist, int depth, int max_abundance, int parasite_abundance,
    int age, int length)

Modified: development/source/main/cStats.h
===================================================================
--- development/source/main/cStats.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cStats.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -245,8 +245,6 @@
 
   void IncSubUpdate() { sub_update++; }
 
-  bool OK() { return true; }  // @CAO FIX!!!!
-
   // Accessors...
   int GetUpdate() const { return current_update; }
   int GetSubUpdate() const { return sub_update; }
@@ -394,7 +392,7 @@
 
   void RecordBirth(int cell_id, int genotype_id, bool breed_true);
   void RecordDeath(int genotype_id, int num_divides, int age);
-  void AddGenotype(int id_num);
+  void AddGenotype() { tot_genotypes++; }
   void RemoveGenotype(int id_num, int parent_id,
 			     int parent_distance, int depth, int max_abundance,
 			     int parasite_abundance, int age, int length);

Modified: development/source/main/cWorld.cc
===================================================================
--- development/source/main/cWorld.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cWorld.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -11,6 +11,7 @@
 
 #include "avida.h"
 #include "cAvidaTriggers.h"
+#include "cClassificationManager.h"
 #include "cEnvironment.h"
 #include "cEventList.h"
 #include "cEventManager.h"
@@ -53,8 +54,9 @@
     m_conf->DATA_DIR.Set(dir);
   }
   m_data_mgr = new cDataFileManager(dir);
-  cTools::MkDir(dir + "genebank", true);
+  cTools::MkDir(dir + "archive", true);
   
+  m_class_mgr = new cClassificationManager(this);
   m_env = new cEnvironment(this);
   m_hw_mgr = new cHardwareManager(this);
   

Modified: development/source/main/cWorld.h
===================================================================
--- development/source/main/cWorld.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/cWorld.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -20,6 +20,7 @@
 #include "cRandom.h"
 #endif
 
+class cClassificationManager;
 class cEnvironment;
 class cEventManager;
 class cEventList;
@@ -32,6 +33,7 @@
 {
 protected:
   cAvidaConfig* m_conf;
+  cClassificationManager* m_class_mgr;
   cDataFileManager* m_data_mgr;
   cEnvironment* m_env;
   cEventManager* m_event_mgr;
@@ -57,6 +59,7 @@
   
   // General Object Accessors
   cAvidaConfig& GetConfig() { return *m_conf; }
+  cClassificationManager& GetClassificationManager() { return *m_class_mgr; }
   cDataFileManager& GetDataFileManager() { return *m_data_mgr; }
   cEnvironment& GetEnvironment() { return *m_env; }
   cHardwareManager& GetHardwareManager() { return *m_hw_mgr; }
@@ -79,7 +82,7 @@
   int GetNumReactions();
   int GetNumResources();
 
-  // DDD - Inherited from cAvidaDriver heritage
+  // @DMB - Inherited from cAvidaDriver heritage
   void GetEvents();
   void ReadEventListFile(const cString & filename);
   void SyncEventList();

Deleted: development/source/main/nGenotype.h
===================================================================
--- development/source/main/nGenotype.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/nGenotype.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,18 +0,0 @@
-/*
- *  nGenotype.h
- *  Avida
- *
- *  Created by David on 10/5/05.
- *  Copyright 2005 Michigan State University. All rights reserved.
- *
- */
-
-#ifndef nGenotype_h
-#define nGenotype_h
-
-namespace nGenotype {  
-  const int HASH_SIZE = 3203;    // @CAO Is this an optimal number?
-  const int THREADS = 2;
-}
-
-#endif

Deleted: development/source/main/nInjectGenotype.h
===================================================================
--- development/source/main/nInjectGenotype.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/nInjectGenotype.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,18 +0,0 @@
-/*
- *  nInjectGenotype.h
- *  Avida
- *
- *  Created by David on 10/5/05.
- *  Copyright 2005 Michigan State University. All rights reserved.
- *
- */
-
-#ifndef nInjectGenotype_h
-#define nInjectGenotype_h
-
-namespace nInjectGenotype {
-  const int HASH_SIZE = 307;    // @CAO Is this an optimal number?
-  const int THREADS = 2;  
-}
-
-#endif

Deleted: development/source/main/nSpecies.h
===================================================================
--- development/source/main/nSpecies.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/main/nSpecies.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,17 +0,0 @@
-/*
- *  nSpecies.h
- *  Avida
- *
- *  Created by David on 10/5/05.
- *  Copyright 2005 Michigan State University. All rights reserved.
- *
- */
-
-#ifndef nSpecies_h
-#define nSpecies_h
-
-namespace nSpecies {
-  enum tRecording { RECORD_OFF = 0, RECORD_FULL = 1, RECORD_LIMITED = 2 };
-}
-
-#endif

Modified: development/source/support/CMakeLists.txt
===================================================================
--- development/source/support/CMakeLists.txt	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/support/CMakeLists.txt	2005-11-15 18:05:29 UTC (rev 399)
@@ -4,9 +4,10 @@
   analyze.cfg
   environment.cfg
   events.cfg
-  genesis
+  avida.cfg
   inst_set.default
   organism.default
+  organism.smt
   inst_set.4stack
-  genesis.4stack
+  inst_set.smt
 )

Modified: development/source/testsuites/unit_testsuites/genebank.t.cc
===================================================================
--- development/source/testsuites/unit_testsuites/genebank.t.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/testsuites/unit_testsuites/genebank.t.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -1,8 +1,5 @@
 #include <iostream>
 
-#ifndef GENEBANK_HH
-#include "cGenebank.h"
-#endif
 #ifndef TEST_CASE_H
 #include "third-party/yaktest/cTestCase.hh"
 #endif

Modified: development/source/testsuites/unit_testsuites/level_1/instruction.t.cc
===================================================================
--- development/source/testsuites/unit_testsuites/level_1/instruction.t.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/testsuites/unit_testsuites/level_1/instruction.t.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -41,7 +41,7 @@
       // Values 0-61 map to symbols a-z, A-Z, and 0-9,
       // in that order.
       // All other values should map to symbol '?'.
-      // XXX: why does value 255 map to symbol '_'?
+      // @DMB - why does value 255 map to symbol '_'?
       inst.SetOp(1); test_is_true(inst.GetSymbol() == 'b');
       inst.SetOp(25); test_is_true(inst.GetSymbol() == 'z');
       inst.SetOp(26); test_is_true(inst.GetSymbol() == 'A');

Modified: development/source/tools/tArray.h
===================================================================
--- development/source/tools/tArray.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/tools/tArray.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -63,9 +63,7 @@
 
 public:
   // Constructor
-  explicit tArray(const int _size=0) : data(NULL) {
-    ResizeClear(_size);
-  }
+  explicit tArray(const int _size=0) : data(NULL) { ResizeClear(_size); }
 
   // Assingment Operator
   tArray & operator= (const tArray & rhs) {
@@ -75,29 +73,15 @@
   }
 
   // Copy constructor
-  //explicit tArray(const tArray & rhs) : data(NULL), size(0) {
-  //  this->operator=(rhs);
-  //}
+  tArray(const tArray& rhs) : data(NULL), size(0) { this->operator=(rhs); }
 
-  tArray(const tArray & rhs) : data(NULL), size(0) {
-    this->operator=(rhs);
-  }
-
-
   // Destructor
-  virtual ~tArray() {
-    if (data != NULL) delete [] data;
-  }
+  virtual ~tArray() { if (data != NULL) delete [] data; }
 
+  
   // Interface Methods ///////////////////////////////////////////////////////
-
+  
   bool Good() const { return (data != NULL); }
-
-//    bool OK() const {
-//      assert(size >= 0);
-//      return true;
-//    }
-
   int GetSize() const { return size; }
 
   void Resize(int new_size) {

Modified: development/source/viewer/CMakeLists.txt
===================================================================
--- development/source/viewer/CMakeLists.txt	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/viewer/CMakeLists.txt	2005-11-15 18:05:29 UTC (rev 399)
@@ -28,6 +28,7 @@
   TARGET_LINK_LIBRARIES(viewer
     cursesviewer
     main
+    classification
     cpu
     event
     analyze

Modified: development/source/viewer/cEnvironmentScreen.cc
===================================================================
--- development/source/viewer/cEnvironmentScreen.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/viewer/cEnvironmentScreen.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -8,7 +8,6 @@
 #include "cEnvironmentScreen.h"
 
 #include "cEnvironment.h"
-#include "cGenebank.h"
 #include "cGenotype.h"
 #include "cPopulation.h"
 #include "cReaction.h"

Modified: development/source/viewer/cHistScreen.cc
===================================================================
--- development/source/viewer/cHistScreen.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/viewer/cHistScreen.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -5,15 +5,16 @@
 // before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
 //////////////////////////////////////////////////////////////////////////////
 
+#include "cHistScreen.h"
+
 #include <fstream>
 
-#include "cGenebank.h"
 #include "cGenotype.h"
 #include "cSpecies.h"
+#include "cWorld.h"
+#include "cClassificationManager.h"
 
-#include "cHistScreen.h"
 
-
 using namespace std;
 
 
@@ -118,7 +119,7 @@
 
   switch(mode) {
   case HIST_GENOTYPE:
-    max_num = info.GetGenebank().GetBestGenotype()->GetNumOrganisms();
+    max_num = info.GetWorld().GetClassificationManager().GetBestGenotype()->GetNumOrganisms();
     SetBoldColor(COLOR_WHITE);
     Print(1,  34, "Genotype Abundance");
     // Print out top NUM_SYMBOL genotypes in fixed order.

Modified: development/source/viewer/cScreen.h
===================================================================
--- development/source/viewer/cScreen.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/viewer/cScreen.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -30,9 +30,7 @@
 class cPopulation;
 class cPopulationCell;
 class cOrganism;
-class cGenebank;
 class cInjectGenotype;
-class cInjectGenebank;
 
 #define NUM_SYMBOLS 12
 #define SYMBOL_THRESHOLD 10

Modified: development/source/viewer/cStatsScreen.cc
===================================================================
--- development/source/viewer/cStatsScreen.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/viewer/cStatsScreen.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -7,8 +7,8 @@
 
 #include "cStatsScreen.h"
 
+#include "cClassificationManager.h"
 #include "cEnvironment.h"
-#include "cGenebank.h"
 #include "cGenotype.h"
 #include "cPopulation.h"
 #include "cSpecies.h"
@@ -86,7 +86,7 @@
 
 void cStatsScreen::Update()
 {
-  cGenotype * best_gen = m_world->GetPopulation().GetGenebank().GetBestGenotype();
+  cGenotype * best_gen = m_world->GetClassificationManager().GetBestGenotype();
 
   SetBoldColor(COLOR_CYAN);
 

Modified: development/source/viewer/cViewInfo.cc
===================================================================
--- development/source/viewer/cViewInfo.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/viewer/cViewInfo.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -9,11 +9,10 @@
 
 #include <fstream>
 
+#include "cClassificationManager.h"
 #include "cSpecies.h"
 #include "cGenotype.h"
-#include "cGenebank.h"
 #include "cInjectGenotype.h"
-#include "cInjectGenebank.h"
 #include "cPopulation.h"
 #include "cPopulationCell.h"
 #include "cOrganism.h"
@@ -149,7 +148,7 @@
   int i, pos;
   for (i = 0; i < NUM_SYMBOLS; i++) {
     if (genotype_chart[i]) {
-      pos = GetGenebank().FindPos(*(genotype_chart[i]));
+      pos = m_world->GetClassificationManager().FindPos(*(genotype_chart[i]));
       if (pos < 0) genotype_chart[i] = NULL;
       if (pos >= NUM_SYMBOLS) {
 	if (genotype_chart[i]->GetThreshold())
@@ -159,7 +158,7 @@
       }
     }
     if (species_chart[i]) {
-      pos = GetGenebank().FindPos(*(species_chart[i]));
+      pos = m_world->GetClassificationManager().FindPos(*(species_chart[i]));
       if (pos < 0) species_chart[i] = NULL;
       if (pos >= NUM_SYMBOLS) {
 	species_chart[i]->SetSymbol('+');
@@ -170,8 +169,8 @@
 
   // Now, fill in any missing spaces...
 
-  cGenotype * temp_gen = GetGenebank().GetBestGenotype();
-  cSpecies * temp_species = GetGenebank().GetFirstSpecies();
+  cGenotype * temp_gen = m_world->GetClassificationManager().GetBestGenotype();
+  cSpecies * temp_species = m_world->GetClassificationManager().GetFirstSpecies();
   for (i = 0; i < SYMBOL_THRESHOLD; i++) {
     if (temp_gen) {
       if (!InGenChart(temp_gen)) AddGenChart(temp_gen);
@@ -200,11 +199,6 @@
   SetStepOrganism(-1);
 }
 
-cGenebank & cViewInfo::GetGenebank()
-{
-  return m_world->GetPopulation().GetGenebank();
-}
-
 cGenotype * cViewInfo::GetActiveGenotype()
 {
   if (active_cell != NULL && active_cell->IsOccupied()) {

Modified: development/source/viewer/cViewInfo.h
===================================================================
--- development/source/viewer/cViewInfo.h	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/viewer/cViewInfo.h	2005-11-15 18:05:29 UTC (rev 399)
@@ -20,9 +20,7 @@
 class cPopulation;
 class cPopulationCell;
 class cOrganism;
-class cGenebank;
 class cInjectGenotype;
-class cInjectGenebank;
 
 #define NUM_SYMBOLS 12
 #define SYMBOL_THRESHOLD 10
@@ -98,7 +96,6 @@
   void EngageStepMode();
   void DisEngageStepMode();
 
-  cGenebank & GetGenebank();
   cPopulation & GetPopulation() { return m_world->GetPopulation(); }
   cAvidaConfig& GetConfig() { return m_world->GetConfig(); }
   cRandom& GetRandom() { return m_world->GetRandom(); }

Modified: development/source/viewer/cZoomScreen.cc
===================================================================
--- development/source/viewer/cZoomScreen.cc	2005-11-15 17:22:29 UTC (rev 398)
+++ development/source/viewer/cZoomScreen.cc	2005-11-15 18:05:29 UTC (rev 399)
@@ -10,7 +10,6 @@
 #include "cEnvironment.h"
 #include "functions.h"
 
-#include "cGenebank.h"
 #include "cGenotype.h"
 #include "cOrganism.h"
 #include "cPhenotype.h"
@@ -2002,7 +2001,7 @@
         else if(info.GetConfig().HARDWARE_TYPE.Get() == HARDWARE_TYPE_CPU_SMT)
         {
           cur_mem_space++;
-          // DDD - Should handle the extensibility of SMT Memory Spaces
+          // @DMB - Should handle the extensibility of SMT Memory Spaces
           cur_mem_space %= 1;
         }
       }
@@ -2025,7 +2024,7 @@
         }
         else if(info.GetConfig().HARDWARE_TYPE.Get()==HARDWARE_TYPE_CPU_SMT) {
           cur_mem_space--;
-          // DDD - Should handle the extensibility of SMT Memory Spaces
+          // @DMB - Should handle the extensibility of SMT Memory Spaces
           if (cur_mem_space < 0) cur_mem_space = 0;
         }
       }

Modified: development/status.xml
===================================================================
--- development/status.xml	2005-11-15 17:22:29 UTC (rev 398)
+++ development/status.xml	2005-11-15 18:05:29 UTC (rev 399)
@@ -920,17 +920,14 @@
         New cHardware base class, separate from Hardware CPU
       </action>
       <action context="refactor" dev="DMB">
-        Unique object ID factory template
+        [ lineage ]
       </action>
       <action context="refactor" dev="DMB">
         shift analyze commands into their own objects
       </action>
       <action context="refactor" dev="DMB">
-        merge analyze and events
+        merge analyze and events into 'actions'
       </action>
-      <action context="refactor" dev="DMB">
-        instruction set methods with 2's after them?
-      </action>
     </actions>
     <actions priority="low">
       




More information about the Avida-cvs mailing list