-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsolution.py
More file actions
executable file
·31 lines (26 loc) · 977 Bytes
/
solution.py
File metadata and controls
executable file
·31 lines (26 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
"""
Python code of Gravitational Search Algorithm (GSA)
Reference: Rashedi, Esmat, Hossein Nezamabadi-Pour, and Saeid Saryazdi. "GSA: a gravitational search algorithm."
Information sciences 179.13 (2009): 2232-2248.
Coded by: Mukesh Saraswat (saraswatmukesh@gmail.com), Himanshu Mittal (emailid: himanshu.mittal224@gmail.com) and Raju Pal (emailid: raju3131.pal@gmail.com)
The code template used is similar given at link: https://github.com/7ossam81/EvoloPy and matlab version of GSA at mathworks.
-- Purpose: Defining the solution class
Code compatible:
-- Python: 2.* or 3.*
"""
class solution:
def __init__(self):
self.best = 0
self.bestIndividual=[]
self.convergence = []
self.optimizer=""
self.objfname=""
self.startTime=0
self.endTime=0
self.executionTime=0
self.lb=0
self.ub=0
self.dim=0
self.popnum=0
self.maxiers=0