[Avida-SVN] r2348 - in development: . Avida.xcodeproj source source/main source/tools
covertar at myxo.css.msu.edu
covertar at myxo.css.msu.edu
Tue Feb 19 14:39:35 PST 2008
Author: covertar
Date: 2008-02-19 17:39:35 -0500 (Tue, 19 Feb 2008)
New Revision: 2348
Modified:
development/Avida.xcodeproj/project.pbxproj
development/CMakeLists.txt
development/source/defs.h
development/source/main/cAvidaConfig.h
development/source/main/cPopulation.cc
development/source/tools/cDemeProbSchedule.h
Log:
Added probablistic deme scheduler based on (living) population size.
Modified: development/Avida.xcodeproj/project.pbxproj
===================================================================
--- development/Avida.xcodeproj/project.pbxproj 2008-02-19 19:11:37 UTC (rev 2347)
+++ development/Avida.xcodeproj/project.pbxproj 2008-02-19 22:39:35 UTC (rev 2348)
@@ -23,6 +23,8 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 2A57A3FF0D6B954D00FC54C7 /* cProbDemeProbSchedule.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2A57A3FD0D6B954D00FC54C7 /* cProbDemeProbSchedule.cc */; };
+ 2A57A4000D6B954D00FC54C7 /* cProbDemeProbSchedule.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A57A3FE0D6B954D00FC54C7 /* cProbDemeProbSchedule.h */; };
5629D8110C3EE14800C5F152 /* cTextWindow.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5629D80D0C3EE13500C5F152 /* cTextWindow.cc */; };
5629D8180C3EE20C00C5F152 /* libncurses.5.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 70658C59085DF67D00486BED /* libncurses.5.4.dylib */; };
5629D8190C3EE21300C5F152 /* libavida-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7023EC330C0A426900362B9C /* libavida-core.a */; };
@@ -354,6 +356,8 @@
/* Begin PBXFileReference section */
1097463D0AE9606E00929ED6 /* cDeme.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cDeme.cc; sourceTree = "<group>"; };
1097463E0AE9606E00929ED6 /* cDeme.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cDeme.h; sourceTree = "<group>"; };
+ 2A57A3FD0D6B954D00FC54C7 /* cProbDemeProbSchedule.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cProbDemeProbSchedule.cc; sourceTree = "<group>"; };
+ 2A57A3FE0D6B954D00FC54C7 /* cProbDemeProbSchedule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cProbDemeProbSchedule.h; sourceTree = "<group>"; };
4201F39A0BE187F6006279B9 /* cTopology.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cTopology.h; sourceTree = "<group>"; };
422B64520C8305C40012C545 /* cOrgMessagePredicate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cOrgMessagePredicate.h; sourceTree = "<group>"; };
423335880BC067E3000DF681 /* cHardwareGX.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = cHardwareGX.cc; sourceTree = "<group>"; };
@@ -847,7 +851,7 @@
DCC315CE076253A5008F7A48 /* environment.rotate */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = environment.rotate; sourceTree = "<group>"; };
DCC315D0076253A5008F7A48 /* task_event_gen.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = task_event_gen.cc; sourceTree = "<group>"; };
DCC315D1076253A5008F7A48 /* task_event_gen.old.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = task_event_gen.old.cc; sourceTree = "<group>"; };
- DCC3164D07626CF3008F7A48 /* avida */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = avida; sourceTree = BUILT_PRODUCTS_DIR; };
+ DCC3164D07626CF3008F7A48 /* avida */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = avida; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -1471,6 +1475,8 @@
DCC314D8076253A2008F7A48 /* tools */ = {
isa = PBXGroup;
children = (
+ 2A57A3FD0D6B954D00FC54C7 /* cProbDemeProbSchedule.cc */,
+ 2A57A3FE0D6B954D00FC54C7 /* cProbDemeProbSchedule.h */,
70A778370D69D5C200735F1E /* cDemeProbSchedule.cc */,
70A778380D69D5C200735F1E /* cDemeProbSchedule.h */,
70E130BF0C442B2900CE9249 /* cCoords.h */,
@@ -1642,6 +1648,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
+ 2A57A4000D6B954D00FC54C7 /* cProbDemeProbSchedule.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1789,7 +1796,6 @@
DCC30C4D0762532C008F7A48 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 702442D70859E0B00059BD9B /* Build configuration list for PBXProject "Avida" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 0;
mainGroup = DCC30C490762532C008F7A48;
productRefGroup = DCC3164E07626CF3008F7A48 /* Products */;
@@ -1977,6 +1983,7 @@
7076FEB00D347FD000556CAF /* cAnalyzeTreeStats_CumulativeStemminess.cc in Sources */,
7076FEB10D347FD000556CAF /* cAnalyzeTreeStats_Gamma.cc in Sources */,
70A778390D69D5CA00735F1E /* cDemeProbSchedule.cc in Sources */,
+ 2A57A3FF0D6B954D00FC54C7 /* cProbDemeProbSchedule.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: development/CMakeLists.txt
===================================================================
--- development/CMakeLists.txt 2008-02-19 19:11:37 UTC (rev 2347)
+++ development/CMakeLists.txt 2008-02-19 22:39:35 UTC (rev 2348)
@@ -290,6 +290,7 @@
${TOOLS_DIR}/cIntegratedSchedule.cc
${TOOLS_DIR}/cIntegratedScheduleNode.cc
${TOOLS_DIR}/cMerit.cc
+ ${TOOLS_DIR}/cProbDemeProbSchedule.cc
${TOOLS_DIR}/cProbSchedule.cc
${TOOLS_DIR}/cRandom.cc
${TOOLS_DIR}/cRunningAverage.cc
Modified: development/source/defs.h
===================================================================
--- development/source/defs.h 2008-02-19 19:11:37 UTC (rev 2347)
+++ development/source/defs.h 2008-02-19 22:39:35 UTC (rev 2348)
@@ -96,7 +96,8 @@
SLICE_CONSTANT = 0,
SLICE_PROB_MERIT,
SLICE_INTEGRATED_MERIT,
- SLICE_DEME_PROB_MERIT
+ SLICE_DEME_PROB_MERIT,
+ SLICE_PROB_DEMESIZE_PROB_MERIT
};
enum ePOSITION_CHILD
Modified: development/source/main/cAvidaConfig.h
===================================================================
--- development/source/main/cAvidaConfig.h 2008-02-19 19:11:37 UTC (rev 2347)
+++ development/source/main/cAvidaConfig.h 2008-02-19 22:39:35 UTC (rev 2348)
@@ -384,7 +384,7 @@
CONFIG_ADD_GROUP(TIME_GROUP, "Time Slicing");
CONFIG_ADD_VAR(AVE_TIME_SLICE, int, 30, "Ave number of insts per org per update");
- CONFIG_ADD_VAR(SLICING_METHOD, int, 1, "0 = CONSTANT: all organisms get default...\n1 = PROBABILISTIC: Run _prob_ proportional to merit.\n2 = INTEGRATED: Perfectly integrated deterministic.\n3 = DemeProbabalistic, each deme gets the same number of CPU cycles, which are awarded probabalistically within each deme.");
+ CONFIG_ADD_VAR(SLICING_METHOD, int, 1, "0 = CONSTANT: all organisms get default...\n1 = PROBABILISTIC: Run _prob_ proportional to merit.\n2 = INTEGRATED: Perfectly integrated deterministic.\n3 = DemeProbabalistic, each deme gets the same number of CPU cycles, which are awarded probabalistically within each deme.\n4 = ProbDemeProbabalistic, each deme gets CPU cycles proportional to its living population size, which are awarded probabalistically within each deme.");
CONFIG_ADD_VAR(BASE_MERIT_METHOD, int, 4, "0 = Constant (merit independent of size)\n1 = Merit proportional to copied size\n2 = Merit prop. to executed size\n3 = Merit prop. to full size\n4 = Merit prop. to min of executed or copied size\n5 = Merit prop. to sqrt of the minimum size\n6 = Merit prop. to num times MERIT_BONUS_INST is in genome.");
CONFIG_ADD_VAR(BASE_CONST_MERIT, int, 100, "Base merit when BASE_MERIT_METHOD set to 0");
CONFIG_ADD_VAR(DEFAULT_BONUS, double, 1.0, "Initial bonus before any tasks");
Modified: development/source/main/cPopulation.cc
===================================================================
--- development/source/main/cPopulation.cc 2008-02-19 19:11:37 UTC (rev 2347)
+++ development/source/main/cPopulation.cc 2008-02-19 22:39:35 UTC (rev 2348)
@@ -48,6 +48,7 @@
#include "cPhenotype.h"
#include "cPopulationCell.h"
#include "cProbSchedule.h"
+#include "cProbDemeProbSchedule.h"
#include "cResource.h"
#include "cResourceCount.h"
#include "cSaleItem.h"
@@ -3058,6 +3059,9 @@
case SLICE_DEME_PROB_MERIT:
schedule = new cDemeProbSchedule(cell_array.GetSize(), m_world->GetRandom().GetInt(0x7FFFFFFF), deme_array.GetSize());
break;
+ case SLICE_PROB_DEMESIZE_PROB_MERIT:
+ schedule = new cProbDemeProbSchedule(cell_array.GetSize(), m_world->GetRandom().GetInt(0x7FFFFFFF), deme_array.GetSize());
+ break;
case SLICE_INTEGRATED_MERIT:
schedule = new cIntegratedSchedule(cell_array.GetSize());
break;
Modified: development/source/tools/cDemeProbSchedule.h
===================================================================
--- development/source/tools/cDemeProbSchedule.h 2008-02-19 19:11:37 UTC (rev 2347)
+++ development/source/tools/cDemeProbSchedule.h 2008-02-19 22:39:35 UTC (rev 2348)
@@ -58,7 +58,11 @@
class cDemeProbSchedule : public cSchedule
{
private:
+
+ //Keep our own RNG so as to better preserve consistancy.
cRandom m_rng;
+
+ //Array of WeightedIndex tree's to farm out the scheduling.
tArray<cWeightedIndex*> chart;
//how many demes are there?
More information about the Avida-cvs
mailing list