Skip to content

Commit

Permalink
Pre-merge clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nnichols committed Jun 23, 2019
1 parent b645f85 commit 1236f5e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 38 deletions.
28 changes: 14 additions & 14 deletions docs/coverage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
</tr></thead>
<tr>
<td><a href="nature/core.clj.html">nature.core</a></td><td class="with-bar"><div class="covered"
style="width:64.21052631578948%;
float:left;"> 61 </div><div class="not-covered"
style="width:35.78947368421053%;
float:left;"> 34 </div></td>
<td class="with-number">64.21 %</td>
style="width:70.0%;
float:left;"> 84 </div><div class="not-covered"
style="width:30.0%;
float:left;"> 36 </div></td>
<td class="with-number">70.00 %</td>
<td class="with-bar"><div class="covered"
style="width:55.0%;
float:left;"> 11 </div><div class="partial"
style="width:5.0%;
float:left;"> 1 </div><div class="not-covered"
style="width:40.0%;
style="width:56.52173913043478%;
float:left;"> 13 </div><div class="partial"
style="width:8.695652173913043%;
float:left;"> 2 </div><div class="not-covered"
style="width:34.78260869565217%;
float:left;"> 8 </div></td>
<td class="with-number">60.00 %</td>
<td class="with-number">48</td><td class="with-number">3</td><td class="with-number">20</td>
<td class="with-number">65.22 %</td>
<td class="with-number">51</td><td class="with-number">3</td><td class="with-number">23</td>
</tr>
<tr>
<td><a href="nature/fitness_functions.clj.html">nature.fitness-functions</a></td><td class="with-bar"><div class="covered"
Expand Down Expand Up @@ -122,9 +122,9 @@
</tr>
<tr><td>Totals:</td>
<td class="with-bar"></td>
<td class="with-number">85.90 %</td>
<td class="with-number">86.09 %</td>
<td class="with-bar"></td>
<td class="with-number">89.88 %</td>
<td class="with-number">90.06 %</td>
</tr>
</table>
</body>
Expand Down
51 changes: 30 additions & 21 deletions docs/coverage/nature/core.clj.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,68 +85,77 @@
<span class="not-tracked" title="0 out of 0 forms covered">
027&nbsp;&nbsp;&nbsp;&nbsp;([allele-set&nbsp;genome-length&nbsp;population-size&nbsp;generations&nbsp;fitness-function&nbsp;binary-operators&nbsp;unary-operators&nbsp;options]&nbsp;;;&nbsp;TODO&nbsp;-&nbsp;Curry&nbsp;the&nbsp;genetic&nbsp;operators&nbsp;one&nbsp;more&nbsp;level,&nbsp;so&nbsp;the&nbsp;fitness-function&nbsp;can&nbsp;be&nbsp;pressed&nbsp;in
</span><br/>
<span class="partial" title="14 out of 16 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:pre&nbsp;[(and&nbsp;(every?&nbsp;coll?&nbsp;[allele-set&nbsp;binary-operators&nbsp;unary-operators])
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(every?&nbsp;int?&nbsp;[genome-length&nbsp;population-size&nbsp;generations])
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(fn?&nbsp;fitness-function))]}
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
028&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[solutions&nbsp;(max&nbsp;1&nbsp;(:solutions&nbsp;options))
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(let&nbsp;[solutions&nbsp;(max&nbsp;1&nbsp;(:solutions&nbsp;options))
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
029&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;carry-over&nbsp;(max&nbsp;1&nbsp;(:carry-over&nbsp;options))
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;carry-over&nbsp;(max&nbsp;1&nbsp;(:carry-over&nbsp;options))
</span><br/>
<span class="covered" title="3 out of 3 forms covered">
030&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitors&nbsp;(:monitors&nbsp;options)]
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;monitors&nbsp;(:monitors&nbsp;options)]
</span><br/>
<span class="covered" title="8 out of 8 forms covered">
031&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(loop&nbsp;[population&nbsp;(io&#x2F;build-population&nbsp;population-size&nbsp;allele-set&nbsp;genome-length&nbsp;fitness-function)
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(loop&nbsp;[population&nbsp;(io&#x2F;build-population&nbsp;population-size&nbsp;allele-set&nbsp;genome-length&nbsp;fitness-function)
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
032&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;current-generation&nbsp;0]
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;current-generation&nbsp;0]
</span><br/>
<span class="partial" title="2 out of 8 forms covered">
033&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when&nbsp;monitors&nbsp;(monitors&#x2F;apply-monitors&nbsp;monitors&nbsp;population&nbsp;current-generation))
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(when&nbsp;monitors&nbsp;(monitors&#x2F;apply-monitors&nbsp;monitors&nbsp;population&nbsp;current-generation))
</span><br/>
<span class="covered" title="5 out of 5 forms covered">
034&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(&gt;=&nbsp;current-generation&nbsp;generations)
037&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if&nbsp;(&gt;=&nbsp;current-generation&nbsp;generations)
</span><br/>
<span class="covered" title="12 out of 12 forms covered">
035&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(take&nbsp;solutions&nbsp;(sort-by&nbsp;:fitness-score&nbsp;#(&gt;&nbsp;%1&nbsp;%2)&nbsp;population))
038&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(take&nbsp;solutions&nbsp;(sort-by&nbsp;:fitness-score&nbsp;#(&gt;&nbsp;%1&nbsp;%2)&nbsp;population))
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(recur&nbsp;(po&#x2F;advance-generation&nbsp;population&nbsp;population-size&nbsp;binary-operators&nbsp;unary-operators&nbsp;{:carry-over&nbsp;carry-over})&nbsp;(inc&nbsp;current-generation)))))))
039&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(recur&nbsp;(po&#x2F;advance-generation&nbsp;population&nbsp;population-size&nbsp;binary-operators&nbsp;unary-operators&nbsp;{:carry-over&nbsp;carry-over})&nbsp;(inc&nbsp;current-generation)))))))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
037&nbsp;&nbsp;
040&nbsp;&nbsp;
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
038&nbsp;&nbsp;(defn&nbsp;-main
041&nbsp;&nbsp;(defn&nbsp;-main
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
039&nbsp;&nbsp;&nbsp;&nbsp;&quot;A&nbsp;very,&nbsp;very&nbsp;simple&nbsp;example&quot;
042&nbsp;&nbsp;&nbsp;&nbsp;&quot;A&nbsp;very,&nbsp;very&nbsp;simple&nbsp;example&quot;
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
040&nbsp;&nbsp;&nbsp;&nbsp;[&amp;&nbsp;args]
043&nbsp;&nbsp;&nbsp;&nbsp;[&amp;&nbsp;args]
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
041&nbsp;&nbsp;&nbsp;&nbsp;(println&nbsp;(evolve&nbsp;pp&#x2F;binary-genome
044&nbsp;&nbsp;&nbsp;&nbsp;(println&nbsp;(evolve&nbsp;pp&#x2F;binary-genome
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
042&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pp&#x2F;default-sequence-length
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pp&#x2F;default-sequence-length
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
043&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pp&#x2F;default-population-size
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pp&#x2F;default-population-size
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
044&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pp&#x2F;default-generation-count
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pp&#x2F;default-generation-count
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
045&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pp&#x2F;sum-alleles
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pp&#x2F;sum-alleles
</span><br/>
<span class="not-covered" title="0 out of 4 forms covered">
046&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[(go&#x2F;crossover&nbsp;pp&#x2F;sum-alleles)]
049&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[(go&#x2F;crossover&nbsp;pp&#x2F;sum-alleles)]
</span><br/>
<span class="not-covered" title="0 out of 7 forms covered">
047&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[(partial&nbsp;go&#x2F;mutation-operator&nbsp;pp&#x2F;sum-alleles&nbsp;pp&#x2F;binary-genome&nbsp;1)]
050&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[(partial&nbsp;go&#x2F;mutation-operator&nbsp;pp&#x2F;sum-alleles&nbsp;pp&#x2F;binary-genome&nbsp;1)]
</span><br/>
<span class="not-covered" title="0 out of 8 forms covered">
048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:solutions&nbsp;1,&nbsp;:carry-over&nbsp;5,&nbsp;:monitors&nbsp;[monitors&#x2F;print-best-solution]})))
051&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{:solutions&nbsp;1,&nbsp;:carry-over&nbsp;5,&nbsp;:monitors&nbsp;[monitors&#x2F;print-best-solution]})))
</span><br/>
</body>
</html>
6 changes: 3 additions & 3 deletions src/nature/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
(evolve allele-set genome-length population-size generations fitness-function binary-operators unary-operators {:solutions 1, :carry-over 1}))

([allele-set genome-length population-size generations fitness-function binary-operators unary-operators options] ;; TODO - Curry the genetic operators one more level, so the fitness-function can be pressed in
{:pre [(and (every? coll? [allele-set binary-operators unary-operators])
(every? int? [genome-length population-size generations])
(fn? fitness-function))]}
{:pre [(and (every? coll? [allele-set binary-operators unary-operators])
(every? int? [genome-length population-size generations])
(fn? fitness-function))]}
(let [solutions (max 1 (:solutions options))
carry-over (max 1 (:carry-over options))
monitors (:monitors options)]
Expand Down

0 comments on commit 1236f5e

Please sign in to comment.