Commit a155db76 authored by Carlos GO's avatar Carlos GO
Browse files

adaptive mut rate

parent e5284691
......@@ -162,7 +162,7 @@ def mutate(rna, mutation_rate):
#if adaptive mutation rate, mutation rate is a function of stability.
if mutation_rate == -1:
sig = lambda e: 1 / (1 + np.exp(-e))
sig = lambda e: 1 / (1 + np.exp(-e/10))
mutation_rate = sig(rna.energy)
pass
......@@ -323,4 +323,5 @@ def start(generations=20, size=10, length=50, fit='energy', gc=0.5,\
evolve(next(todo))
if __name__ == "__main__":
start(mutation_rate=-1, dest="maternal_adaptive.csv")
start(mutation_rate=-1,verbose=True, generations=1000, size=1000, runs=20,\
dest="maternal_50_a10.csv")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment