[Avida-SVN] r3113 - in development/source: analyze cpu
brysonda at myxo.css.msu.edu
brysonda at myxo.css.msu.edu
Tue Jan 13 06:07:33 PST 2009
Author: brysonda
Date: 2009-01-13 09:07:33 -0500 (Tue, 13 Jan 2009)
New Revision: 3113
Modified:
development/source/analyze/cModularityAnalysis.cc
development/source/cpu/cHardwareManager.cc
Log:
Bug Fixes.
cHardwareManager::Create was not respecting the inst_set argument. A cModularityAnalysis data entry was a duplicate name. cModularityAnalysis::CalcFunctionalModularity was not comparing against the base genotype task profile.
Modified: development/source/analyze/cModularityAnalysis.cc
===================================================================
--- development/source/analyze/cModularityAnalysis.cc 2009-01-13 07:04:58 UTC (rev 3112)
+++ development/source/analyze/cModularityAnalysis.cc 2009-01-13 14:07:33 UTC (rev 3113)
@@ -48,7 +48,7 @@
ADD_GDATA("tasks_prop", "Proportion of Sites in Tasks", GetTaskProportionFor, 4);
ADD_GDATA("ave_tasks_per_site", "Average Number of Tasks Per Site", GetAveTasksPerSiteFor, 6);
ADD_GDATA("ave_sites_per_task", "Average Number of Sites Per Task", GetAveSitesPerTaskFor, 6);
- ADD_GDATA("tasks_prop", "Average Proportion of the Non-overlapping Region of a Task", GetTaskProportionFor, 4);
+ ADD_GDATA("ave_prop_nonoverlap", "Average Proportion of the Non-overlapping Region of a Task", GetTaskProportionFor, 4);
ADD_GDATA_IDX("sites_per_task", DescSitesPerTask, GetSitesPerTaskFor, 1);
ADD_GDATA_IDX("sites_inv_x_tasks", DescSitesInvolvedInXTasks, GetSitesInvolvedInXTasksFor, 1);
ADD_GDATA_IDX("task_length", DescTaskLength, GetTaskLengthFor, 4);
@@ -68,7 +68,7 @@
// Check if the organism does any tasks
bool does_tasks = false;
- const tArray<int>& base_tasks = test_info.GetColonyOrganism()->GetPhenotype().GetLastTaskCount();
+ const tArray<int> base_tasks = test_info.GetColonyOrganism()->GetPhenotype().GetLastTaskCount();
const int num_tasks = base_tasks.GetSize();
for (int i = 0; i < num_tasks; i++) {
if (base_tasks[i] > 0) {
@@ -111,7 +111,7 @@
// 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
- if (test_tasks[cur_task] == 0) {
+ if (base_tasks[cur_task] && !test_tasks[cur_task]) {
// If knocking out an instruction stops the expression of a particular task, mark that in the modularity matrix
// and add it to two counts
mod_matrix(cur_task, line_num) = 1;
Modified: development/source/cpu/cHardwareManager.cc
===================================================================
--- development/source/cpu/cHardwareManager.cc 2009-01-13 07:04:58 UTC (rev 3112)
+++ development/source/cpu/cHardwareManager.cc 2009-01-13 14:07:33 UTC (rev 3113)
@@ -91,19 +91,19 @@
switch (m_type) {
case HARDWARE_TYPE_CPU_ORIGINAL:
- hw = new cHardwareCPU(ctx, m_world, in_org, m_inst_set);
+ hw = new cHardwareCPU(ctx, m_world, in_org, inst_set);
break;
case HARDWARE_TYPE_CPU_SMT:
- hw = new cHardwareSMT(ctx, m_world, in_org, m_inst_set);
+ hw = new cHardwareSMT(ctx, m_world, in_org, inst_set);
break;
case HARDWARE_TYPE_CPU_TRANSSMT:
- hw = new cHardwareTransSMT(ctx, m_world, in_org, m_inst_set);
+ hw = new cHardwareTransSMT(ctx, m_world, in_org, inst_set);
break;
case HARDWARE_TYPE_CPU_EXPERIMENTAL:
- hw = new cHardwareExperimental(ctx, m_world, in_org, m_inst_set);
+ hw = new cHardwareExperimental(ctx, m_world, in_org, inst_set);
break;
case HARDWARE_TYPE_CPU_GX:
- hw = new cHardwareGX(ctx, m_world, in_org, m_inst_set);
+ hw = new cHardwareGX(ctx, m_world, in_org, inst_set);
break;
default:
cDriverManager::Status().SignalError("Unknown/Unsupported HARDWARE_TYPE specified", -1);
More information about the Avida-cvs
mailing list