[Avida-SVN] r1709 - in development: source/cpu source/main support/config
barrick at myxo.css.msu.edu
barrick at myxo.css.msu.edu
Sat Jun 23 06:42:30 PDT 2007
Author: barrick
Date: 2007-06-23 09:42:30 -0400 (Sat, 23 Jun 2007)
New Revision: 1709
Modified:
development/source/cpu/cHardwareBase.cc
development/source/cpu/cHardwareGX.cc
development/source/main/cAvidaConfig.h
development/source/main/cMutationRates.cc
development/source/main/cMutationRates.h
development/source/main/cOrganism.h
development/support/config/avida.cfg
Log:
Slip mutations moved to cHardwareBase::Divide_DoMutations and pref moved to Mutation Group.
Modified: development/source/cpu/cHardwareBase.cc
===================================================================
--- development/source/cpu/cHardwareBase.cc 2007-06-22 20:19:35 UTC (rev 1708)
+++ development/source/cpu/cHardwareBase.cc 2007-06-23 13:42:30 UTC (rev 1709)
@@ -130,7 +130,7 @@
/*
Return the number of mutations that occur on divide. AWC 06/29/06
- Limit the number of mutations that occur to be less than or equat to maxmut (defaults to INT_MAX)
+ Limit the number of mutations that occur to be less than or equal to maxmut (defaults to INT_MAX)
*/
unsigned cHardwareBase::Divide_DoMutations(cAvidaContext& ctx, double mut_multiplier, const int maxmut)
{
@@ -140,7 +140,34 @@
cCPUMemory& child_genome = organism->ChildGenome();
organism->GetPhenotype().SetDivType(mut_multiplier);
-
+
+ // @JEB Slip Mutations
+ // As if the read head jumped from one random position of the child
+ // to another random position and continued reading to the end.
+ // This can cause large deletions or tandem duplications.
+ // Unlucky organisms might exceed the allowed length (randomly) if these mutations occur.
+ // Limited to once per divide and NOT COUNTED.
+ if ( organism->TestDivideSlip(ctx) )
+ {
+ cGenome child_copy = cGenome(child_genome);
+ int from = ctx.GetRandom().GetInt(child_copy.GetSize());
+ int to = ctx.GetRandom().GetInt(child_copy.GetSize());
+
+ //Resize child genome
+ child_genome.Resize( child_genome.GetSize() + (from-to) );
+ for (int i=0; i < child_copy.GetSize() - to; i++)
+ {
+ child_genome[from+i] = child_copy[to+i];
+ }
+
+ if (m_world->GetVerbosity() >= VERBOSE_DETAILS)
+ {
+ cout << "SLIP MUTATION from " << from << " to " << to << endl;
+ cout << "Parent: " << child_copy.AsString() << endl;
+ cout << "Child : " << child_genome.AsString() << endl;
+ }
+ }
+
// Divide Mutations
if (organism->TestDivideMut(ctx) && totalMutations < maxmut) {
const unsigned int mut_line = ctx.GetRandom().GetUInt(child_genome.GetSize());
@@ -242,7 +269,6 @@
}
}
-
// Count up mutated lines
for (int i = 0; i < GetMemory().GetSize(); i++) {
if (GetMemory().FlagPointMut(i)) {
@@ -394,7 +420,7 @@
// test whether the offspring creature contains an advantageous mutation.
/*
- Return true iff only a reversion is performed -- returns false is steralized regardless of weather or
+ Return true iff only a reversion is performed -- returns false is sterilized regardless of whether or
not a reversion is performed. AWC 06/29/06
*/
bool cHardwareBase::Divide_TestFitnessMeasures(cAvidaContext& ctx)
Modified: development/source/cpu/cHardwareGX.cc
===================================================================
--- development/source/cpu/cHardwareGX.cc 2007-06-22 20:19:35 UTC (rev 1708)
+++ development/source/cpu/cHardwareGX.cc 2007-06-23 13:42:30 UTC (rev 1709)
@@ -2120,20 +2120,6 @@
child_genome = organism->GetGenome();
organism->GetPhenotype().SetLinesCopied(GetMemory().GetSize());
- // SLIPPAGE MUTATIONS
- if ( ctx.GetRandom().P(m_world->GetConfig().DIVIDE_SLIP_PROB.Get()) )
- {
- int from = ctx.GetRandom().GetInt(organism->GetGenome().GetSize());
- int to = ctx.GetRandom().GetInt(organism->GetGenome().GetSize());
-
- //Resize child genome
- child_genome.Resize( child_genome.GetSize() + (from-to) );
- for (int i=0; i < organism->GetGenome().GetSize() - to; i++)
- {
- child_genome[from+i] = (organism->GetGenome())[to+i];
- }
- }
-
Divide_DoMutations(ctx);
bool viable = Divide_CheckViable(ctx, organism->GetGenome().GetSize(), child_genome.GetSize());
Modified: development/source/main/cAvidaConfig.h
===================================================================
--- development/source/main/cAvidaConfig.h 2007-06-22 20:19:35 UTC (rev 1708)
+++ development/source/main/cAvidaConfig.h 2007-06-23 13:42:30 UTC (rev 1709)
@@ -255,6 +255,7 @@
CONFIG_ADD_VAR(DIVIDE_MUT_PROB, double, 0.0, "Mutation rate (per divide)");
CONFIG_ADD_VAR(DIVIDE_INS_PROB, double, 0.05, "Insertion rate (per divide)");
CONFIG_ADD_VAR(DIVIDE_DEL_PROB, double, 0.05, "Deletion rate (per divide)");
+ CONFIG_ADD_VAR(DIVIDE_SLIP_PROB, double, 0.0, "Slip rate (per divide) - creates large deletions/duplications");
CONFIG_ADD_VAR(PARENT_MUT_PROB, double, 0.0, "Per-site, in parent, on divide");
CONFIG_ADD_VAR(SPECIAL_MUT_LINE, int, -1, "If this is >= 0, ONLY this line is mutated");
CONFIG_ADD_VAR(INJECT_INS_PROB, double, 0.0, "Insertion rate (per site, applied on inject)");
@@ -363,8 +364,6 @@
CONFIG_ADD_VAR(IMPLICIT_TURNOVER_RATE, double, 0.0, "Number of programids recycled per CPU cycle. 0 = OFF");
CONFIG_ADD_VAR(IMPLICIT_MAX_PROGRAMID_LENGTH, int, 0, "Creation of an executable programid terminates after this many instructions. 0 = disabled");
CONFIG_ADD_VAR(IMPLICIT_REPRO_TIME, int, 0, "Implicitly call the repro instruction after completing this many cpu cycles. 0 = disabled."); // TODO - implmement for all hardware types and move to Reproduction Group
- CONFIG_ADD_VAR(DIVIDE_SLIP_PROB, double, 0.0, ""); // TODO - implmement for all hardware types and move to Reproduction Group
-
// CONFIG_ADD_VAR(CLEAR_ON_OUTPUT, int, 0, "Reset input buffer every time output called?"); @JEB Not fully implemented
CONFIG_ADD_GROUP(PROMOTER_GROUP, "Promoters");
Modified: development/source/main/cMutationRates.cc
===================================================================
--- development/source/main/cMutationRates.cc 2007-06-22 20:19:35 UTC (rev 1708)
+++ development/source/main/cMutationRates.cc 2007-06-23 13:42:30 UTC (rev 1709)
@@ -39,6 +39,7 @@
divide.divide_mut_prob = world->GetConfig().DIVIDE_MUT_PROB.Get();
divide.divide_ins_prob = world->GetConfig().DIVIDE_INS_PROB.Get();
divide.divide_del_prob = world->GetConfig().DIVIDE_DEL_PROB.Get();
+ divide.divide_slip_prob = world->GetConfig().DIVIDE_SLIP_PROB.Get();
divide.parent_mut_prob = world->GetConfig().PARENT_MUT_PROB.Get();
inject.ins_prob = world->GetConfig().INJECT_INS_PROB.Get();
inject.del_prob = world->GetConfig().INJECT_DEL_PROB.Get();
@@ -57,6 +58,7 @@
divide.divide_mut_prob = 0.0;
divide.divide_ins_prob = 0.0;
divide.divide_del_prob = 0.0;
+ divide.divide_slip_prob = 0.0;
divide.parent_mut_prob = 0.0;
inject.ins_prob = 0.0;
inject.del_prob = 0.0;
@@ -75,6 +77,7 @@
divide.divide_mut_prob = in_muts.divide.divide_mut_prob;
divide.divide_ins_prob = in_muts.divide.divide_ins_prob;
divide.divide_del_prob = in_muts.divide.divide_del_prob;
+ divide.divide_slip_prob = in_muts.divide.divide_slip_prob;;
divide.parent_mut_prob = in_muts.divide.parent_mut_prob;
inject.ins_prob = in_muts.inject.ins_prob;
inject.del_prob = in_muts.inject.del_prob;
Modified: development/source/main/cMutationRates.h
===================================================================
--- development/source/main/cMutationRates.h 2007-06-22 20:19:35 UTC (rev 1708)
+++ development/source/main/cMutationRates.h 2007-06-23 13:42:30 UTC (rev 1709)
@@ -60,6 +60,7 @@
double divide_mut_prob; // Max one per divide
double divide_ins_prob; // Max one per divide
double divide_del_prob; // Max one per divide
+ double divide_slip_prob; // Max one per divide
double parent_mut_prob;
};
sDivideMuts divide;
@@ -97,6 +98,7 @@
bool TestDivideMut(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.divide_mut_prob); }
bool TestDivideIns(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.divide_ins_prob); }
bool TestDivideDel(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.divide_del_prob); }
+ bool TestDivideSlip(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.divide_slip_prob); }
bool TestParentMut(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.parent_mut_prob); }
double DoMetaCopyMut(cAvidaContext& ctx) {
if (ctx.GetRandom().P(meta.copy_mut_prob) == false) return 1.0;
Modified: development/source/main/cOrganism.h
===================================================================
--- development/source/main/cOrganism.h 2007-06-22 20:19:35 UTC (rev 1708)
+++ development/source/main/cOrganism.h 2007-06-23 13:42:30 UTC (rev 1709)
@@ -255,6 +255,7 @@
bool TestDivideMut(cAvidaContext& ctx) const { return m_mut_rates.TestDivideMut(ctx); }
bool TestDivideIns(cAvidaContext& ctx) const { return m_mut_rates.TestDivideIns(ctx); }
bool TestDivideDel(cAvidaContext& ctx) const { return m_mut_rates.TestDivideDel(ctx); }
+ bool TestDivideSlip(cAvidaContext& ctx) const { return m_mut_rates.TestDivideSlip(ctx); }
bool TestParentMut(cAvidaContext& ctx) const { return m_mut_rates.TestParentMut(ctx); }
double GetCopyMutProb() const { return m_mut_rates.GetCopyMutProb(); }
Modified: development/support/config/avida.cfg
===================================================================
--- development/support/config/avida.cfg 2007-06-22 20:19:35 UTC (rev 1708)
+++ development/support/config/avida.cfg 2007-06-23 13:42:30 UTC (rev 1709)
@@ -122,6 +122,7 @@
DIVIDE_MUT_PROB 0.0 # Mutation rate (per divide)
DIVIDE_INS_PROB 0.05 # Insertion rate (per divide)
DIVIDE_DEL_PROB 0.05 # Deletion rate (per divide)
+DIVIDE_SLIP_PROB 0.0 # Slip rate (per divide) - creates large deletions/duplications
PARENT_MUT_PROB 0.0 # Per-site, in parent, on divide
SPECIAL_MUT_LINE -1 # If this is >= 0, ONLY this line is mutated
INJECT_INS_PROB 0.0 # Insertion rate (per site, applied on inject)
@@ -291,7 +292,6 @@
IMPLICIT_TURNOVER_RATE 0.0 # Number of programids recycled per CPU cycle. 0 = OFF
IMPLICIT_MAX_PROGRAMID_LENGTH 0 # Creation of an executable programid terminates after this many instructions. 0 = disabled
IMPLICIT_REPRO_TIME 0 # Implicitly call the repro instruction after completing this many cpu cycles. 0 = disabled.
-DIVIDE_SLIP_PROB 0.0 #
### PROMOTER_GROUP ###
# Promoters
More information about the Avida-cvs
mailing list