Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
armenbeck authored Dec 23, 2024
1 parent 8220341 commit ad4eb77
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,57 @@
[![Build Status](https://travis-ci.org/chopralab/paddy.svg?branch=master)](https://travis-ci.org/chopralab/paddy)
[![Coverage Status](https://coveralls.io/repos/github/chopralab/paddy/badge.svg?branch=master)](https://coveralls.io/github/chopralab/paddy?branch=master)
![pylint](https://github.com/chopralab/Paddy/blob/master/pylint.svg?raw=True)

Paddy is a platform, writen in Python, for using the Paddy Field Algorithm, and evolutionary optimization algorithm.

## Installation

Paddy can be installed from PyPI with the command:

```
pip install pip
```

## Example

To run paddy, one simply needs to define their evaluation function, and parameter space:

```
>>> import paddy
>>> def parabola(input):
... x = input[0][0]
... y = input[1][0]
... return(((x**2)/7)-((y**2)/2)+1)# The maximum is when x and y are 0
...
>>> # now we need to set our parameter space for x and y
>>> x_param = paddy.PaddyParameter(param_range=[-5,5,.2],
... param_type='continuous',
... limits=None, gaussian='scaled',
... normalization = False)
...
>>> y_param = paddy.PaddyParameter(param_range=[-7,3,.2],
... param_type='continuous',
... limits=None, gaussian='scaled',
... normalization = False)
...
>>> # now we make a class with the parameter spaces we defined
>>> class paraboloid_space(object):
... def __init__(self):
... self.xp = x_param
... self.yp = y_param
...
>>> # now we need to initialize a `PFARunner`
>>> example_space = paraboloid_space() #the space parameter
>>> example_runner = paddy.PFARunner(space=example_space,
... eval_func=parabola,
... paddy_type='population',
... rand_seed_number = 20,
... yt = 10,
... Qmax = 5,
... r=.2,
... iterations = 5)
...
>>> example_runner.run_paddy(file_name='paddy_example')
paddy is done!
```
Full documentation of the code is available at: https://chopralab.github.io/paddy/index.html

0 comments on commit ad4eb77

Please sign in to comment.