Giter VIP home page Giter VIP logo

ant-lion-optimizer's Introduction

Ant Lion Optimizer

Reference: Mirjalili S. The ant lion optimizer[J]. Advances in Engineering Software, 2015, 83: 80-98.
Variables Meaning
pop The population size
iter The maximum number of iterations
lb The lower bound (list)
ub The upper bound (list)
a_pos The position of ants (list)
a_score The score of ants (list)
al_pos The position of ant lions (list)
al_score The score of ant lions (list)
dim Dimension
elite_score The score of the elite ant lion
elite_pos The position of the elite ant lion
iter_best The global best score of each iteration (list)
con_iter The last iteration number when "gbest" is updated

Test problem

$$ f(x)=\sum_{i=1}^{30}x_i^2,\qquad -100\leq x_i\leq100, \quad i=1,\cdots, 30. $$

Example

if __name__ == '__main__':
    # Parameter settings
    pop = 20
    iter = 2000
    lb = [-100] * 30
    ub = [100] * 30
    print(main(pop, iter, lb, ub))
Output:

The IWO converges at its 2000-th iteration, and the global best value is 4.270541704648386e-08.

{
    'best score': 4.270541704648386e-08, 
    'best solution': [-1.5391999586442185e-05, -1.7056386288551623e-05, -5.107088059014014e-05, -2.432108536136789e-05, -1.4308890774324676e-05, -3.8823790785923835e-06, -9.808114212909759e-05, -5.751616300205372e-05, -4.993437829049893e-05, -5.1607203380939716e-05, -1.8869367885403095e-05, 2.130054106617643e-05, -1.0130747574091335e-05, -3.3092614378570656e-06, 1.938125609972938e-06, 9.724418640964699e-06, 6.622633914203969e-05, 5.395217097802391e-05, 1.3272089053584755e-05, 4.4496518195489484e-05, 2.754550165856821e-05, 4.970789818374019e-05, 2.2878535581998185e-05, -2.2563536843683176e-05, -1.0995661702910254e-05, 5.0054321953539606e-05, 3.0219993298851248e-05, 1.9613764504500345e-05, 2.005490775217857e-05, -4.012568229501054e-05], 
    'convergence iteration': 2000
}

ant-lion-optimizer's People

Contributors

xavier-mayiming 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.