[avida-cvs] avida CVS commits: /current/source/main analyze.cc
dule123
avida-cvs at alife.org
Tue Nov 4 06:52:01 PST 2003
dule123 Mon Nov 3 22:52:01 2003 EDT
Modified files:
/avida/current/source/main analyze.cc
Log:
fixing a big in AVERAGE_MODULARITY. no biggie.
Index: avida/current/source/main/analyze.cc
diff -u avida/current/source/main/analyze.cc:1.82 avida/current/source/main/analyze.cc:1.83
--- avida/current/source/main/analyze.cc:1.82 Mon Nov 3 18:27:42 2003
+++ avida/current/source/main/analyze.cc Mon Nov 3 22:51:59 2003
@@ -2237,13 +2237,16 @@
for (int j = 0; j < num_cols; j++) {
if (i!=j) {overlap_per_task = overlap_per_task + task_overlap(i,j);}
}
- sum_task_overlap = sum_task_overlap + overlap_per_task / (task_overlap(i,i) * (total_task-1));
+ if (task_overlap(i,i) !=0){
+ sum_task_overlap = sum_task_overlap + overlap_per_task / (task_overlap(i,i) * (total_task-1));
+ }
}
}
// now, divide that by number of tasks done and add to the grand sum, weigthed by num_cpus
- if (total_task !=0) av_task_overlap = av_task_overlap + num_cpus * (double) sum_task_overlap/total_task ;
-
+ if (total_task!=0) {
+ av_task_overlap = av_task_overlap + num_cpus * (double) sum_task_overlap/total_task ;
+}
// calculate the first/last postion of a task, the task "spread"
// starting from the top look for the fist command that matters for a task
@@ -2276,7 +2279,6 @@
for (int i = 0; i < num_cols; i++) {
av_task_length[i] = av_task_length[i] + num_cpus * task_length[i];
}
-
// calculate the Standard Deviation in the mean position of the task
for (int i = 0; i < num_cols; i++) {
More information about the Avida-cvs
mailing list