commit
d0657c635d
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,9 +15,11 @@ pom.xml.asc
|
||||
out
|
||||
notes
|
||||
.clj-kondo/
|
||||
.idea/
|
||||
.calva/
|
||||
.lsp/
|
||||
/.idea
|
||||
/.idea/
|
||||
/results
|
||||
|
||||
# Don't commit the data directory that we'll
|
||||
# use to hold the data from
|
||||
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -7,7 +7,7 @@
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_13" project-jdk-name="13" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_13" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -105,9 +105,11 @@
|
||||
(defn uniform-deletion
|
||||
"Randomly deletes instructions from plushy at some rate."
|
||||
[plushy umad-rate]
|
||||
(if (zero? umad-rate)
|
||||
plushy
|
||||
(remove (fn [_] (< (rand)
|
||||
(/ 1 (+ 1 (/ 1 umad-rate)))))
|
||||
plushy))
|
||||
plushy)))
|
||||
|
||||
(defn diploid-uniform-deletion
|
||||
"Randomly deletes instructions from plushy at some rate."
|
||||
@ -155,6 +157,16 @@
|
||||
(uniform-addition (:instructions argmap) (:umad-rate argmap))
|
||||
(uniform-deletion (:umad-rate argmap)))
|
||||
;
|
||||
:rumad
|
||||
(let [parent-genome (:plushy (selection/select-parent pop argmap))
|
||||
after-addition (uniform-addition parent-genome
|
||||
(:instructions argmap)
|
||||
(:umad-rate argmap))
|
||||
effective-addition-rate (/ (- (count after-addition)
|
||||
(count parent-genome))
|
||||
(count parent-genome))]
|
||||
(uniform-deletion after-addition effective-addition-rate))
|
||||
;
|
||||
:uniform-addition
|
||||
(-> (:plushy (selection/select-parent pop argmap))
|
||||
(uniform-addition (:instructions argmap) (:umad-rate argmap)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user