diff --git a/README.md b/README.md index 39d4f94..f8a820d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Development repo for draft versions of Python bindings for OptFrame Functional C Install: `python -m pip install optframe` -Version: `pyoptframe v5.0.28rc0` +Version: `pyoptframe v5.0.28` Play on Jupyter Notebook: [BRKGA Traveling Salesman Problem Example](demo/OptFrame_BRKGA_Official.ipynb) diff --git a/bumpver.toml b/bumpver.toml index 9eeddb5..c8011f8 100644 --- a/bumpver.toml +++ b/bumpver.toml @@ -1,5 +1,5 @@ [bumpver] -current_version = "5.0.28rc0" +current_version = "5.0.28" version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]" commit_message = "bump version {old_version} -> {new_version}" commit = true diff --git a/docs/source/conf.py b/docs/source/conf.py index 9019a03..ed62b1c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,7 +22,7 @@ author = 'Igor Machado Coelho' # The full version, including alpha/beta/rc tags -release = 'v5.0.28rc0' +release = 'v5.0.28' # -- General configuration --------------------------------------------------- diff --git a/optframe/__init__.py b/optframe/__init__.py index c7d34a4..b1f69f8 100644 --- a/optframe/__init__.py +++ b/optframe/__init__.py @@ -1,4 +1,4 @@ -__version__ = '5.0.28rc0' +__version__ = '5.0.28' # only useful stuff for root level here! from optframe.engine import Engine from optframe.engine import APILevel diff --git a/optframe/heuristics.py b/optframe/heuristics.py index 0d2c553..b3e293f 100644 --- a/optframe/heuristics.py +++ b/optframe/heuristics.py @@ -128,6 +128,26 @@ def __init__(self, _engine: XEngine, _ev: IdGeneralEvaluator, _nsseq: IdNSSeq): def get_id(self) -> IdLocalSearch: return self.ls_idx +class FirstImprovement(LocalSearch): + def __init__(self, _engine: XEngine, _ev: IdGeneralEvaluator, _nsseq: IdNSSeq): + assert isinstance(_engine, XEngine) + if (isinstance(_ev, int)): + _ev = IdGeneralEvaluator(_ev) + if (not isinstance(_ev, IdGeneralEvaluator)): + print(_ev) + assert (False) + if (isinstance(_nsseq, int)): + _nsseq = IdNSSeq(_nsseq) + if (not isinstance(_nsseq, IdNSSeq)): + print(_nsseq) + assert (False) + self.engine = _engine + str_code = "OptFrame:ComponentBuilder:LocalSearch:FI" + str_args = "OptFrame:GeneralEvaluator "+str(_ev.id)+" OptFrame:NS:NSFind:NSSeq "+str(_nsseq.id) + self.ls_idx = self.engine.build_local_search(str_code, str_args) + def get_id(self) -> IdLocalSearch: + return self.ls_idx + class VariableNeighborhoodDescent(LocalSearch): def __init__(self, _engine: XEngine, _ev: IdGeneralEvaluator, _lslist: IdListLocalSearch): assert isinstance(_engine, XEngine) diff --git a/pyproject.toml b/pyproject.toml index a7622d3..1d02432 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "optframe" -version = "5.0.28rc0" +version = "5.0.28" description = "Python bindings for OptFrame Functional Core" readme = "README.md" authors = [{ name = "Igor Machado Coelho", email = "igormcoelho@proton.me" }] @@ -27,4 +27,4 @@ requires-python = ">=3.9" dev = ["black", "bumpver", "isort", "pip-tools", "pytest"] [project.urls] -Homepage = "https://github.com/optframe/pyoptframe-dev" +Homepage = "https://github.com/optframe/pyoptframe" diff --git a/setup.py b/setup.py index 115b28b..7f5222e 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ class CTypesExtension(Extension): class MyBuildExt(build_ext_orig): def run(self): subprocess.check_call( - ['git', 'clone', '--depth', '1', '--branch', '5.0.18', 'https://github.com/optframe/optframe', 'optframe-git']) + ['git', 'clone', '--depth', '1', '--branch', '5.1.0', 'https://github.com/optframe/optframe', 'optframe-git']) build_ext_orig.run(self) def build_extension(self, ext): @@ -49,7 +49,7 @@ def get_ext_filename(self, ext_name): setup( name="optframe", - version="5.0.28rc0", + version="5.0.28", py_modules=["optframe.components","optframe.core","optframe.engine","optframe.heuristics","optframe.protocols"], ext_modules=[ CTypesExtension(