[Avida-SVN] r2944 - in branches/movement/source: actions main
grabow38 at myxo.css.msu.edu
grabow38 at myxo.css.msu.edu
Sat Nov 15 17:24:25 PST 2008
Author: grabow38
Date: 2008-11-15 20:24:25 -0500 (Sat, 15 Nov 2008)
New Revision: 2944
Modified:
branches/movement/source/actions/PopulationActions.cc
branches/movement/source/main/cPopulation.cc
Log:
Added use configuration value to determine injection placement in cActionInjectDemes.
Modified: branches/movement/source/actions/PopulationActions.cc
===================================================================
--- branches/movement/source/actions/PopulationActions.cc 2008-11-14 22:26:03 UTC (rev 2943)
+++ branches/movement/source/actions/PopulationActions.cc 2008-11-16 01:24:25 UTC (rev 2944)
@@ -576,8 +576,12 @@
for(int i=0; i<m_world->GetPopulation().GetNumDemes(); ++i) {
// WARNING: initial ancestor has already be injected into the population
// calling this will overwrite it.
+ // m_world->GetPopulation().Inject(genome,
+ // m_world->GetPopulation().GetDeme(i).GetCellID(0),
+ // m_merit, m_lineage_label, m_neutral_metric);
+ // @WRE: use configuration value to figure out cell ID for placement 15-Nov-2008
m_world->GetPopulation().Inject(genome,
- m_world->GetPopulation().GetDeme(i).GetCellID(0),
+ m_world->GetPopulation().DemeSelectInjectionCell( m_world->GetPopulation().GetDeme(i), 0),
m_merit, m_lineage_label, m_neutral_metric);
m_world->GetPopulation().GetDeme(i).IncInjectedCount();
Modified: branches/movement/source/main/cPopulation.cc
===================================================================
--- branches/movement/source/main/cPopulation.cc 2008-11-14 22:26:03 UTC (rev 2943)
+++ branches/movement/source/main/cPopulation.cc 2008-11-16 01:24:25 UTC (rev 2944)
@@ -713,6 +713,7 @@
Tumble(src_cell.GetOrganism());
}
}
+ cout << "In MoveOrganisms... Facing ' " << newFacing << endl;
}
void cPopulation::KillOrganism(cPopulationCell& in_cell)
@@ -951,11 +952,20 @@
int target_cell_id = org1->GetTargetCellID();
int target_x = target_cell_id % world_x;
int target_y = target_cell_id / world_x;
- int facing_dir = org1-> GetFacing();
+ int facing_dir = cell2. GetFacing();
ofstream movelog;
movelog.open("data/movelog.txt",ios::app);
// By columns: org ID, from cell xy, to cell xy, target x, target y, facing
+ cout << cid << " " <<
+ x1 << " " <<
+ y1 << " " <<
+ x << " " <<
+ y << " " <<
+ target_x << " " <<
+ target_y << " " <<
+ facing_dir << endl;
+
movelog << cid << " " <<
x1 << " " <<
y1 << " " <<
@@ -2285,6 +2295,10 @@
assert(cellid >= 0 && cellid < cell_array.GetSize());
assert(cellid >= deme.GetCellID(0));
assert(cellid <= deme.GetCellID(deme.GetSize()-1));
+
+ // @ LMG
+ cout << " Cell ID selected = " << cellid << endl;
+
return cellid;
}
More information about the Avida-cvs
mailing list