From 960900c518617d654bbe095c609ba2759ba0b70b Mon Sep 17 00:00:00 2001 From: Adrian Toncean Date: Sun, 29 Mar 2015 19:05:34 +0200 Subject: [PATCH] README updates --- README.md | 14 +++++++++----- examples/node/node.js | 2 +- package.json | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 51f3153..1747ae1 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Sample applications + [simple](http://adrianton3.github.io/pso.js/examples/simple/simple.html) A simple application that optimizes a one dimensional function + [simple-require](http://adrianton3.github.io/pso.js/examples/simple_require/simple_require.html) The same as *simple*, except using RequireJS ++ [simple-node](http://adrianton3.github.io/pso.js/examples/node/node.js) A simple node example + [automaton](http://adrianton3.github.io/pso.js/examples/automaton/automaton.html) A more sophisticated application that adapts a mechanism for a specified output path. pso.js is launched in this case by web workers + [circles](http://adrianton3.github.io/pso.js/examples/circles/circles.html) A simple application that optimizes a two dimensional function @@ -30,7 +31,7 @@ var optimizer = new pso.Optimizer(); // set the objective function optimizer.setObjectiveFunction(function (x) { return -(x[0] * x[0] + x[1] * x[1]); }); -// set an initial population of 20 particles spread across the search space *[-10, 10] x [-10, 10]* +// set an initial population of 20 particles spread across the search space *[-10, 10] x [-10, 10]* optimizer.init(20, [{ start: -10, end: 10 }, { start: -10, end: 10 }]); // run the optimizer 40 iterations @@ -51,11 +52,14 @@ The `setOptions` method takes a single map-like object - here are its default va { inertiaWeight: 0.8, social: 0.4, - personal: 0.4 + personal: 0.4, + pressure: 0.5 } ``` - -The `social` parameter dictates how much a particle should be influenced by the best performing particle in the swarm. -The `personal` parameter dictates how much a particle should be influenced by the best position it has been in. + ++ `inertiaWeight` is multiplied every frame with the previous velocity ++ `social` dictates how much a particle should be influenced by the best performing particle in the swarm ++ `personal` indicates how much a particle should be influenced by the best position it has been in ++ `pressure` is the bias in selecting the best performing particle in the swarm For more details consult the [annotated source](http://adrianton3.github.io/pso.js/docs/pso.html). \ No newline at end of file diff --git a/examples/node/node.js b/examples/node/node.js index fc7c94a..9fa09f2 100644 --- a/examples/node/node.js +++ b/examples/node/node.js @@ -1,6 +1,6 @@ 'use strict'; -var pso = require('../../src/pso.js'); +var pso = require('pso'); // create the optimizer var optimizer = new pso.Optimizer(); diff --git a/package.json b/package.json index e00a4ec..b2bac25 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pso", "description": "Particle Swarm Optimization library", "author": "Adrian Toncean ", - "version": "0.1.0", + "version": "1.0.0", "main": "src/pso.js", "repository": { "type": "git",