[Avida-SVN] r3413 - development/source/main
brysonda at myxo.css.msu.edu
brysonda at myxo.css.msu.edu
Mon Sep 21 11:32:38 PDT 2009
Author: brysonda
Date: 2009-09-21 14:32:38 -0400 (Mon, 21 Sep 2009)
New Revision: 3413
Modified:
development/source/main/cMutationRates.cc
development/source/main/cMutationRates.h
Log:
Reorganize cMutationRates internal structures to reflect death_prob's role more accurately.
Modified: development/source/main/cMutationRates.cc
===================================================================
--- development/source/main/cMutationRates.cc 2009-09-18 21:07:14 UTC (rev 3412)
+++ development/source/main/cMutationRates.cc 2009-09-21 18:32:38 UTC (rev 3413)
@@ -56,7 +56,6 @@
divide.divide_slip_prob = world->GetConfig().DIVIDE_SLIP_PROB.Get();
divide.parent_mut_prob = world->GetConfig().PARENT_MUT_PROB.Get();
- divide.death_prob = world->GetConfig().DEATH_PROB.Get();
inject.ins_prob = world->GetConfig().INJECT_INS_PROB.Get();
inject.del_prob = world->GetConfig().INJECT_DEL_PROB.Get();
@@ -64,6 +63,8 @@
meta.copy_mut_prob = world->GetConfig().META_COPY_MUT.Get();
meta.standard_dev = world->GetConfig().META_STD_DEV.Get();
+
+ update.death_prob = world->GetConfig().DEATH_PROB.Get();
}
void cMutationRates::Clear()
@@ -94,14 +95,14 @@
divide.parent_mut_prob = 0.0;
- divide.death_prob = 0.0;
-
inject.ins_prob = 0.0;
inject.del_prob = 0.0;
inject.mut_prob = 0.0;
meta.copy_mut_prob = 0.0;
meta.standard_dev = 0.0;
+
+ update.death_prob = 0.0;
}
void cMutationRates::Copy(const cMutationRates& in_muts)
@@ -131,7 +132,6 @@
divide.divide_slip_prob = in_muts.divide.divide_slip_prob;
divide.parent_mut_prob = in_muts.divide.parent_mut_prob;
- divide.death_prob = in_muts.divide.death_prob;
inject.ins_prob = in_muts.inject.ins_prob;
inject.del_prob = in_muts.inject.del_prob;
@@ -139,4 +139,6 @@
meta.copy_mut_prob = in_muts.meta.copy_mut_prob;
meta.standard_dev = in_muts.meta.standard_dev;
+
+ update.death_prob = in_muts.update.death_prob;
}
Modified: development/source/main/cMutationRates.h
===================================================================
--- development/source/main/cMutationRates.h 2009-09-18 21:07:14 UTC (rev 3412)
+++ development/source/main/cMutationRates.h 2009-09-21 18:32:38 UTC (rev 3413)
@@ -52,22 +52,21 @@
// ...at the divide...
struct sDivideMuts {
- double ins_prob; // Per site
- double del_prob; // Per site
- double mut_prob; // Per site
- double uniform_prob;
- double slip_prob;
- 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_poisson_mut_mean; // Allows multiple with constant genomic rate
- double divide_poisson_ins_mean; // Allows multiple with constant genomic rate
- double divide_poisson_del_mean; // Allows multiple with constant genomic rate
- double divide_poisson_slip_mean; // Allows multiple with constant genomic rate
- double divide_slip_prob; // Max one per divide
+ double ins_prob; // Per site
+ double del_prob; // Per site
+ double mut_prob; // Per site
+ double uniform_prob; // Per site
+ double slip_prob; // Per site
+ 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_poisson_mut_mean; // Allows multiple with constant genomic rate
+ double divide_poisson_ins_mean; // Allows multiple with constant genomic rate
+ double divide_poisson_del_mean; // Allows multiple with constant genomic rate
+ double divide_poisson_slip_mean; // Allows multiple with constant genomic rate
+ double divide_slip_prob; // Max one per divide
double divide_uniform_prob;
double parent_mut_prob;
- double death_prob;
};
sDivideMuts divide;
@@ -85,6 +84,11 @@
double standard_dev; // Standard dev. on meta muts.
};
sMetaMuts meta;
+
+ struct sUpdateMuts {
+ double death_prob;
+ };
+ sUpdateMuts update;
public:
cMutationRates() { Clear(); }
@@ -127,7 +131,6 @@
bool TestParentMut(cAvidaContext& ctx) const { return ctx.GetRandom().P(divide.parent_mut_prob); }
- bool TestDeath(cAvidaContext& ctx) const { return (divide.death_prob == 0.0) ? false : ctx.GetRandom().P(divide.death_prob); }
double DoMetaCopyMut(cAvidaContext& ctx) {
if (meta.copy_mut_prob == 0.0 || !ctx.GetRandom().P(meta.copy_mut_prob)) return 1.0;
@@ -137,6 +140,8 @@
return change;
}
+ bool TestDeath(cAvidaContext& ctx) const { return (update.death_prob == 0.0) ? false : ctx.GetRandom().P(update.death_prob); }
+
double GetCopyMutProb() const { return copy.mut_prob; }
double GetCopyInsProb() const { return copy.ins_prob; }
@@ -157,7 +162,6 @@
double GetDivideSlipProb() const { return divide.divide_slip_prob; }
double GetParentMutProb() const { return divide.parent_mut_prob; }
- double GetDeathProb() const { return divide.death_prob; }
double GetInjectInsProb() const { return inject.ins_prob; }
double GetInjectDelProb() const { return inject.del_prob; }
@@ -166,6 +170,8 @@
double GetMetaCopyMutProb() const { return meta.copy_mut_prob; }
double GetMetaStandardDev() const { return meta.standard_dev; }
+ double GetDeathProb() const { return update.death_prob; }
+
void SetCopyMutProb(double in_prob) { copy.mut_prob = in_prob; }
void SetCopyInsProb(double in_prob) { copy.ins_prob = in_prob; }
@@ -186,7 +192,6 @@
void SetDivideSlipProb(double in_prob) { divide.divide_del_prob = in_prob; }
void SetParentMutProb(double in_prob) { divide.parent_mut_prob = in_prob; }
- void SetDeathProb(double in_prob) { divide.death_prob = in_prob; }
void SetInjectInsProb(double in_prob) { inject.ins_prob = in_prob; }
void SetInjectDelProb(double in_prob) { inject.del_prob = in_prob; }
@@ -194,6 +199,8 @@
void SetMetaCopyMutProb(double in_prob) { meta.copy_mut_prob = in_prob; }
void SetMetaStandardDev(double in_dev) { meta.standard_dev = in_dev; }
+
+ void SetDeathProb(double in_prob) { update.death_prob = in_prob; }
};
More information about the Avida-cvs
mailing list