Skip to content

Commit

Permalink
EvoloPy as Module
Browse files Browse the repository at this point in the history
  • Loading branch information
mariosky committed Mar 16, 2017
1 parent 8e53e1b commit 154c19d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*~
__pycache__/

.pyc
12 changes: 8 additions & 4 deletions GWO.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
import time




def GWO(objf,lb,ub,dim,SearchAgents_no,Max_iter):
def GWO(objf,lb,ub,dim,SearchAgents_no,Max_iter, Positions = None ):


#Max_iter=1000
#lb=-100
#ub=100
#dim=30
#SearchAgents_no=5


# initialize alpha, beta, and delta_pos
Alpha_pos=numpy.zeros(dim)
Expand All @@ -34,8 +34,12 @@ def GWO(objf,lb,ub,dim,SearchAgents_no,Max_iter):
Delta_score=float("inf")

#Initialize the positions of search agents
Positions=numpy.random.uniform(0,1,(SearchAgents_no,dim)) *(ub-lb)+lb

if not Positions is None:
Positions=numpy.random.uniform(0,1,(SearchAgents_no,dim)) *(ub-lb)+lb

print Positions


Convergence_curve=numpy.zeros(Max_iter)
s=solution()

Expand Down
Empty file added __init__.py
Empty file.

0 comments on commit 154c19d

Please sign in to comment.