Git Product home page Git Product logo

cpmech / goga Goto Github PK

View Code? Open in Web Editor NEW
44.0 9.0 9.0 22.5 MB

Go evolutionary algorithm is a computer library for developing evolutionary and genetic algorithms to solve optimisation problems with (or not) many constraints and many objectives. Also, a goal is to handle mixed-type representations (reals and integers).

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.20% Shell 0.21% Python 2.07% Go 97.53%
genetic-algorithm evolutionary-algorithms evolutionary-computation evolutionary-algorithm optimization optimizer optimisation hacktoberfest hacktoberfest2019

goga's Introduction

Goga โ€“ Go Evolutionary/Genetic Algorithm

Goga is a computer library for developing evolutionary algorithms based on the differential evolution and/or genetic algorithm concepts. The goal of these algorithms is to solve optimisation problems with (or not) many constraints and many objectives. Also, problems with mixed-type representations with real numbers and integers are considered by Goga.

See the documentation for more details (e.g. how to call functions and use structures).

GoDoc

The core algorithms in Goga are well explained in my paper entitled Parallel evolutionary algorithm for constrained single and multi objective optimisation which was rejected (due to silly reasons such as too long) from IEEE Transactions on Evolutionary Computation but accepted in Applied Soft Computing.

The original version for IEEE contains all the equations and is nicely formatted. You can get them freely from here:

  1. Part I: Methods, single and two-objective test cases
  2. Part II: Multi/many-objective test cases and applications

The shorter and slightly improved (published) version is also freely availabe from here:

  1. Summary of GOGA Algorithms; see also [1, 2]

Examples

Check out more examples here

Output of cross-in-tray.go
// objective function
func fcn(f, g, h, x []float64, y []int, cpu int) {
	f[0] = -0.0001 * Pow(Abs(Sin(x[0])*Sin(x[1])*Exp(Abs(100-Sqrt(Pow(x[0], 2)+Pow(x[1], 2))/Pi)))+1, 0.1)
}

// main function
func main() {

	// problem definition
	nf := 1 // number of objective functions
	ng := 0 // number of inequality constraints
	nh := 0 // number of equality constraints

	// the solver (optimiser)
	var opt goga.Optimiser
	opt.Default()                    // must call this to set default constants
	opt.FltMin = []float64{-10, -10} // must set minimum
	opt.FltMax = []float64{+10, +10} // must set maximum
	opt.Nsol = 80
	opt.Nsamples = 100

	// initialise the solver
	opt.Init(goga.GenTrialSolutions, nil, fcn, nf, ng, nh)

	// solve problem
	opt.RunMany("", "", false)

	// stat
	opt.PrintStatF(0)
}

Installation

1 Install dependencies:

Goga depends on the Gosl Go Scientific Library, therefore, please install Gosl first.

2 Install Goga:

go get github.com/cpmech/goga

Documentation

Here, we call user-defined types as structures. These are simply Go types defined as struct. Some may think of these structures as classes. Goga has several global functions as well and tries to avoid complicated constructions.

An allocated structure is called here an object and functions attached to this object are called methods. The variable holding the pointer to an object is always named o in Goga (e.g. like self or this).

Some objects need to be initialised before usage. In this case, functions named Init have to be called (e.g. like constructors).

Bibliography

Goga is included in the following works:

  1. Pedroso DM, Bonyadi MR, Gallagher M (2017) Parallel evolutionary algorithm for single and multi-objective optimisation: differential evolution and constraints handling, Applied Soft Computing http://dx.doi.org/10.1016/j.asoc.2017.09.006
  2. Pedroso DM (2017) FORM reliability analysis using a parallel evolutionary algorithm, Structural Safety 65:84-99 http://dx.doi.org/10.1016/j.strusafe.2017.01.001

Authors and license

See the AUTHORS file.

Unless otherwise noted, the Goga source files are distributed under the BSD-style license found in the LICENSE file.

goga's People

Contributors

cpmech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.