[Avida-SVN] r3524 - in branches/parasites/source: cpu main
zaman at myxo.css.msu.edu
zaman at myxo.css.msu.edu
Fri Nov 6 21:21:49 PST 2009
Author: zaman
Date: 2009-11-07 00:21:49 -0500 (Sat, 07 Nov 2009)
New Revision: 3524
Modified:
branches/parasites/source/cpu/cHardwareTransSMT.cc
branches/parasites/source/main/cPopulation.cc
Log:
changed mass action for parasites
Modified: branches/parasites/source/cpu/cHardwareTransSMT.cc
===================================================================
--- branches/parasites/source/cpu/cHardwareTransSMT.cc 2009-11-05 22:23:23 UTC (rev 3523)
+++ branches/parasites/source/cpu/cHardwareTransSMT.cc 2009-11-07 05:21:49 UTC (rev 3524)
@@ -1120,11 +1120,15 @@
// Mutations only occur on the read, for the moment.
int read_inst = 0;
+
if (m_organism->TestCopyMut(ctx)) {
read_inst = m_inst_set->GetRandomInst(ctx).GetOp();
} else {
read_inst = GetHead(head_id).GetInst().GetOp();
}
+
+
+ read_inst = GetHead(head_id).GetInst().GetOp();
Stack(dst).Push(read_inst);
ReadInst(read_inst);
Modified: branches/parasites/source/main/cPopulation.cc
===================================================================
--- branches/parasites/source/main/cPopulation.cc 2009-11-05 22:23:23 UTC (rev 3523)
+++ branches/parasites/source/main/cPopulation.cc 2009-11-07 05:21:49 UTC (rev 3524)
@@ -535,10 +535,17 @@
assert(parent_id >= 0 && parent_id < cell_array.GetSize());
cPopulationCell& parent_cell = cell_array[ parent_id ];
- int num_neighbors = parent.GetNeighborhoodSize();
- cOrganism* target_organism =
- parent_cell.ConnectionList().GetPos(m_world->GetRandom().GetUInt(num_neighbors))->GetOrganism();
+ int num_potential_hosts = 0;
+ if (m_world->GetConfig().BIRTH_METHOD.Get() == POSITION_OFFSPRING_FULL_SOUP_RANDOM)
+ {
+ num_potential_hosts = cell_array.GetSize();
+ }
+ else
+ int num_potential_hosts = parent.GetNeighborhoodSize();
+
+ cOrganism* target_organism = GetCell(m_world->GetRandom().GetUInt(num_potential_hosts)).GetOrganism();
+
if (target_organism == NULL) return false;
cHardwareBase& child_cpu = target_organism->GetHardware();
More information about the Avida-cvs
mailing list