[avida-cvs] avida CVS commits: /current/source/main analyze.cc
dule123
avida-cvs at alife.org
Wed Nov 5 06:52:48 PST 2003
dule123 Tue Nov 4 22:52:48 2003 EDT
Modified files:
/avida/current/source/main analyze.cc
Log:
Fixed some bugs in ANALYZE_MODULARITY.
Also, made sure 'binary' option for this command works.
Index: avida/current/source/main/analyze.cc
diff -u avida/current/source/main/analyze.cc:1.83 avida/current/source/main/analyze.cc:1.84
--- avida/current/source/main/analyze.cc:1.83 Mon Nov 3 22:51:59 2003
+++ avida/current/source/main/analyze.cc Tue Nov 4 22:52:48 2003
@@ -2164,6 +2164,7 @@
mod_genome[line_num] = null_inst;
cAnalyzeGenotype test_genotype(mod_genome, map_inst_set);
+ cAnalyzeGenotype old_genotype(base_genome, map_inst_set);
test_genotype.Recalculate();
// Print the individual columns...
@@ -2173,6 +2174,11 @@
while ((data_command = output_it.Next()) != NULL) {
data_command->SetTarget(&test_genotype);
test_genotype.SetSpecialArgs(data_command->GetArgs());
+ // This is done so that under 'binary' option it marks
+ // the task as being influenced by the mutation iff
+ // it is completely knocked out, not just decreased
+ genotype->SetSpecialArgs(data_command->GetArgs());
+
int compare = data_command->Compare(genotype);
// If knocking out an instruction stops the expression of a
@@ -2180,8 +2186,7 @@
// and add it to two counts
// Only do the checking if the test_genotype replicate, i.e.
// if it's fitness is not zeros
-
- if (compare == -2 && test_genotype.GetFitness() != 0) {
+ if (compare < 0 && test_genotype.GetFitness() != 0) {
mod_matrix(cur_col,line_num) = 1;
num_inst[cur_col]++;
num_task[line_num]++;
@@ -2191,7 +2196,7 @@
// Reset the mod_genome back to the original sequence.
mod_genome[line_num].SetOp(cur_inst);
} // end of genotype-phenotype mapping for a single organism
-
+
for (int i = 0; i < num_cols; i++) {if (num_inst[i] != 0) total_task++;}
for (int i = 0; i < max_line; i++) {if (num_task[i] != 0) total_inst++;}
for (int i = 0; i < num_cols; i++) {total_all = total_all + num_inst[i];}
@@ -2213,7 +2218,7 @@
for (int i = 0; i < num_cols; i++) {
if (num_inst[i] > 0) {
av_num_inst[i] = av_num_inst[i] + num_inst[i] * num_cpus;
- org_task[i]++; // count how many are actually doing the task
+ org_task[i] = org_task[i] + num_cpus; // count how many are actually doing the task
}
}
More information about the Avida-cvs
mailing list