Skip to content

Commit

Permalink
rename tests -> examples
Browse files Browse the repository at this point in the history
  • Loading branch information
PasaOpasen committed Apr 14, 2024
1 parent 3c82731 commit a069bae
Show file tree
Hide file tree
Showing 92 changed files with 54 additions and 56 deletions.
86 changes: 43 additions & 43 deletions README.md

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 11 additions & 13 deletions tests/min of sum int.py → examples/min of sum int.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
"""

import sys

sys.path.append('..')

import numpy as np
from geneticalgorithm2 import GeneticAlgorithm2 as ga


def f(X):
return np.sum(X)


varbound = [[0,10]]*3

model = ga(function=f, dimension=3, variable_type='int', variable_boundaries=varbound)

model.run()
varbound = [[0, 10]] * 3

model = ga(dimension=3, variable_type='int', variable_boundaries=varbound)

model.run(function=f, )

# check discrete mutation

Expand All @@ -30,21 +31,18 @@ def f(X):
dimension=300, variable_type='int',
variable_boundaries=varbound,
algorithm_parameters={
'mutation_discrete_type': 'uniform_discrete',
'max_num_iteration': 1000
'mutation_discrete_type': 'uniform_discrete',
'max_num_iteration': 1000
}
)

model.run(stop_when_reached=0, function=f,)
model.run(stop_when_reached=0, function=f, )


model = ga(function=f, dimension=300, variable_type='int',
model = ga(dimension=300, variable_type='int',
variable_boundaries=varbound,
algorithm_parameters={
'mutation_discrete_type': lambda x, left, right: left,
'max_num_iteration': 1000
})

model.run(stop_when_reached=0)


model.run(function=f, stop_when_reached=0)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a069bae

Please sign in to comment.