Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Freakwill committed Jan 2, 2024
1 parent c7db511 commit ebbfce7
Show file tree
Hide file tree
Showing 43 changed files with 329 additions and 271 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you have more questions, then log in [google group](https://groups.google.com

## Download

It has been uploaded to [pypi](https://pypi.org/project/pyrimidine/), so download it with `pip install pyrimidine`, and also could download it from github.
It has been uploaded to [pypi](https://pypi.org/project/pyrimidine/), so download it with `pip install pyrimidine`, and also could download it from Github.

## Idea

Expand All @@ -34,7 +34,7 @@ class BasePopulation(PopulationModel, metaclass=MetaContainer):
default_size = 20
```

There is two main kinds of containers: list-like and tuple-like, as in programming language `Haskell`. See following examples.
There is two main kinds of containers: list-like and tuple-like. See following examples.

```python
# individual with chromosomes of type _Chromosome
Expand Down Expand Up @@ -437,3 +437,8 @@ pop = MyParticleSwarm.random()
```

Of course, it is not mandatory. It is allowed to inherit `ParticleSwarm` from for example `HOFPopulation` directly.

## Contributions

If you'd like to contribute to `pyrimidine`, please contact with me;
and if you have noticed some bugs, then use the GitHub issues page to report them.
Binary file modified docs/build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/source/Home.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/source/Release History.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/source/pyrimidine.benchmarks.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/source/pyrimidine.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/source/pyrimidine.learn.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/source/pyrimidine.local_search.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/build/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Welcome to pyrimidine's world of genetic algorithm
Helpers <../source/Helpers.md>
Misc <../source/Misc.md>


.. toctree::
:maxdepth: 2
:caption: Contents:
modules <../source/modules.rst>


Expand Down
10 changes: 8 additions & 2 deletions docs/build/_sources/source/Home.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ We view the population as a container of individuals, each individual as a conta
Mathematically, we denote a container of elements of type `A` as follows:

```
s = {a:A}:S
s = {a:A}:S <==> s: S[A]
```
A population is a container of individuals; an individual is a container of chromosomes. Below is the partial source code for `BaseIndividual` and `BasePopulation`.

Now we give the following definition:
- A population is a container of individuals (or chromosomes);
- An individual is a container of chromosomes;
- A multi-population is a container of population;

Below is the partial source code for `BaseIndividual` and `BasePopulation`.

```python
class BaseIndividual(FitnessMixin, metaclass=MetaContainer):
Expand Down
2 changes: 2 additions & 0 deletions docs/build/_sources/source/Release History.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- Give an example for "hybrid population", composed of populations and individuals
- parallel computing, limited to computing the fitnesses parallely
- add class method `solve`, use `Population.solve` to get the solution in a convenient way, where `Population` is the class for any iterative algorithm.
- update the decorator for cache

## before v1.5
?
70 changes: 52 additions & 18 deletions docs/build/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ <h2 id="C">C</h2>
<li><a href="source/pyrimidine.html#pyrimidine.individual.PhantomIndividual.cleared">cleared() (pyrimidine.individual.PhantomIndividual method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.chromosome.NumpyArrayChromosome.clone">clone() (pyrimidine.chromosome.NumpyArrayChromosome method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.deco.add_cache.cmd">cmd (pyrimidine.deco.add_cache attribute)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.gsa.GravitySearch.compute_accelerate">compute_accelerate() (pyrimidine.gsa.GravitySearch method)</a>
</li>
Expand All @@ -378,6 +380,8 @@ <h2 id="C">C</h2>
<li><a href="source/pyrimidine.learn.html#pyrimidine.learn.BaseEstimator.config">config() (pyrimidine.learn.BaseEstimator class method)</a>

<ul>
<li><a href="source/pyrimidine.learn.html#pyrimidine.learn.linear_regression.GALinearRegression.config">(pyrimidine.learn.linear_regression.GALinearRegression class method)</a>
</li>
<li><a href="source/pyrimidine.learn.html#pyrimidine.learn.neural_network.GAMLPRegressor.config">(pyrimidine.learn.neural_network.GAMLPRegressor class method)</a>
</li>
</ul></li>
Expand All @@ -399,8 +403,12 @@ <h2 id="C">C</h2>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="source/pyrimidine.learn.html#pyrimidine.learn.neural_network.GAMLPRegressor.create_model">create_model() (pyrimidine.learn.neural_network.GAMLPRegressor class method)</a>
<li><a href="source/pyrimidine.learn.html#pyrimidine.learn.linear_regression.GALinearRegression.create_model">create_model() (pyrimidine.learn.linear_regression.GALinearRegression class method)</a>

<ul>
<li><a href="source/pyrimidine.learn.html#pyrimidine.learn.neural_network.GAMLPRegressor.create_model">(pyrimidine.learn.neural_network.GAMLPRegressor class method)</a>
</li>
</ul></li>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseChromosome.cross">cross() (pyrimidine.base.BaseChromosome method)</a>

<ul>
Expand Down Expand Up @@ -654,6 +662,8 @@ <h2 id="E">E</h2>
<li><a href="source/pyrimidine.learn.html#id0">estimated_params (pyrimidine.learn.BaseEstimator attribute)</a>, <a href="source/pyrimidine.learn.html#pyrimidine.learn.BaseEstimator.estimated_params">[1]</a>

<ul>
<li><a href="source/pyrimidine.learn.html#pyrimidine.learn.linear_regression.GALinearRegression.estimated_params">(pyrimidine.learn.linear_regression.GALinearRegression attribute)</a>
</li>
<li><a href="source/pyrimidine.learn.html#pyrimidine.learn.neural_network.GAMLPRegressor.estimated_params">(pyrimidine.learn.neural_network.GAMLPRegressor attribute)</a>
</li>
</ul></li>
Expand Down Expand Up @@ -730,6 +740,8 @@ <h2 id="G">G</h2>
<li><a href="source/pyrimidine.html#pyrimidine.optimize.ga_minimize">ga_minimize() (in module pyrimidine.optimize)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.optimize.ga_minimize_1D">ga_minimize_1D() (in module pyrimidine.optimize)</a>
</li>
<li><a href="source/pyrimidine.learn.html#pyrimidine.learn.linear_regression.GALinearRegression">GALinearRegression (class in pyrimidine.learn.linear_regression)</a>
</li>
<li><a href="source/pyrimidine.learn.html#pyrimidine.learn.neural_network.GAMLPRegressor">GAMLPRegressor (class in pyrimidine.learn.neural_network)</a>
</li>
Expand All @@ -738,11 +750,11 @@ <h2 id="G">G</h2>
<li><a href="source/pyrimidine.html#pyrimidine.individual.GenderIndividual.gender">gender (pyrimidine.individual.GenderIndividual property)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.individual.GenderIndividual">GenderIndividual (class in pyrimidine.individual)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseMultiPopulation.get_best_individual">get_best_individual() (pyrimidine.base.BaseMultiPopulation method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseMultiPopulation.get_best_individual">get_best_individual() (pyrimidine.base.BaseMultiPopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.population.GamogenesisPopulation.get_homosex">get_homosex() (pyrimidine.population.GamogenesisPopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseIndividual.get_neighbour">get_neighbour() (pyrimidine.base.BaseIndividual method)</a>
Expand Down Expand Up @@ -941,9 +953,11 @@ <h2 id="M">M</h2>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.multipopulation.DualPopulation.match">match() (pyrimidine.multipopulation.DualPopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.base.BasePopulation.mate">mate() (pyrimidine.base.BasePopulation method)</a>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseMultiPopulation.mate">mate() (pyrimidine.base.BaseMultiPopulation method)</a>

<ul>
<li><a href="source/pyrimidine.html#pyrimidine.base.BasePopulation.mate">(pyrimidine.base.BasePopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.es.EvolutionStrategy.mate">(pyrimidine.es.EvolutionStrategy method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.multipopulation.DualPopulation.mate">(pyrimidine.multipopulation.DualPopulation method)</a>
Expand Down Expand Up @@ -1018,6 +1032,8 @@ <h2 id="M">M</h2>
<li><a href="source/pyrimidine.benchmarks.html#pyrimidine.benchmarks.optimization.MixMLE">MixMLE (class in pyrimidine.benchmarks.optimization)</a>
</li>
<li><a href="source/pyrimidine.benchmarks.html#pyrimidine.benchmarks.optimization.MLE">MLE (class in pyrimidine.benchmarks.optimization)</a>
</li>
<li><a href="source/pyrimidine.benchmarks.html#pyrimidine.benchmarks.neural_network.MLP">MLP (class in pyrimidine.benchmarks.neural_network)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.population.ModifiedPopulation">ModifiedPopulation (class in pyrimidine.population)</a>
</li>
Expand All @@ -1040,6 +1056,8 @@ <h2 id="M">M</h2>
<li><a href="source/pyrimidine.benchmarks.html#module-pyrimidine.benchmarks.linear_model">pyrimidine.benchmarks.linear_model</a>
</li>
<li><a href="source/pyrimidine.benchmarks.html#module-pyrimidine.benchmarks.matrix">pyrimidine.benchmarks.matrix</a>
</li>
<li><a href="source/pyrimidine.benchmarks.html#module-pyrimidine.benchmarks.neural_network">pyrimidine.benchmarks.neural_network</a>
</li>
<li><a href="source/pyrimidine.benchmarks.html#module-pyrimidine.benchmarks.optimization">pyrimidine.benchmarks.optimization</a>
</li>
Expand All @@ -1062,6 +1080,8 @@ <h2 id="M">M</h2>
<li><a href="source/pyrimidine.html#module-pyrimidine.individual">pyrimidine.individual</a>
</li>
<li><a href="source/pyrimidine.learn.html#module-pyrimidine.learn">pyrimidine.learn</a>
</li>
<li><a href="source/pyrimidine.learn.html#module-pyrimidine.learn.linear_regression">pyrimidine.learn.linear_regression</a>
</li>
<li><a href="source/pyrimidine.learn.html#module-pyrimidine.learn.neural_network">pyrimidine.learn.neural_network</a>
</li>
Expand Down Expand Up @@ -1118,6 +1138,8 @@ <h2 id="M">M</h2>

<ul>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseIndividual.mutate">(pyrimidine.base.BaseIndividual method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseMultiPopulation.mutate">(pyrimidine.base.BaseMultiPopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.base.BasePopulation.mutate">(pyrimidine.base.BasePopulation method)</a>
</li>
Expand Down Expand Up @@ -1148,8 +1170,6 @@ <h2 id="M">M</h2>
<li><a href="source/pyrimidine.local_search.html#pyrimidine.local_search.random_walk.RandomWalk.mutate">(pyrimidine.local_search.random_walk.RandomWalk method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.multipopulation.DualPopulation.mutate">(pyrimidine.multipopulation.DualPopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.multipopulation.MultiPopulation.mutate">(pyrimidine.multipopulation.MultiPopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.population.ModifiedPopulation.mutate">(pyrimidine.population.ModifiedPopulation method)</a>
</li>
Expand Down Expand Up @@ -1409,17 +1429,11 @@ <h2 id="P">P</h2>
<li><a href="source/pyrimidine.html#pyrimidine.chromosome.PermutationChromosome">PermutationChromosome (class in pyrimidine.chromosome)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.individual.PhantomIndividual.phantom">phantom (pyrimidine.individual.PhantomIndividual attribute)</a>

<ul>
<li><a href="source/pyrimidine.local_search.html#id1">(pyrimidine.local_search.simulated_annealing.SimulatedAnnealing attribute)</a>, <a href="source/pyrimidine.local_search.html#pyrimidine.local_search.simulated_annealing.SimulatedAnnealing.phantom">[1]</a>
</li>
</ul></li>
<li><a href="source/pyrimidine.html#pyrimidine.individual.PhantomIndividual">PhantomIndividual (class in pyrimidine.individual)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.individual.PolyIndividual">PolyIndividual (in module pyrimidine.individual)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="source/pyrimidine.learn.html#id1">pop (pyrimidine.learn.BaseEstimator attribute)</a>, <a href="source/pyrimidine.learn.html#pyrimidine.learn.BaseEstimator.pop">[1]</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.population.Population">Population (in module pyrimidine.population)</a>
Expand All @@ -1434,6 +1448,8 @@ <h2 id="P">P</h2>
<li><a href="source/pyrimidine.html#pyrimidine.pso.Particle.position">(pyrimidine.pso.Particle property)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="source/pyrimidine.html#pyrimidine.chromosome.PositiveChromosome">PositiveChromosome (class in pyrimidine.chromosome)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.chromosome.ProbabilityChromosome">ProbabilityChromosome (class in pyrimidine.chromosome)</a>
Expand Down Expand Up @@ -1494,6 +1510,13 @@ <h2 id="P">P</h2>

<ul>
<li><a href="source/pyrimidine.benchmarks.html#module-pyrimidine.benchmarks.matrix">module</a>
</li>
</ul></li>
<li>
pyrimidine.benchmarks.neural_network

<ul>
<li><a href="source/pyrimidine.benchmarks.html#module-pyrimidine.benchmarks.neural_network">module</a>
</li>
</ul></li>
<li>
Expand Down Expand Up @@ -1571,6 +1594,13 @@ <h2 id="P">P</h2>

<ul>
<li><a href="source/pyrimidine.learn.html#module-pyrimidine.learn">module</a>
</li>
</ul></li>
<li>
pyrimidine.learn.linear_regression

<ul>
<li><a href="source/pyrimidine.learn.html#module-pyrimidine.learn.linear_regression">module</a>
</li>
</ul></li>
<li>
Expand Down Expand Up @@ -1696,6 +1726,10 @@ <h2 id="R">R</h2>
<li><a href="source/pyrimidine.benchmarks.html#pyrimidine.benchmarks.fitting.Fitting.random">(pyrimidine.benchmarks.fitting.Fitting method)</a>
</li>
<li><a href="source/pyrimidine.benchmarks.html#pyrimidine.benchmarks.matrix.NMF.random">(pyrimidine.benchmarks.matrix.NMF static method)</a>
</li>
<li><a href="source/pyrimidine.benchmarks.html#pyrimidine.benchmarks.neural_network.MLP.random">(pyrimidine.benchmarks.neural_network.MLP static method)</a>
</li>
<li><a href="source/pyrimidine.benchmarks.html#pyrimidine.benchmarks.neural_network.RNN.random">(pyrimidine.benchmarks.neural_network.RNN static method)</a>
</li>
<li><a href="source/pyrimidine.benchmarks.html#pyrimidine.benchmarks.optimization.FacilityLayout.random">(pyrimidine.benchmarks.optimization.FacilityLayout static method)</a>
</li>
Expand Down Expand Up @@ -1888,12 +1922,16 @@ <h2 id="R">R</h2>
<li><a href="source/pyrimidine.html#pyrimidine.pso.ParticleSwarm.regester_map">(pyrimidine.pso.ParticleSwarm method)</a>
</li>
</ul></li>
<li><a href="source/pyrimidine.html#pyrimidine.errors.RegesterError">RegesterError</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseChromosome.replicate">replicate() (pyrimidine.base.BaseChromosome method)</a>

<ul>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseIndividual.replicate">(pyrimidine.base.BaseIndividual method)</a>
</li>
</ul></li>
<li><a href="source/pyrimidine.benchmarks.html#pyrimidine.benchmarks.neural_network.RNN">RNN (class in pyrimidine.benchmarks.neural_network)</a>
</li>
<li><a href="source/pyrimidine.benchmarks.html#pyrimidine.benchmarks.special.rosenbrock">rosenbrock() (in module pyrimidine.benchmarks.special)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.utils.rotate">rotate() (in module pyrimidine.utils)</a>
Expand All @@ -1911,13 +1949,13 @@ <h2 id="S">S</h2>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseEnvironment.select">select() (pyrimidine.base.BaseEnvironment method)</a>

<ul>
<li><a href="source/pyrimidine.html#pyrimidine.base.BaseMultiPopulation.select">(pyrimidine.base.BaseMultiPopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.base.BasePopulation.select">(pyrimidine.base.BasePopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.ep.EPPopulation.select">(pyrimidine.ep.EPPopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.multipopulation.DualPopulation.select">(pyrimidine.multipopulation.DualPopulation method)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.multipopulation.MultiPopulation.select">(pyrimidine.multipopulation.MultiPopulation method)</a>
</li>
</ul></li>
<li><a href="source/pyrimidine.html#pyrimidine.es.EvolutionStrategy.select_best_individuals">select_best_individuals() (pyrimidine.es.EvolutionStrategy method)</a>
Expand Down Expand Up @@ -2067,11 +2105,7 @@ <h2 id="V">V</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="source/pyrimidine.html#id2">values (pyrimidine.base.BaseGene attribute)</a>, <a href="source/pyrimidine.html#pyrimidine.base.BaseGene.values">[1]</a>

<ul>
<li><a href="source/pyrimidine.html#pyrimidine.gene.BinaryGene.values">(pyrimidine.gene.BinaryGene attribute)</a>
</li>
</ul></li>
<li><a href="source/pyrimidine.html#pyrimidine.ep.BaseEPIndividual.variance">variance (pyrimidine.ep.BaseEPIndividual property)</a>
</li>
<li><a href="source/pyrimidine.html#pyrimidine.chromosome.VectorChromosome">VectorChromosome (class in pyrimidine.chromosome)</a>
Expand Down
4 changes: 0 additions & 4 deletions docs/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ <h1>Welcome to pyrimidine’s world of genetic algorithm<a class="headerlink" hr
<li class="toctree-l2"><a class="reference internal" href="source/Misc.html#tutorial">Tutorial</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="source/modules.html">modules</a><ul>
<li class="toctree-l2"><a class="reference internal" href="source/pyrimidine.html">pyrimidine package</a></li>
</ul>
</li>
</ul>
</div>
</section>
Expand Down
Binary file modified docs/build/objects.inv
Binary file not shown.
10 changes: 10 additions & 0 deletions docs/build/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ <h1>Python Module Index</h1>
<td>&#160;&#160;&#160;
<a href="source/pyrimidine.benchmarks.html#module-pyrimidine.benchmarks.matrix"><code class="xref">pyrimidine.benchmarks.matrix</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="source/pyrimidine.benchmarks.html#module-pyrimidine.benchmarks.neural_network"><code class="xref">pyrimidine.benchmarks.neural_network</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
Expand Down Expand Up @@ -149,6 +154,11 @@ <h1>Python Module Index</h1>
<td>&#160;&#160;&#160;
<a href="source/pyrimidine.learn.html#module-pyrimidine.learn"><code class="xref">pyrimidine.learn</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="source/pyrimidine.learn.html#module-pyrimidine.learn.linear_regression"><code class="xref">pyrimidine.learn.linear_regression</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
Expand Down
2 changes: 1 addition & 1 deletion docs/build/searchindex.js

Large diffs are not rendered by default.

Loading

0 comments on commit ebbfce7

Please sign in to comment.