Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New algorithm: iL-SHADE #560

Merged
merged 4 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions examples/run_ilshade.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# encoding=utf8
# This is temporary fix to import module from parent folder
# It will be removed when package is published on PyPI
import sys

sys.path.append('../')
# End of fix

from niapy.algorithms.modified import ImprovedLpsrSuccessHistoryAdaptiveDifferentialEvolution
from niapy.task import Task
from niapy.problems import Griewank

# we will run iL-SHADE algorithm for 5 independent runs
algo = ImprovedLpsrSuccessHistoryAdaptiveDifferentialEvolution(population_size=40, extern_arc_rate=2.6, pbest_start=0.2,
pbest_end=0.1, hist_mem_size=6)
for i in range(5):
task = Task(problem=Griewank(dimension=10, lower=-600, upper=600), max_evals=10000, enable_logging=True)
best = algo.run(task)
print('%s -> %s' % (best[0], best[1]))
print(algo.get_parameters())
4 changes: 3 additions & 1 deletion niapy/algorithms/modified/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
SuccessHistoryAdaptiveDifferentialEvolution,
LpsrSuccessHistoryAdaptiveDifferentialEvolution
)
from niapy.algorithms.modified.ilshade import ImprovedLpsrSuccessHistoryAdaptiveDifferentialEvolution

__all__ = [
'HybridBatAlgorithm',
Expand All @@ -44,5 +45,6 @@
'HybridSelfAdaptiveBatAlgorithm',
'ParameterFreeBatAlgorithm',
'SuccessHistoryAdaptiveDifferentialEvolution',
'LpsrSuccessHistoryAdaptiveDifferentialEvolution'
'LpsrSuccessHistoryAdaptiveDifferentialEvolution',
'ImprovedLpsrSuccessHistoryAdaptiveDifferentialEvolution'
]
Loading