[Avida-cvs] [avida-svn] r473 - in development: Avida.xcodeproj source/analyze
brysonda@myxo.css.msu.edu
brysonda at myxo.css.msu.edu
Sat Feb 18 10:19:50 PST 2006
Author: brysonda
Date: 2006-02-18 13:19:49 -0500 (Sat, 18 Feb 2006)
New Revision: 473
Modified:
development/Avida.xcodeproj/project.pbxproj
development/source/analyze/cAnalyze.cc
development/source/analyze/cAnalyzeGenotype.cc
development/source/analyze/cAnalyzeGenotype.h
Log:
Add support for outputting landscape average fitness in detail files.
Modified: development/Avida.xcodeproj/project.pbxproj
===================================================================
--- development/Avida.xcodeproj/project.pbxproj 2006-02-15 21:04:14 UTC (rev 472)
+++ development/Avida.xcodeproj/project.pbxproj 2006-02-18 18:19:49 UTC (rev 473)
@@ -927,7 +927,7 @@
DCC315CF076253A5008F7A48 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
DCC315D0076253A5008F7A48 /* task_event_gen.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = task_event_gen.cc; sourceTree = "<group>"; };
DCC315D1076253A5008F7A48 /* task_event_gen.old.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = task_event_gen.old.cc; sourceTree = "<group>"; };
- DCC3164D07626CF3008F7A48 /* avida */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = avida; sourceTree = BUILT_PRODUCTS_DIR; };
+ DCC3164D07626CF3008F7A48 /* avida */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = avida; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
Modified: development/source/analyze/cAnalyze.cc
===================================================================
--- development/source/analyze/cAnalyze.cc 2006-02-15 21:04:14 UTC (rev 472)
+++ development/source/analyze/cAnalyze.cc 2006-02-18 18:19:49 UTC (rev 473)
@@ -7060,6 +7060,10 @@
("complexity", "Basic Complexity (all neutral/beneficial muts are equal)",
&cAnalyzeGenotype::GetComplexity,
(void (cAnalyzeGenotype::*)(double)) NULL));
+ genotype_data_list.PushRear(new tDataEntry<cAnalyzeGenotype, double>
+ ("land_fitness", "Average Lanscape Fitness",
+ &cAnalyzeGenotype::GetLandscapeFitness,
+ (void (cAnalyzeGenotype::*)(double)) NULL));
genotype_data_list.PushRear(new tDataEntry<cAnalyzeGenotype, const cString &>
("parent_muts", "Mutations from Parent",
&cAnalyzeGenotype::GetParentMuts, &cAnalyzeGenotype::SetParentMuts,
Modified: development/source/analyze/cAnalyzeGenotype.cc
===================================================================
--- development/source/analyze/cAnalyzeGenotype.cc 2006-02-15 21:04:14 UTC (rev 472)
+++ development/source/analyze/cAnalyzeGenotype.cc 2006-02-18 18:19:49 UTC (rev 473)
@@ -312,6 +312,7 @@
landscape_stats->frac_neut = landscape.GetProbNeut();
landscape_stats->frac_pos = landscape.GetProbPos();
landscape_stats->complexity = landscape.GetComplexity();
+ landscape_stats->ave_fitness = landscape.GetAveFitness();
}
void cAnalyzeGenotype::Recalculate(cAnalyzeGenotype * parent_genotype)
@@ -468,6 +469,12 @@
return landscape_stats->complexity;
}
+double cAnalyzeGenotype::GetLandscapeFitness() const
+{
+ CalcLandscape(); // Make sure the landscape is calculated...
+ return landscape_stats->ave_fitness;
+}
+
cString cAnalyzeGenotype::GetTaskList() const
{
const int num_tasks = task_counts.GetSize();
Modified: development/source/analyze/cAnalyzeGenotype.h
===================================================================
--- development/source/analyze/cAnalyzeGenotype.h 2006-02-15 21:04:14 UTC (rev 472)
+++ development/source/analyze/cAnalyzeGenotype.h 2006-02-18 18:19:49 UTC (rev 473)
@@ -118,8 +118,9 @@
double frac_neut;
double frac_pos;
double complexity;
+ double ave_fitness;
cAnalyzeLandscape() : frac_dead(0.0), frac_neg(0.0),
- frac_neut(0.0), frac_pos(0.0), complexity(0.0) { ; }
+ frac_neut(0.0), frac_pos(0.0), complexity(0.0), ave_fitness(0.0) { ; }
};
mutable cAnalyzeLandscape * landscape_stats;
@@ -242,6 +243,7 @@
double GetFracNeut() const;
double GetFracPos() const;
double GetComplexity() const;
+ double GetLandscapeFitness() const;
double GetFitnessRatio() const { return fitness_ratio; }
double GetEfficiencyRatio() const { return efficiency_ratio; }
More information about the Avida-cvs
mailing list