Mainly documentation

This commit is contained in:
Simon Brooke 2024-05-04 11:45:54 +01:00
parent e8c645188a
commit 86358bacab
16 changed files with 956 additions and 11 deletions

View file

@ -2,6 +2,8 @@
A clojure library (OK, at this moment it's an app, but that's during development only) to generate character models for games, such that characters who are represented as related to one another will have systematically similar appearance, as creatures of natural species (including humans) do. This is specifically **NOT** simulating genetics on any deep or quasi-scientific level, just experimenting to see how adequate a solution can be achieved with simple code and limited data. A clojure library (OK, at this moment it's an app, but that's during development only) to generate character models for games, such that characters who are represented as related to one another will have systematically similar appearance, as creatures of natural species (including humans) do. This is specifically **NOT** simulating genetics on any deep or quasi-scientific level, just experimenting to see how adequate a solution can be achieved with simple code and limited data.
Part of [The Great Game](https://simon-brooke.github.io/the-great-game/codox/index.html) project.
## Status ## Status
Very pre-alpha. Very pre-alpha.

View file

@ -1,3 +1,103 @@
# Introduction to simulated-genetics # Introduction to simulated-genetics
TODO: write [great documentation](http://jacobian.org/writing/what-to-write/) # simulated-genetics
A clojure library (OK, at this moment it's an app, but that's during development only) to generate character models for games, such that characters who are represented as related to one another will have systematically similar appearance, as creatures of natural species (including humans) do. This is specifically **NOT** simulating genetics on any deep or quasi-scientific level, just experimenting to see how adequate a solution can be achieved with simple code and limited data.
Part of [The Great Game](https://simon-brooke.github.io/the-great-game/codox/index.html) project.
## Status
Very pre-alpha.
## Concept
If we're going to have a world with a multi-generational population of hundreds of thousands of procedurally generated characters, and we're to persuasively represent each character as being related to others, then we have to have a mechanism for making children look reasonably like their parents, to have family resemblances among cousins, and so on. We need to do this at reasonably low data storage and algorithmic cost, firstly because we have to store all these characters, and secondly because (especially when the player approaches an urban centre), we may need to instantiate models for a lot of them in limited time.
This note discusses how this might be done.
### The pseudo-genome
Suppose we have a binary vector of memory, such that when a 'child' was born to two parents, bits were taken at random from the parents' chromosomes to populate the child's genome -- which is sort of, very roughly, what happens in actual biology -- how big would that genome have to be? After all, the full data size of the human genetic code is enormous. But actually, we don't need to simulate anything like so large. After all, all our genome needs to encode is morphology, and only sufficiently to enable the player to recognise and distinguish characters.
My hunch is that a 64 bit genome is more than sufficient, if we code it carefully. So here's how such a genome might be structured:
| Field | Bits | Interpretation |
| -------------------- | ---- | ------------------------------------------------------------ |
| Ethnic type | 4 | Ethnic type. Most significant bits both indicate dark skin, with [??11] indicating dark skin/curly hair and [??01] indicating dark skin/straight hair |
| Skin tone | 3 | Plus most significant bit from ethnic type (i.e. [???1]) as most significant bit. This means sixteen distinct tones, with the darkest tone of 'pale skinned' ethnicities just very slightly lighter than the palest tone of 'dark skinned' ethnicities. |
| Freckles? | 2 | [11] means freckles, any other value means no freckles. Freckles won't be visible on very dark skin. |
| Hair colour | 3 | Plus most significant bit from ethnic type (i.e. [???1]) as most significant bit. Least significant bit does not contribute to tone but indicates red tint. Thus eight distinct degrees of darkness from pale blond to black, plus red tint which can affect any degree of darkness. |
| Eye colour | 2 | Plus most significant bit from ethnic type (i.e. [???1]) as most significant bit. Thus eight values: [000] blue; [001] hazel; [010]...[111] shades of brown lighter->darker. |
| Height | 3 | Height when adult; children will have a scaled proportion of their adult height, and the same height value in the genome will result in female body models 95% the height of an equivalent male body model. So [000] codes for 150mm, [111] codes for 200mm, with eight distinct values |
| Gracility/Robustness | 3 | Slenderness to stockiness of skeleton/armature build, with [000] being very slender and [111] being very broad/heavy. |
| Age-related change | 3 | People get white haired at different ages; some men go bald and some do not. The sons of the daughter of a bald man should have a chance of inheriting age-related baldness, although their mother won't express that gene. So I'm allowing here for eight different profiles for age related change, although I'm not yet clear what the exact values would mean. |
That's twenty-nine of our sixty-four bits, leaving plenty for face models, gender and so on.
### What's not included in the genome
Things which are cultural are not included in the genome; things which are lifestyle related are not included in the genome. So, for example, gracility/robustness, is not the same as skinniness/fatness, which are mostly lifestyle/diet related rather than genetic. There are some occupations (e.g., blacksmith) where you'd be unlikely to be fat (but might be very robust). Also, the same character might grow fatter (or thinner) over time.
Similarly, hairstyle and beard-wearing are cultural (and occupational) rather than genetic, and closely related to choice of clothing. So while we do need to represent these things, they're not things which should be represented in the genome.
Injury-related change -- which would especially affect soldiers and outlaws especially but could affect any character -- also needs to be encoded somehow (and may cause real problems), but this is also not a problem for the genome.
### What additionally might be included in the pseudo-genome
There is a variable I'm proposing for non-player characters that I'm calling `disposition`, which has a range of values between -5 (surly) and +5 (sunny), which stands in for the general friendliness of the character towards random strangers, their generosity, their optimism, their degree of compassion, and so on. I don't personally believe these things are genetic -- I believe they're nurture, not nature -- but I believe that they are nevertheless inherited through families to some extent.
If we made a character's setting for `disposition` a function of their parents' dispositions, then that would need to be an entirely unrelated value from the physical appearance values, because otherwise you would end up having some racial appearances being friendlier and more optimistic than others, which would lead to accusations of racism and other bad things. This is simulated genetics, not simulated phrenology!
I mean, you may be planning the sort of game in which there are races like orcs or kobolds or whatever which are systematically less friendly and generous than characters of other races, in which case you might want to fork this library and change this decision, but if so:
a. that's on you; and
b. I politely suggest that you might want to examine your own attitudes.
### Making this all work
**NOTE:** At this stage none of this works.
#### The Python ecosystem
[MakeHuman](http://www.makehumancommunity.org/) exposes an [API](https://github.com/makehumancommunity/community-plugins-mhapi/blob/master/docs/MHAPI.md) which allows at least many of the morphological changes required by the pseudo-genome to be applied to a human model.
There's a well regarded library, [libpython-clj](https://www.futurile.net/2020/02/20/python-from-clojure-with-libpython-clj/), which allows calling of Python code from Clojure code. So in theory it should be possible to make this work.
If not, there are other human-model-morphing libraries out there, e.g. [ManuelBastioniLab](https://mb-lab-community.github.io/MB-Lab.github.io/), but they're mainly also in Python. In the worst case, the heavy lifting is in the data, and it might be possible to rewrite the code thatmorphs the data into Clojure. However, development of ManuelBastioniLAB [ceased in 2018](https://www.cgchannel.com/2018/11/manuel-bastioni-to-discontinue-manuel-bastioni-lab/), and although there are forks available on GitHub and elsewhere, none of them seem to be active.
#### Maud
While things in the Python ecosystem are very polished, getting them to play nicely with Clojure/Java is non-trivial. There's a less-polished but apparently-functional character editor built using jMonkeyEngine frameworks called [Maud](https://github.com/stephengold/Maud). This might be an easier fit.
## Installation
You can't, it doesn't (yet) work.
## Usage
FIXME: explanation
$ java -jar simulated-genetics-0.1.0-standalone.jar [args]
## Options
FIXME: listing of options this app accepts.
## Examples
...
### Bugs
...
### Any Other Sections
### That You Think
### Might be Useful
## License
Copyright © 2024 Simon Brooke
This Source Code is made available under the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.

View file

@ -0,0 +1,12 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>cc.journeyman.simulated-genetics.genome documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch current"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="cc.journeyman.simulated-genetics.genome.html#var-create-genome"><div class="inner"><span>create-genome</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.genome.html#var-ethnically-biased-feature-index"><div class="inner"><span>ethnically-biased-feature-index</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.genome.html#var-expand-genome"><div class="inner"><span>expand-genome</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.genome.html#var-extract-bits"><div class="inner"><span>extract-bits</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.genome.html#var-gender-bit"><div class="inner"><span>gender-bit</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.genome.html#var-genome-mask"><div class="inner"><span>genome-mask</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.genome.html#var-male.3F"><div class="inner"><span>male?</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.genome.html#var-rand-genome"><div class="inner"><span>rand-genome</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">cc.journeyman.simulated-genetics.genome</h1><div class="doc"><div class="markdown"><p>lightweight simulation of a genome.</p>
</div></div><div class="public anchor" id="var-create-genome"><h3>create-genome</h3><div class="usage"><code>(create-genome)</code><code>(create-genome father mother)</code></div><div class="doc"><div class="markdown"><p>Create a new genome; if <code>father</code> and <code>mother</code> are passed, the result will comprise bits taken randomly from those genomes.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/genome.clj#L43">view source</a></div></div><div class="public anchor" id="var-ethnically-biased-feature-index"><h3>ethnically-biased-feature-index</h3><h4 class="type">macro</h4><div class="usage"><code>(ethnically-biased-feature-index genome start end)</code></div><div class="doc"><div class="markdown"><p>Some feature values are associated with particular ethnicities.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/genome.clj#L67">view source</a></div></div><div class="public anchor" id="var-expand-genome"><h3>expand-genome</h3><div class="usage"><code>(expand-genome genome)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/genome.clj#L80">view source</a></div></div><div class="public anchor" id="var-extract-bits"><h3>extract-bits</h3><div class="usage"><code>(extract-bits g start end)</code></div><div class="doc"><div class="markdown"><p>Extract, as an integer left-shifted by <code>start</code>, those bits from <code>g</code> indexed from <code>start</code> (inclusive) to <code>end</code> (exclusive).</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/genome.clj#L60">view source</a></div></div><div class="public anchor" id="var-gender-bit"><h3>gender-bit</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>The bit that encodes for gender</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/genome.clj#L34">view source</a></div></div><div class="public anchor" id="var-genome-mask"><h3>genome-mask</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>A mask which selects just the bits were interested in from a long.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/genome.clj#L30">view source</a></div></div><div class="public anchor" id="var-male.3F"><h3>male?</h3><div class="usage"><code>(male? genome)</code></div><div class="doc"><div class="markdown"><p><code>true</code> if this genome is male.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/genome.clj#L75">view source</a></div></div><div class="public anchor" id="var-rand-genome"><h3>rand-genome</h3><h4 class="type">macro</h4><div class="usage"><code>(rand-genome)</code></div><div class="doc"><div class="markdown"><p>Create a random genome.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/genome.clj#L38">view source</a></div></div></div></body></html>

View file

@ -0,0 +1,8 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>cc.journeyman.simulated-genetics.launcher documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch current"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="cc.journeyman.simulated-genetics.launcher.html#var--main"><div class="inner"><span>-main</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.launcher.html#var-app"><div class="inner"><span>app</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.launcher.html#var-cli-options"><div class="inner"><span>cli-options</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.launcher.html#var-init"><div class="inner"><span>init</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">cc.journeyman.simulated-genetics.launcher</h1><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Start an app into which generated characters can ultimately be rendered.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/launcher.clj#L83">view source</a></div></div><div class="public anchor" id="var-app"><h3>app</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/launcher.clj#L81">view source</a></div></div><div class="public anchor" id="var-cli-options"><h3>cli-options</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>I havent yet thought out what command line arguments (if any) I need. This is a placeholder.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/launcher.clj#L37">view source</a></div></div><div class="public anchor" id="var-init"><h3>init</h3><div class="usage"><code>(init)</code></div><div class="doc"><div class="markdown"><p>Again, placeholder. This initialises a bit of standard jMonkeyEngine terrain, just to check I have things wired up correctly.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/launcher.clj#L46">view source</a></div></div></div></body></html>

View file

@ -0,0 +1,6 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>cc.journeyman.simulated-genetics.makehuman-bridge documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch current"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html#var-initialise-makehuman.21"><div class="inner"><span>initialise-makehuman!</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">cc.journeyman.simulated-genetics.makehuman-bridge</h1><div class="doc"><div class="markdown"><p>Bridge to MakeHuman, in an attempt to use it to generate character models.</p>
<p><strong>NOTE</strong>: Currently not under active development. Ive failed to get this to work, but, even if I succeeded, it would be a very complex and fragile solution.</p>
</div></div><div class="public anchor" id="var-initialise-makehuman.21"><h3>initialise-makehuman!</h3><div class="usage"><code>(initialise-makehuman! mh-path)</code></div><div class="doc"><div class="markdown"><p>Initialise the local instance of MakeHuman. <code>mh-path</code> should be a valid path to the directory in which MakeHuman is installed, i.e. the directory which contains <code>makehuman.py</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/makehuman_bridge.clj#L46">view source</a></div></div></div></body></html>

View file

@ -0,0 +1,8 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>cc.journeyman.simulated-genetics.utils documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4 current"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="cc.journeyman.simulated-genetics.utils.html#var-bits-in-genome"><div class="inner"><span>bits-in-genome</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.utils.html#var-create-binary-string-mask"><div class="inner"><span>create-binary-string-mask</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.utils.html#var-create-mask"><div class="inner"><span>create-mask</span></div></a></li><li class="depth-1"><a href="cc.journeyman.simulated-genetics.utils.html#var-long-from-binary-string"><div class="inner"><span>long-from-binary-string</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">cc.journeyman.simulated-genetics.utils</h1><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="public anchor" id="var-bits-in-genome"><h3>bits-in-genome</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Number of bits were actually using. <strong>NOTE THAT</strong> as this implementation is based on Java longs, this number must not be more than 63 or else weve <em>a lot</em> of rewriting to do.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/utils.clj#L28">view source</a></div></div><div class="public anchor" id="var-create-binary-string-mask"><h3>create-binary-string-mask</h3><div class="usage"><code>(create-binary-string-mask start end)</code></div><div class="doc"><div class="markdown"><p>Mainly for testing, create a binary string mask with those bits indexed from <code>start</code> (inclusive) to <code>end</code> (exclusive) set, and all others cleared.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/utils.clj#L43">view source</a></div></div><div class="public anchor" id="var-create-mask"><h3>create-mask</h3><div class="usage"><code>(create-mask start end)</code></div><div class="doc"><div class="markdown"><p>Create a with those bits indexed from <code>start</code> (inclusive) to <code>end</code> (exclusive) set, and all others cleared.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/utils.clj#L53">view source</a></div></div><div class="public anchor" id="var-long-from-binary-string"><h3>long-from-binary-string</h3><div class="usage"><code>(long-from-binary-string s)</code></div><div class="doc"><div class="markdown"><p>Mainly for testing, create a long from this binary string. The string is expected to comprise zeros and ones, only.</p>
</div></div><div class="src-link"><a href="https://github.com/simon-brooke/the-great-game/blob/master/src/cc/journeyman/simulated_genetics/utils.clj#L35">view source</a></div></div></div></body></html>

551
docs/codox/css/default.css Normal file
View file

@ -0,0 +1,551 @@
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 15px;
}
pre, code {
font-family: Monaco, DejaVu Sans Mono, Consolas, monospace;
font-size: 9pt;
margin: 15px 0;
}
h1 {
font-weight: normal;
font-size: 29px;
margin: 10px 0 2px 0;
padding: 0;
}
h2 {
font-weight: normal;
font-size: 25px;
}
h5.license {
margin: 9px 0 22px 0;
color: #555;
font-weight: normal;
font-size: 12px;
font-style: italic;
}
.document h1, .namespace-index h1 {
font-size: 32px;
margin-top: 12px;
}
#header, #content, .sidebar {
position: fixed;
}
#header {
top: 0;
left: 0;
right: 0;
height: 22px;
color: #f5f5f5;
padding: 5px 7px;
}
#content {
top: 32px;
right: 0;
bottom: 0;
overflow: auto;
background: #fff;
color: #333;
padding: 0 18px;
}
.sidebar {
position: fixed;
top: 32px;
bottom: 0;
overflow: auto;
}
.sidebar.primary {
background: #e2e2e2;
border-right: solid 1px #cccccc;
left: 0;
width: 250px;
}
.sidebar.secondary {
background: #f2f2f2;
border-right: solid 1px #d7d7d7;
left: 251px;
width: 200px;
}
#content.namespace-index, #content.document {
left: 251px;
}
#content.namespace-docs {
left: 452px;
}
#content.document {
padding-bottom: 10%;
}
#header {
background: #3f3f3f;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
z-index: 100;
}
#header h1 {
margin: 0;
padding: 0;
font-size: 18px;
font-weight: lighter;
text-shadow: -1px -1px 0px #333;
}
#header h1 .project-version {
font-weight: normal;
}
.project-version {
padding-left: 0.15em;
}
#header a, .sidebar a {
display: block;
text-decoration: none;
}
#header a {
color: #f5f5f5;
}
.sidebar a {
color: #333;
}
#header h2 {
float: right;
font-size: 9pt;
font-weight: normal;
margin: 4px 3px;
padding: 0;
color: #bbb;
}
#header h2 a {
display: inline;
}
.sidebar h3 {
margin: 0;
padding: 10px 13px 0 13px;
font-size: 19px;
font-weight: lighter;
}
.sidebar h3 a {
color: #444;
}
.sidebar h3.no-link {
color: #636363;
}
.sidebar ul {
padding: 7px 0 6px 0;
margin: 0;
}
.sidebar ul.index-link {
padding-bottom: 4px;
}
.sidebar li {
display: block;
vertical-align: middle;
}
.sidebar li a, .sidebar li .no-link {
border-left: 3px solid transparent;
padding: 0 10px;
white-space: nowrap;
}
.sidebar li .no-link {
display: block;
color: #777;
font-style: italic;
}
.sidebar li .inner {
display: inline-block;
padding-top: 7px;
height: 24px;
}
.sidebar li a, .sidebar li .tree {
height: 31px;
}
.depth-1 .inner { padding-left: 2px; }
.depth-2 .inner { padding-left: 6px; }
.depth-3 .inner { padding-left: 20px; }
.depth-4 .inner { padding-left: 34px; }
.depth-5 .inner { padding-left: 48px; }
.depth-6 .inner { padding-left: 62px; }
.sidebar li .tree {
display: block;
float: left;
position: relative;
top: -10px;
margin: 0 4px 0 0;
padding: 0;
}
.sidebar li.depth-1 .tree {
display: none;
}
.sidebar li .tree .top, .sidebar li .tree .bottom {
display: block;
margin: 0;
padding: 0;
width: 7px;
}
.sidebar li .tree .top {
border-left: 1px solid #aaa;
border-bottom: 1px solid #aaa;
height: 19px;
}
.sidebar li .tree .bottom {
height: 22px;
}
.sidebar li.branch .tree .bottom {
border-left: 1px solid #aaa;
}
.sidebar.primary li.current a {
border-left: 3px solid #a33;
color: #a33;
}
.sidebar.secondary li.current a {
border-left: 3px solid #33a;
color: #33a;
}
.namespace-index h2 {
margin: 30px 0 0 0;
}
.namespace-index h3 {
font-size: 16px;
font-weight: bold;
margin-bottom: 0;
}
.namespace-index .topics {
padding-left: 30px;
margin: 11px 0 0 0;
}
.namespace-index .topics li {
padding: 5px 0;
}
.namespace-docs h3 {
font-size: 18px;
font-weight: bold;
}
.public h3 {
margin: 0;
float: left;
}
.usage {
clear: both;
}
.public {
margin: 0;
border-top: 1px solid #e0e0e0;
padding-top: 14px;
padding-bottom: 6px;
}
.public:last-child {
margin-bottom: 20%;
}
.members .public:last-child {
margin-bottom: 0;
}
.members {
margin: 15px 0;
}
.members h4 {
color: #555;
font-weight: normal;
font-variant: small-caps;
margin: 0 0 5px 0;
}
.members .inner {
padding-top: 5px;
padding-left: 12px;
margin-top: 2px;
margin-left: 7px;
border-left: 1px solid #bbb;
}
#content .members .inner h3 {
font-size: 12pt;
}
.members .public {
border-top: none;
margin-top: 0;
padding-top: 6px;
padding-bottom: 0;
}
.members .public:first-child {
padding-top: 0;
}
h4.type,
h4.dynamic,
h4.added,
h4.deprecated {
float: left;
margin: 3px 10px 15px 0;
font-size: 15px;
font-weight: bold;
font-variant: small-caps;
}
.public h4.type,
.public h4.dynamic,
.public h4.added,
.public h4.deprecated {
font-size: 13px;
font-weight: bold;
margin: 3px 0 0 10px;
}
.members h4.type,
.members h4.added,
.members h4.deprecated {
margin-top: 1px;
}
h4.type {
color: #717171;
}
h4.dynamic {
color: #9933aa;
}
h4.added {
color: #508820;
}
h4.deprecated {
color: #880000;
}
.namespace {
margin-bottom: 30px;
}
.namespace:last-child {
margin-bottom: 10%;
}
.index {
padding: 0;
font-size: 80%;
margin: 15px 0;
line-height: 16px;
}
.index * {
display: inline;
}
.index p {
padding-right: 3px;
}
.index li {
padding-right: 5px;
}
.index ul {
padding-left: 0;
}
.type-sig {
clear: both;
color: #088;
}
.type-sig pre {
padding-top: 10px;
margin: 0;
}
.usage code {
display: block;
color: #008;
margin: 2px 0;
}
.usage code:first-child {
padding-top: 10px;
}
p {
margin: 15px 0;
}
.public p:first-child, .public pre.plaintext {
margin-top: 12px;
}
.doc {
margin: 0 0 26px 0;
clear: both;
}
.public .doc {
margin: 0;
}
.namespace-index .doc {
margin-bottom: 20px;
}
.namespace-index .namespace .doc {
margin-bottom: 10px;
}
.markdown p, .markdown li, .markdown dt, .markdown dd, .markdown td {
line-height: 22px;
}
.markdown li {
padding: 2px 0;
}
.markdown h2 {
font-weight: normal;
font-size: 25px;
margin: 30px 0 10px 0;
}
.markdown h3 {
font-weight: normal;
font-size: 20px;
margin: 30px 0 0 0;
}
.markdown h4 {
font-size: 15px;
margin: 22px 0 -4px 0;
}
.doc, .public, .namespace .index {
max-width: 680px;
overflow-x: visible;
}
.markdown pre > code {
display: block;
padding: 10px;
}
.markdown pre > code, .src-link a {
border: 1px solid #e4e4e4;
border-radius: 2px;
}
.markdown code:not(.hljs), .src-link a {
background: #f6f6f6;
}
pre.deps {
display: inline-block;
margin: 0 10px;
border: 1px solid #e4e4e4;
border-radius: 2px;
padding: 10px;
background-color: #f6f6f6;
}
.markdown hr {
border-style: solid;
border-top: none;
color: #ccc;
}
.doc ul, .doc ol {
padding-left: 30px;
}
.doc table {
border-collapse: collapse;
margin: 0 10px;
}
.doc table td, .doc table th {
border: 1px solid #dddddd;
padding: 4px 6px;
}
.doc table th {
background: #f2f2f2;
}
.doc dl {
margin: 0 10px 20px 10px;
}
.doc dl dt {
font-weight: bold;
margin: 0;
padding: 3px 0;
border-bottom: 1px solid #ddd;
}
.doc dl dd {
padding: 5px 0;
margin: 0 0 5px 10px;
}
.doc abbr {
border-bottom: 1px dotted #333;
font-variant: none;
cursor: help;
}
.src-link {
margin-bottom: 15px;
}
.src-link a {
font-size: 70%;
padding: 1px 4px;
text-decoration: none;
color: #5555bb;
}

View file

@ -0,0 +1,97 @@
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
}
.hljs-comment,
.hljs-quote {
color: #998;
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
color: #333;
font-weight: bold;
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080;
}
.hljs-string,
.hljs-doctag {
color: #d14;
}
.hljs-title,
.hljs-section,
.hljs-selector-id {
color: #900;
font-weight: bold;
}
.hljs-subst {
font-weight: normal;
}
.hljs-type,
.hljs-class .hljs-title {
color: #458;
font-weight: bold;
}
.hljs-tag,
.hljs-name,
.hljs-attribute {
color: #000080;
font-weight: normal;
}
.hljs-regexp,
.hljs-link {
color: #009926;
}
.hljs-symbol,
.hljs-bullet {
color: #990073;
}
.hljs-built_in,
.hljs-builtin-name {
color: #0086b3;
}
.hljs-meta {
color: #999;
font-weight: bold;
}
.hljs-deletion {
background: #fdd;
}
.hljs-addition {
background: #dfd;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}

7
docs/codox/index.html Normal file
View file

@ -0,0 +1,7 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>Simulated-genetics 0.1.0-SNAPSHOT</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 current"><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="namespace-index" id="content"><h1><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></h1><h5 class="license">Released under the <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html">GNU General Public License,version 2.0 or (at your option) any later version</a></h5><div class="doc"><p>A lightweight simulation of genetics, intended for use in games only.</p></div><h2>Installation</h2><p>To install, add the following dependency to your project or build file:</p><pre class="deps">[simulated-genetics "0.1.0-SNAPSHOT"]</pre><h2>Topics</h2><ul class="topics"><li><a href="intro.html">Introduction to simulated-genetics</a></li></ul><h2>Namespaces</h2><div class="namespace"><h3><a href="cc.journeyman.simulated-genetics.genome.html">cc.journeyman.simulated-genetics.genome</a></h3><div class="doc"><div class="markdown"><p>lightweight simulation of a genome.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-create-genome">create-genome</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-ethnically-biased-feature-index">ethnically-biased-feature-index</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-expand-genome">expand-genome</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-extract-bits">extract-bits</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-gender-bit">gender-bit</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-genome-mask">genome-mask</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-male.3F">male?</a> </li><li> <a href="cc.journeyman.simulated-genetics.genome.html#var-rand-genome">rand-genome</a> </li></ul></div></div><div class="namespace"><h3><a href="cc.journeyman.simulated-genetics.launcher.html">cc.journeyman.simulated-genetics.launcher</a></h3><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="cc.journeyman.simulated-genetics.launcher.html#var--main">-main</a> </li><li> <a href="cc.journeyman.simulated-genetics.launcher.html#var-app">app</a> </li><li> <a href="cc.journeyman.simulated-genetics.launcher.html#var-cli-options">cli-options</a> </li><li> <a href="cc.journeyman.simulated-genetics.launcher.html#var-init">init</a> </li></ul></div></div><div class="namespace"><h3><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html">cc.journeyman.simulated-genetics.makehuman-bridge</a></h3><div class="doc"><div class="markdown"><p>Bridge to MakeHuman, in an attempt to use it to generate character models.</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="cc.journeyman.simulated-genetics.makehuman-bridge.html#var-initialise-makehuman.21">initialise-makehuman!</a> </li></ul></div></div><div class="namespace"><h3><a href="cc.journeyman.simulated-genetics.utils.html">cc.journeyman.simulated-genetics.utils</a></h3><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p>
</div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="cc.journeyman.simulated-genetics.utils.html#var-bits-in-genome">bits-in-genome</a> </li><li> <a href="cc.journeyman.simulated-genetics.utils.html#var-create-binary-string-mask">create-binary-string-mask</a> </li><li> <a href="cc.journeyman.simulated-genetics.utils.html#var-create-mask">create-mask</a> </li><li> <a href="cc.journeyman.simulated-genetics.utils.html#var-long-from-binary-string">long-from-binary-string</a> </li></ul></div></div></div></body></html>

5
docs/codox/intro.html Normal file
View file

@ -0,0 +1,5 @@
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>Introduction to simulated-genetics</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Simulated-genetics</span> <span class="project-version">0.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 current"><a href="intro.html"><div class="inner"><span>Introduction to simulated-genetics</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>simulated-genetics</span></div></div></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.genome.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>genome</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.launcher.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.simulated-genetics.makehuman-bridge.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>makehuman-bridge</span></div></a></li><li class="depth-4"><a href="cc.journeyman.simulated-genetics.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#introduction-to-simulated-genetics" id="introduction-to-simulated-genetics"></a>Introduction to simulated-genetics</h1>
<p>TODO: write <a href="http://jacobian.org/writing/what-to-write/">great documentation</a></p>
</div></div></div></body></html>

2
docs/codox/js/highlight.min.js vendored Normal file

File diff suppressed because one or more lines are too long

4
docs/codox/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,112 @@
function visibleInParent(element) {
var position = $(element).position().top
return position > -50 && position < ($(element).offsetParent().height() - 50)
}
function hasFragment(link, fragment) {
return $(link).attr("href").indexOf("#" + fragment) != -1
}
function findLinkByFragment(elements, fragment) {
return $(elements).filter(function(i, e) { return hasFragment(e, fragment)}).first()
}
function scrollToCurrentVarLink(elements) {
var elements = $(elements);
var parent = elements.offsetParent();
if (elements.length == 0) return;
var top = elements.first().position().top;
var bottom = elements.last().position().top + elements.last().height();
if (top >= 0 && bottom <= parent.height()) return;
if (top < 0) {
parent.scrollTop(parent.scrollTop() + top);
}
else if (bottom > parent.height()) {
parent.scrollTop(parent.scrollTop() + bottom - parent.height());
}
}
function setCurrentVarLink() {
$('.secondary a').parent().removeClass('current')
$('.anchor').
filter(function(index) { return visibleInParent(this) }).
each(function(index, element) {
findLinkByFragment(".secondary a", element.id).
parent().
addClass('current')
});
scrollToCurrentVarLink('.secondary .current');
}
var hasStorage = (function() { try { return localStorage.getItem } catch(e) {} }())
function scrollPositionId(element) {
var directory = window.location.href.replace(/[^\/]+\.html$/, '')
return 'scroll::' + $(element).attr('id') + '::' + directory
}
function storeScrollPosition(element) {
if (!hasStorage) return;
localStorage.setItem(scrollPositionId(element) + "::x", $(element).scrollLeft())
localStorage.setItem(scrollPositionId(element) + "::y", $(element).scrollTop())
}
function recallScrollPosition(element) {
if (!hasStorage) return;
$(element).scrollLeft(localStorage.getItem(scrollPositionId(element) + "::x"))
$(element).scrollTop(localStorage.getItem(scrollPositionId(element) + "::y"))
}
function persistScrollPosition(element) {
recallScrollPosition(element)
$(element).scroll(function() { storeScrollPosition(element) })
}
function sidebarContentWidth(element) {
var widths = $(element).find('.inner').map(function() { return $(this).innerWidth() })
return Math.max.apply(Math, widths)
}
function calculateSize(width, snap, margin, minimum) {
if (width == 0) {
return 0
}
else {
return Math.max(minimum, (Math.ceil(width / snap) * snap) + (margin * 2))
}
}
function resizeSidebars() {
var primaryWidth = sidebarContentWidth('.primary')
var secondaryWidth = 0
if ($('.secondary').length != 0) {
secondaryWidth = sidebarContentWidth('.secondary')
}
// snap to grid
primaryWidth = calculateSize(primaryWidth, 32, 13, 160)
secondaryWidth = calculateSize(secondaryWidth, 32, 13, 160)
$('.primary').css('width', primaryWidth)
$('.secondary').css('width', secondaryWidth).css('left', primaryWidth + 1)
if (secondaryWidth > 0) {
$('#content').css('left', primaryWidth + secondaryWidth + 2)
}
else {
$('#content').css('left', primaryWidth + 1)
}
}
$(window).ready(resizeSidebars)
$(window).ready(setCurrentVarLink)
$(window).ready(function() { persistScrollPosition('.primary')})
$(window).ready(function() {
$('#content').scroll(setCurrentVarLink)
$(window).resize(setCurrentVarLink)
})

14
docs/index.html Normal file
View file

@ -0,0 +1,14 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Simulated Genetics: Documentation</title>
<link rel="stylesheet" type="text/css" href="codox/css/default.css" />
</head>
<body>
<h1>Simulated Genetics: Documentation</h1>
<ul>
<li><a href="codox/index.html">Primary documentaion</a></li>
<li><a href="cloverage/index.html">Test coverage</a></li>
</ul>
</body>
</html>

View file

@ -1,15 +1,28 @@
(defproject simulated-genetics "0.1.0-SNAPSHOT" (defproject simulated-genetics "0.1.0-SNAPSHOT"
:description "A lightweight simulation of genetics, for use in games only." :cloverage {:output "docs/cloverage"
:url "http://example.com/FIXME" :codecov? true
:license {:name "GNU General Public License,version 2.0 or (at your option) any later version" :emma-xml? true}
:url "https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html"} :codox {:froboz.cloverage {:output "docs/cloverage"
:codecov? true
:html? true
:debug? true}
:metadata {:doc "**TODO**: write docs"
:doc/format :markdown}
:output-path "docs/codox"
:source-uri "https://github.com/simon-brooke/the-great-game/blob/master/{filepath}#L{line}"}
:dependencies [[clj-python/libpython-clj "2.025"] :dependencies [[clj-python/libpython-clj "2.025"]
[com.taoensso/telemere "1.0.0-beta3"] ;; Peter Taoussanis' new replacement for Timbre [com.taoensso/telemere "1.0.0-beta3"] ;; Peter Taoussanis' new replacement for Timbre
[jme-clj "0.1.13"] [jme-clj "0.1.13"]
[org.clojure/clojure "1.11.1"] [org.clojure/clojure "1.11.1"]
[org.clojure/tools.cli "1.1.230"] [org.clojure/tools.cli "1.1.230"]
[org.jmonkeyengine/jme3-core "3.6.1-stable"]] [org.jmonkeyengine/jme3-core "3.6.1-stable"]]
:description "A lightweight simulation of genetics, intended for use in games only."
:license {:name "GNU General Public License,version 2.0 or (at your option) any later version"
:url "https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html"}
:main ^:skip-aot cc.journeyman.simulated-genetics.launcher :main ^:skip-aot cc.journeyman.simulated-genetics.launcher
:plugins [[lein-cloverage "1.2.2"]
[lein-codox "0.10.8"]]
:target-path "target/%s" :target-path "target/%s"
:profiles {:uberjar {:aot :all :profiles {:uberjar {:aot :all
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}}) :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}}
:url "http://example.com/FIXME")

View file

@ -1,5 +1,9 @@
(ns cc.journeyman.simulated-genetics.makehuman-bridge (ns cc.journeyman.simulated-genetics.makehuman-bridge
"Bridge to MakeHuman, in an attempt to use it to generate character models." "Bridge to MakeHuman, in an attempt to use it to generate character models.
**NOTE**: Currently not under active development. I've failed to get this
to work, but, even if I succeeded, it would be a very complex and fragile
solution."
(:require [libpython-clj2.require :refer [require-python]] (:require [libpython-clj2.require :refer [require-python]]
[libpython-clj2.python [libpython-clj2.python
:refer [as-python as-jvm :refer [as-python as-jvm
@ -16,7 +20,6 @@
:as py] :as py]
[taoensso.telemere :refer [error! trace!]])) [taoensso.telemere :refer [error! trace!]]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; ;;;;
;;;; Bridge to MakeHuman, in an attempt to use it to generate character models. ;;;; Bridge to MakeHuman, in an attempt to use it to generate character models.
@ -52,4 +55,5 @@
(format "exec(open('%s/makehuman.py').read())" mh-path) (format "exec(open('%s/makehuman.py').read())" mh-path)
"from lib.core import G" "from lib.core import G"
"G.app.mhapi.internals.getHuman()" "G.app.mhapi.internals.getHuman()"
;; fails here with "AttributeError: 'NoneType' object has no attribute 'mhapi'"
])) ]))