[Avida-SVN] r3234 - in branches/matt/RandomSearch: Avida.xcodeproj source/analyze
ruppmatt at myxo.css.msu.edu
ruppmatt at myxo.css.msu.edu
Wed May 13 08:43:56 PDT 2009
Author: ruppmatt
Date: 2009-05-13 11:43:56 -0400 (Wed, 13 May 2009)
New Revision: 3234
Modified:
branches/matt/RandomSearch/Avida.xcodeproj/project.pbxproj
branches/matt/RandomSearch/source/analyze/cAnalyze.cc
Log:
Reviewed and slightly modified RandomSearch code.
Modified: branches/matt/RandomSearch/Avida.xcodeproj/project.pbxproj
===================================================================
--- branches/matt/RandomSearch/Avida.xcodeproj/project.pbxproj 2009-05-12 20:32:21 UTC (rev 3233)
+++ branches/matt/RandomSearch/Avida.xcodeproj/project.pbxproj 2009-05-13 15:43:56 UTC (rev 3234)
@@ -1769,10 +1769,12 @@
DCC30C4D0762532C008F7A48 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 702442D70859E0B00059BD9B /* Build configuration list for PBXProject "Avida" */;
+ compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 0;
mainGroup = DCC30C490762532C008F7A48;
productRefGroup = DCC3164E07626CF3008F7A48 /* Products */;
projectDirPath = "";
+ projectRoot = "";
targets = (
7023ED520C0A590200362B9C /* full-suite */,
DCC3164C07626CF3008F7A48 /* avida */,
Modified: branches/matt/RandomSearch/source/analyze/cAnalyze.cc
===================================================================
--- branches/matt/RandomSearch/source/analyze/cAnalyze.cc 2009-05-12 20:32:21 UTC (rev 3233)
+++ branches/matt/RandomSearch/source/analyze/cAnalyze.cc 2009-05-13 15:43:56 UTC (rev 3234)
@@ -3739,7 +3739,7 @@
//Length 100
//const cString base_genome = "rucavccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccutycasvab";
- int num_trials = 10000000; // 10 million trials
+ int num_trials = 100000000; // 100 million trials
int num_tests = 100; // Number of random numbers to test
//Stochasticity
@@ -3766,6 +3766,8 @@
m_world->GetDriver().RaiseFatalException(2, "Cannot open equ_genomes.dat.");
cCPUTestInfo* test_info = new cCPUTestInfo;
+
+ //For each trial
for (int n = 0; n < num_trials; n++){
cString new_genome = base_genome;
@@ -3783,13 +3785,12 @@
const cPlasticPhenotype* phen = ppgenotype.GetPlasticPhenotype(pp);
freq_via += (phen->IsViable()) ? phen->GetFrequency() : 0.0;
tArray<int> tasks = phen->GetLastTaskCount();
- int task_combination = 0;
+ unsigned task_combination = 0;
if (phen->IsViable()){
- for (int t = 0; t < 9; t++){
- task_combination += (tasks[t] > 0) ? 1 << t : 0;
- if (tasks[t] > 0 && t == 8)
- print_equ_genome = true;
- }
+ if (tasks[8] > 0)
+ print_equ_genome = true;
+ for (int t = 0; t < 9; t++)
+ task_combination |= (tasks[t] > 0) ? 1 << t : 0;
gen_tasks[task_combination] += phen->GetFrequency();
}
}
More information about the Avida-cvs
mailing list