script to generate docs

This commit is contained in:
Ashley Bao 2023-01-25 14:26:53 -05:00
parent 5af2daa5ad
commit 0c5c356084
13 changed files with 32 additions and 454619 deletions

View File

@ -1,4 +1,8 @@
To generate documentation with codox, run "lein codox" on command line to generate first batch of HTMl files. # Generating Documentation for Propeller
Then, run FunctionsToMD to take Push instructions generated by `def-instruction` and spit it out to a Markdown file.
Then, run HTMLFix to fix the ordered lists in `Adding_Genetic_Operators.md`, `Adding_Problem.md`, and To generate documentation with [codox](https://github.com/weavejester/codox), run `GenerateDocs.sh` in the command line.
This will run "lein codox" on the command line to generate first batch of HTMl files.
Then, it runs FunctionsToMD to take Push instructions generated by `def-instruction` and spit it out to a Markdown file.
Then, it runs HTMLFix to fix the ordered lists in `Adding_Genetic_Operators.md`, `Adding_Problem.md`, and
`Adding_Selection_Method.md`. `Adding_Selection_Method.md`.

View File

@ -7,5 +7,7 @@
:mvn/repos {} :mvn/repos {}
:codox {:extra-deps {codox/codox {:mvn/version "0.10.8"}} :codox {:extra-deps {codox/codox {:mvn/version "0.10.8"}}
:exec-fn codox.main/generate-docs :exec-fn codox.main/generate-docs
:exec-args {:source-paths ["path/to/src"]} :exec-args {:doc-paths ["src/docs_src"]
:output-path "docs"
:metadata {:doc "FIXME: write docs" :doc/format :markdown}}
}} }}

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,7 @@
<li>Define the possible Push instructions to be used to create plushys. It should be a non-lazy list of instructions from <code>push/instructions</code></li> <li>Define the possible Push instructions to be used to create plushys. It should be a non-lazy list of instructions from <code>push/instructions</code></li>
<li>Define an error function that will evaluate plushys and add <code>:behaviors parsed-outputs</code>, <code>:errors</code>, and <code>:total-error</code> to the individual</li> <li>Define an error function that will evaluate plushys and add <code>:behaviors parsed-outputs</code>, <code>:errors</code>, and <code>:total-error</code> to the individual</li>
<li>Define the function <code>-main</code> with a map of default arguments.</li> <li>Define the function <code>-main</code> with a map of default arguments.</li>
</ol>
<h2><a href="#example-of-a-problem" id="example-of-a-problem"></a>Example of a Problem</h2> <h2><a href="#example-of-a-problem" id="example-of-a-problem"></a>Example of a Problem</h2>
<pre><code class="language-clojure">(ns propeller.problems.PSB2.solve-boolean <pre><code class="language-clojure">(ns propeller.problems.PSB2.solve-boolean
(:require [psb2.core :as psb2] (:require [psb2.core :as psb2]

View File

@ -14,4 +14,5 @@
<pre><code>lein run -m propeller.problems.simple-regression :parent-selection :new-selection-method" <pre><code>lein run -m propeller.problems.simple-regression :parent-selection :new-selection-method"
</code></pre> </code></pre>
</li> </li>
</ol>
</div></div></div></body></html> </div></div></div></body></html>

View File

@ -25,7 +25,7 @@
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="propeller.problems.software.number-io.html#var--main">-main</a> </li><li> <a href="propeller.problems.software.number-io.html#var-error-function">error-function</a> </li><li> <a href="propeller.problems.software.number-io.html#var-instructions">instructions</a> </li><li> <a href="propeller.problems.software.number-io.html#var-random-float">random-float</a> </li><li> <a href="propeller.problems.software.number-io.html#var-random-int">random-int</a> </li><li> <a href="propeller.problems.software.number-io.html#var-train-and-test-data">train-and-test-data</a> </li></ul></div></div><div class="namespace"><h3><a href="propeller.problems.software.smallest.html">propeller.problems.software.smallest</a></h3><div class="doc"><div class="markdown"><p>SMALLEST PROBLEM from C. Le Goues et al., "The ManyBugs and IntroClass Benchmarks</p> </div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="propeller.problems.software.number-io.html#var--main">-main</a> </li><li> <a href="propeller.problems.software.number-io.html#var-error-function">error-function</a> </li><li> <a href="propeller.problems.software.number-io.html#var-instructions">instructions</a> </li><li> <a href="propeller.problems.software.number-io.html#var-random-float">random-float</a> </li><li> <a href="propeller.problems.software.number-io.html#var-random-int">random-int</a> </li><li> <a href="propeller.problems.software.number-io.html#var-train-and-test-data">train-and-test-data</a> </li></ul></div></div><div class="namespace"><h3><a href="propeller.problems.software.smallest.html">propeller.problems.software.smallest</a></h3><div class="doc"><div class="markdown"><p>SMALLEST PROBLEM from C. Le Goues et al., "The ManyBugs and IntroClass Benchmarks</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="propeller.problems.software.smallest.html#var--main">-main</a> </li><li> <a href="propeller.problems.software.smallest.html#var-error-function">error-function</a> </li><li> <a href="propeller.problems.software.smallest.html#var-instructions">instructions</a> </li><li> <a href="propeller.problems.software.smallest.html#var-random-int">random-int</a> </li><li> <a href="propeller.problems.software.smallest.html#var-train-and-test-data">train-and-test-data</a> </li></ul></div></div><div class="namespace"><h3><a href="propeller.problems.string-classification.html">propeller.problems.string-classification</a></h3><div class="doc"><div class="markdown"><p>String Classification:</p> </div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="propeller.problems.software.smallest.html#var--main">-main</a> </li><li> <a href="propeller.problems.software.smallest.html#var-error-function">error-function</a> </li><li> <a href="propeller.problems.software.smallest.html#var-instructions">instructions</a> </li><li> <a href="propeller.problems.software.smallest.html#var-random-int">random-int</a> </li><li> <a href="propeller.problems.software.smallest.html#var-train-and-test-data">train-and-test-data</a> </li></ul></div></div><div class="namespace"><h3><a href="propeller.problems.string-classification.html">propeller.problems.string-classification</a></h3><div class="doc"><div class="markdown"><p>String Classification:</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="propeller.problems.string-classification.html#var--main">-main</a> </li><li> <a href="propeller.problems.string-classification.html#var-error-function">error-function</a> </li><li> <a href="propeller.problems.string-classification.html#var-instructions">instructions</a> </li><li> <a href="propeller.problems.string-classification.html#var-train-and-test-data">train-and-test-data</a> </li></ul></div></div><div class="namespace"><h3><a href="propeller.problems.valiant.html">propeller.problems.valiant</a></h3><div class="doc"><div class="markdown"><p>Possibly impossible to solve with genetic programming. Stems from the work of Leslie Valiant and involves determining the parity of an unknown subsequence of a larger sequence of bits.</p> </div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="propeller.problems.string-classification.html#var--main">-main</a> </li><li> <a href="propeller.problems.string-classification.html#var-error-function">error-function</a> </li><li> <a href="propeller.problems.string-classification.html#var-instructions">instructions</a> </li><li> <a href="propeller.problems.string-classification.html#var-train-and-test-data">train-and-test-data</a> </li></ul></div></div><div class="namespace"><h3><a href="propeller.problems.valiant.html">propeller.problems.valiant</a></h3><div class="doc"><div class="markdown"><p>Possibly impossible to solve with genetic programming. Stems from the work of Leslie Valiant and involves determining the parity of an unknown subsequence of a larger sequence of bits.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="propeller.problems.valiant.html#var--main">-main</a> </li><li> <a href="propeller.problems.valiant.html#var-error-function">error-function</a> </li><li> <a href="propeller.problems.valiant.html#var-instructions">instructions</a> </li><li> <a href="propeller.problems.valiant.html#var-num-inputs">num-inputs</a> </li><li> <a href="propeller.problems.valiant.html#var-num-test">num-test</a> </li><li> <a href="propeller.problems.valiant.html#var-num-train">num-train</a> </li><li> <a href="propeller.problems.valiant.html#var-num-vars">num-vars</a> </li><li> <a href="propeller.problems.valiant.html#var-train-and-test-data">train-and-test-data</a> </li></ul></div></div><div class="namespace"><h3><a href="propeller.push.instructions.html">propeller.push.instructions</a></h3><div class="doc"><div class="markdown"><p>Push Instructions</p> </div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="propeller.problems.valiant.html#var--main">-main</a> </li><li> <a href="propeller.problems.valiant.html#var-error-function">error-function</a> </li><li> <a href="propeller.problems.valiant.html#var-instructions">instructions</a> </li><li> <a href="propeller.problems.valiant.html#var-train-and-test-data">train-and-test-data</a> </li></ul></div></div><div class="namespace"><h3><a href="propeller.push.instructions.html">propeller.push.instructions</a></h3><div class="doc"><div class="markdown"><p>Push Instructions</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="propeller.push.instructions.html#var-def-instruction">def-instruction</a> </li><li> <a href="propeller.push.instructions.html#var-generate-instructions">generate-instructions</a> </li><li> <a href="propeller.push.instructions.html#var-get-literal-type">get-literal-type</a> </li><li> <a href="propeller.push.instructions.html#var-get-stack-instructions">get-stack-instructions</a> </li><li> <a href="propeller.push.instructions.html#var-get-vector-literal-type">get-vector-literal-type</a> </li><li> <a href="propeller.push.instructions.html#var-instruction-table">instruction-table</a> </li><li> <a href="propeller.push.instructions.html#var-make-instruction">make-instruction</a> </li><li> <a href="propeller.push.instructions.html#var-make-metadata">make-metadata</a> </li><li> <a href="propeller.push.instructions.html#var-opens">opens</a> </li></ul></div></div><div class="namespace"><h3><a href="propeller.push.instructions.bool.html">propeller.push.instructions.bool</a></h3><div class="doc"><div class="markdown"><p>BOOLEAN Instructions, created with <code>propeller.push.instructions/def-instruction</code>. List of instructions can be found at <a href="Additional_Instructions.html">Additional Instructions</a>.</p> </div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="propeller.push.instructions.html#var-def-instruction">def-instruction</a> </li><li> <a href="propeller.push.instructions.html#var-generate-instructions">generate-instructions</a> </li><li> <a href="propeller.push.instructions.html#var-get-literal-type">get-literal-type</a> </li><li> <a href="propeller.push.instructions.html#var-get-stack-instructions">get-stack-instructions</a> </li><li> <a href="propeller.push.instructions.html#var-get-vector-literal-type">get-vector-literal-type</a> </li><li> <a href="propeller.push.instructions.html#var-instruction-table">instruction-table</a> </li><li> <a href="propeller.push.instructions.html#var-make-instruction">make-instruction</a> </li><li> <a href="propeller.push.instructions.html#var-make-metadata">make-metadata</a> </li><li> <a href="propeller.push.instructions.html#var-opens">opens</a> </li></ul></div></div><div class="namespace"><h3><a href="propeller.push.instructions.bool.html">propeller.push.instructions.bool</a></h3><div class="doc"><div class="markdown"><p>BOOLEAN Instructions, created with <code>propeller.push.instructions/def-instruction</code>. List of instructions can be found at <a href="Additional_Instructions.html">Additional Instructions</a>.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul></ul></div></div><div class="namespace"><h3><a href="propeller.push.instructions.character.html">propeller.push.instructions.character</a></h3><div class="doc"><div class="markdown"><p>CHAR Instructions, created with <code>propeller.push.instructions/def-instruction</code>. List of instructions can be found at <a href="Additional_Instructions.html">Additional Instructions</a>.</p> </div></div><div class="index"><p>Public variables and functions:</p><ul></ul></div></div><div class="namespace"><h3><a href="propeller.push.instructions.character.html">propeller.push.instructions.character</a></h3><div class="doc"><div class="markdown"><p>CHAR Instructions, created with <code>propeller.push.instructions/def-instruction</code>. List of instructions can be found at <a href="Additional_Instructions.html">Additional Instructions</a>.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul></ul></div></div><div class="namespace"><h3><a href="propeller.push.instructions.code.html">propeller.push.instructions.code</a></h3><div class="doc"><div class="markdown"><p>CODE Instructions, created with <code>propeller.push.instructions/def-instruction</code>. List of instructions can be found at <a href="Additional_Instructions.html">Additional Instructions</a>.</p> </div></div><div class="index"><p>Public variables and functions:</p><ul></ul></div></div><div class="namespace"><h3><a href="propeller.push.instructions.code.html">propeller.push.instructions.code</a></h3><div class="doc"><div class="markdown"><p>CODE Instructions, created with <code>propeller.push.instructions/def-instruction</code>. List of instructions can be found at <a href="Additional_Instructions.html">Additional Instructions</a>.</p>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5
scripts/GenerateDocs.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
lein codox
python3 FunctionsToMD.py
python3 HTMLFix.py

View File

@ -8,10 +8,10 @@
[propeller.gp :as gp] [propeller.gp :as gp]
#?(:cljs [cljs.reader :refer [read-string]]))) #?(:cljs [cljs.reader :refer [read-string]])))
(def num-vars 100) ;10) ;100) ;1000) (def ^:no-doc num-vars 100) ;10) ;100) ;1000)
(def num-inputs 50) ;5) ; 50) ;500) (def ^:no-doc num-inputs 50) ;5) ; 50) ;500)
(def num-train 500) ;5000) (def ^:no-doc num-train 500) ;5000)
(def num-test 200) (def ^:no-doc num-test 200)
(def train-and-test-data (def train-and-test-data
"Inputs are `num-train` random boolean values and outputs are the "Inputs are `num-train` random boolean values and outputs are the

View File

@ -167,6 +167,7 @@ Otherwise, acts as a NOOP"
;; Pushes the decrement (i.e. -1) of the top item of the stack ;; Pushes the decrement (i.e. -1) of the top item of the stack
(def _dec (def _dec
"Pushes the decrement (i.e. -1) of the top item of the stack"
^{:stacks #{} ^{:stacks #{}
:name "_dec"} :name "_dec"}
(fn [stack state] (fn [stack state]

View File

@ -39,7 +39,7 @@
:vector_integer #(mapv (fn [i] (int (l/limit-number i))) (l/limit-vector %)) :vector_integer #(mapv (fn [i] (int (l/limit-number i))) (l/limit-vector %))
:vector_string #(mapv (fn [s] (l/limit-string s)) (l/limit-vector %))}) :vector_string #(mapv (fn [s] (l/limit-string s)) (l/limit-vector %))})
(def example-state {:exec '() (def example-state "Example of a Push state." {:exec '()
:integer '(1 2 3 4 5 6 7) :integer '(1 2 3 4 5 6 7)
:string '("abc") :string '("abc")
:input {:in1 4}}) :input {:in1 4}})