[Avida-SVN] r2651 - in development/source: actions cpu main
connel42 at myxo.css.msu.edu
connel42 at myxo.css.msu.edu
Mon Jun 16 10:25:16 PDT 2008
Author: connel42
Date: 2008-06-16 13:25:16 -0400 (Mon, 16 Jun 2008)
New Revision: 2651
Modified:
development/source/actions/PopulationActions.cc
development/source/cpu/cHardwareCPU.cc
development/source/main/cAvidaConfig.h
development/source/main/cDeme.cc
development/source/main/cPopulation.cc
Log:
* changed default movement amount from 0 to 1 cells (BIOMIMETIC_MOVEMENT_STEP)
* added action and other code to finish message predicate support
Modified: development/source/actions/PopulationActions.cc
===================================================================
--- development/source/actions/PopulationActions.cc 2008-06-16 15:43:49 UTC (rev 2650)
+++ development/source/actions/PopulationActions.cc 2008-06-16 17:25:16 UTC (rev 2651)
@@ -722,7 +722,8 @@
assert(target_cell < m_world->GetPopulation().GetSize());
if(m_world->GetPopulation().GetDeme(i).GetInjectedCount() < m_num_orgs) {
- m_world->GetPopulation().Inject(m_world->GetPopulation().GetDeme(i).GetGermline().GetLatest(), target_cell, m_merit,
+ m_world->GetPopulation().Inject(m_world->GetPopulation().GetDeme(i).GetGermline().GetLatest(),
+ target_cell, m_merit,
m_lineage_label, m_neutral_metric);
m_world->GetPopulation().GetDeme(i).IncInjectedCount();
}
@@ -1267,11 +1268,9 @@
'corners' - ...demes with upper left and lower right corners filled.
'deme-age' - ...demes that are a certain age
'birth-count' ...demes that have had a certain number of births.
-<<<<<<< .working
'sat-mov-pred' - ...demes whose movement predicate was previously satisfied
-=======
'events-killed' ...demes that have killed a certian number of events
->>>>>>> .merge-right.r2644
+ 'sat-msg-pred' - ...demes whose message predicate was previously satisfied
*/
class cActionReplicateDemes : public cAction
@@ -1292,6 +1291,7 @@
else if (in_trigger == "birth-count") m_rep_trigger = 4;
else if (in_trigger == "sat-mov-pred") m_rep_trigger = 5;
else if (in_trigger == "events-killed") m_rep_trigger = 6;
+ else if (in_trigger == "sat-msg-pred") m_rep_trigger = 7;
else {
cString err("Unknown replication trigger '");
err += in_trigger;
Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc 2008-06-16 15:43:49 UTC (rev 2650)
+++ development/source/cpu/cHardwareCPU.cc 2008-06-16 17:25:16 UTC (rev 2651)
@@ -5945,8 +5945,6 @@
double pher_amount = 0; // this is used in logging
int drop_mode = -1;
-//int smc = mycell.ConnectionList().GetSize();
- //SingleProcess shows decent-looking cellids until the end. maybe this is a deme replication problem (probably)
cPopulationCell faced = mycell.GetCellFaced();
// Find if any neighbor is a target
@@ -5960,6 +5958,7 @@
mycell.ConnectionList().CircNext();
}
+// apparently this doesn't work on macs
// assert(faced == pop.GetCell(fromcellID).GetCellFaced());
// Rotate until we face the neighbor with a target.
Modified: development/source/main/cAvidaConfig.h
===================================================================
--- development/source/main/cAvidaConfig.h 2008-06-16 15:43:49 UTC (rev 2650)
+++ development/source/main/cAvidaConfig.h 2008-06-16 17:25:16 UTC (rev 2651)
@@ -532,7 +532,7 @@
// @WRE: Additions for approaching various features of biological organisms
CONFIG_ADD_GROUP(BIOMIMETIC_GROUP, "Biomimetic Features Settings");
CONFIG_ADD_VAR(BIOMIMETIC_REFRACTORY_PERIOD, double, 0.0, "Number of updates affected by refractory period");
- CONFIG_ADD_VAR(BIOMIMETIC_MOVEMENT_STEP, int, 0, "Number of cells to move Avidian on move instruction");
+ CONFIG_ADD_VAR(BIOMIMETIC_MOVEMENT_STEP, int, 1, "Number of cells to move Avidian on move instruction");
CONFIG_ADD_VAR(BIOMIMETIC_MOVEMENT_LOG, int, 0, "Log detailed movement information (WARNING: large data file)");
CONFIG_ADD_VAR(BIOMIMETIC_MOVEMENT_FACTOR, double, 1.0, "Scale merit bonus due to movement (m<1.0 applies a cost)");
CONFIG_ADD_VAR(BIOMIMETIC_EVAL_ON_MOVEMENT, int, 0, "Force task evaluation on each movement step");
Modified: development/source/main/cDeme.cc
===================================================================
--- development/source/main/cDeme.cc 2008-06-16 15:43:49 UTC (rev 2650)
+++ development/source/main/cDeme.cc 2008-06-16 17:25:16 UTC (rev 2651)
@@ -210,6 +210,9 @@
break;
}
}
+ if(IsEmpty()) {
+ return;
+ }
++_age;
}
Modified: development/source/main/cPopulation.cc
===================================================================
--- development/source/main/cPopulation.cc 2008-06-16 15:43:49 UTC (rev 2650)
+++ development/source/main/cPopulation.cc 2008-06-16 17:25:16 UTC (rev 2651)
@@ -1186,6 +1186,7 @@
4: 'birth-count' ...demes that have had a certain number of births.
5: 'sat-mov-pred'...demes whose movement predicate was previously satisfied
6: 'events-killed' ...demes that have killed a certian number of events
+7: 'sat-msg-pred'...demes whose movement predicate was previously satisfied
*/
@@ -1250,6 +1251,10 @@
if(source_deme.GetConsecutiveSuccessfulEventPeriods()+currentSlotSuccessful < m_world->GetConfig().DEMES_MIM_SUCCESSFUL_EVENT_PERIODS.Get()) continue;
break;
}
+ case 7: {
+ if(!(source_deme.MsgPredSatisfiedPreviously())) continue;
+ break;
+ }
default: {
cerr << "ERROR: Invalid replication trigger " << rep_trigger
<< " in cPopulation::ReplicateDemes()" << endl;
@@ -4110,7 +4115,7 @@
cell_id = 0;
}
}
-
+
InjectGenome(cell_id, genome, lineage_label);
cPhenotype& phenotype = GetCell(cell_id).GetOrganism()->GetPhenotype();
phenotype.SetNeutralMetric(neutral);
@@ -4431,7 +4436,7 @@
{
// Setup the genotype...
cGenotype* new_genotype = m_world->GetClassificationManager().GetGenotypeInjected(genome, lineage_label);
-
+
// The rest is done by InjectGenotype();
InjectGenotype( cell_id, new_genotype );
}
More information about the Avida-cvs
mailing list