From ad4eb77504ae12f26cbf4e2022a2d778f7f9384c Mon Sep 17 00:00:00 2001 From: Armen <52046521+armenbeck@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:23:49 -0500 Subject: [PATCH] Update README.md --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/README.md b/README.md index f51677e..cdb036d 100644 --- a/README.md +++ b/README.md @@ -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