[Avida-SVN] r1523 - in branches/collect: documentation source/analyze
blwalker at myxo.css.msu.edu
blwalker at myxo.css.msu.edu
Thu May 3 10:00:16 PDT 2007
Author: blwalker
Date: 2007-05-03 13:00:16 -0400 (Thu, 03 May 2007)
New Revision: 1523
Modified:
branches/collect/documentation/analyze.html
branches/collect/source/analyze/cAnalyze.cc
branches/collect/source/analyze/cAnalyzeGenotype.cc
branches/collect/source/analyze/cAnalyzeGenotype.h
Log:
Added an option to the DETAIL command in analyze mode. Analogous to task.n, inst.n will print the number of times an instruction has been executed by an organism.
Likewise added this option to the documentation.
Modified: branches/collect/documentation/analyze.html
===================================================================
--- branches/collect/documentation/analyze.html 2007-05-03 16:14:28 UTC (rev 1522)
+++ branches/collect/documentation/analyze.html 2007-05-03 17:00:16 UTC (rev 1523)
@@ -582,11 +582,15 @@
<tr>
<td><strong>task.n</strong> (# of times task number n is done)</td>
<td><strong>task.n:binary</strong> (is task n done, 0/1)</td>
+ <td><strong>inst.n</strong> (# of times instruction number n is done)</td>
</tr>
</table>
</div>
<p>
+Please note that inst.n is only valid if INSTRUCTION_COUNT is on in defs.h
+
+<p>
If a FIND_LINEAGE was done before the RECALCULATE, the parent
genotype for each regular genotype will be available, enabling the
additional formats:
Modified: branches/collect/source/analyze/cAnalyze.cc
===================================================================
--- branches/collect/source/analyze/cAnalyze.cc 2007-05-03 16:14:28 UTC (rev 1522)
+++ branches/collect/source/analyze/cAnalyze.cc 2007-05-03 17:00:16 UTC (rev 1523)
@@ -7848,6 +7848,16 @@
&cAnalyzeGenotype::GetAlignmentExecutedFlags,
(void (cAnalyzeGenotype::*)(cString)) NULL,
&cAnalyzeGenotype::CompareNULL, "(N/A)", ""));
+
+ for (int i = 0; i < inst_set.GetSize(); i++) {
+ cString i_name, i_desc;
+ i_name.Set("inst.%d", i);
+ i_desc.Set("# Times ");
+ i_desc += inst_set.GetName(i);
+ i_desc += " Executed";
+ genotype_data_list.PushRear(new tArgDataEntry<cAnalyzeGenotype, int, int>
+ (i_name, i_desc, &cAnalyzeGenotype::GetInstExecutedCount, i));
+ }
genotype_data_list.PushRear(new tDataEntry<cAnalyzeGenotype, cString>
("task_list", "List of all tasks performed",
Modified: branches/collect/source/analyze/cAnalyzeGenotype.cc
===================================================================
--- branches/collect/source/analyze/cAnalyzeGenotype.cc 2007-05-03 16:14:28 UTC (rev 1522)
+++ branches/collect/source/analyze/cAnalyzeGenotype.cc 2007-05-03 17:00:16 UTC (rev 1523)
@@ -63,6 +63,7 @@
, gest_time(INT_MAX)
, fitness(0.0)
, errors(0)
+ , inst_executed_counts(0)
, task_counts(0)
, task_qualities(0)
, internal_task_counts(0)
@@ -113,6 +114,7 @@
, gest_time(INT_MAX)
, fitness(0.0)
, errors(0)
+ , inst_executed_counts(0)
, task_counts(0)
, task_qualities(0)
, internal_task_counts(0)
@@ -153,6 +155,7 @@
, gest_time(_gen.gest_time)
, fitness(_gen.fitness)
, errors(_gen.errors)
+ , inst_executed_counts(_gen.inst_executed_counts)
, task_counts(_gen.task_counts)
, task_qualities(_gen.task_qualities)
, internal_task_counts(_gen.internal_task_counts)
@@ -414,6 +417,7 @@
errors = test_phenotype.GetLastNumErrors();
div_type = test_phenotype.GetDivType();
mate_id = test_phenotype.MateSelectID();
+ inst_executed_counts = test_phenotype.GetLastInstCount();
task_counts = test_phenotype.GetLastTaskCount();
task_qualities = test_phenotype.GetLastTaskQuality();
internal_task_counts = test_phenotype.GetLastInternalTaskCount();
Modified: branches/collect/source/analyze/cAnalyzeGenotype.h
===================================================================
--- branches/collect/source/analyze/cAnalyzeGenotype.h 2007-05-03 16:14:28 UTC (rev 1522)
+++ branches/collect/source/analyze/cAnalyzeGenotype.h 2007-05-03 17:00:16 UTC (rev 1523)
@@ -128,6 +128,7 @@
double div_type;
int mate_id;
cString executed_flags; // converted into a string
+ tArray<int> inst_executed_counts;
tArray<int> task_counts;
tArray<double> task_qualities;
tArray<int> internal_task_counts;
@@ -264,6 +265,8 @@
const cString & GetAlignedSequence() const { return aligned_sequence; }
cString GetExecutedFlags() const { return executed_flags; }
cString GetAlignmentExecutedFlags() const;
+ const tArray<int>& GetInstExecutedCounts() const { return inst_executed_counts; }
+ int GetInstExecutedCount(int index) const { return inst_executed_counts[index]; }
const cString & GetTag() const { return tag; }
bool GetViable() const { return viable; }
More information about the Avida-cvs
mailing list