From d92bac07d4a89740c0580f754217c57ebbfc7b35 Mon Sep 17 00:00:00 2001 From: Quarter Date: Wed, 10 Apr 2024 11:33:14 +0300 Subject: [PATCH] Finished cyclic hybridisation, experiments implemented --- experiments/hybridisation.ipynb | 1062 ++----------------- experiments/hybridisation.py | 65 ++ experiments/hybridisation_results_proc.py | 20 + experiments/wg_generate.py | 14 + sampo/backend/multiproc.py | 6 +- sampo/hybrid/cycle.py | 22 +- sampo/hybrid/population_tabu.py | 56 + sampo/scheduler/base.py | 3 + sampo/scheduler/genetic/schedule_builder.py | 12 +- 9 files changed, 236 insertions(+), 1024 deletions(-) create mode 100644 experiments/hybridisation.py create mode 100644 experiments/hybridisation_results_proc.py create mode 100644 experiments/wg_generate.py create mode 100644 sampo/hybrid/population_tabu.py diff --git a/experiments/hybridisation.ipynb b/experiments/hybridisation.ipynb index c6c097d1..9e29282d 100644 --- a/experiments/hybridisation.ipynb +++ b/experiments/hybridisation.ipynb @@ -7,8 +7,8 @@ "metadata": { "collapsed": true, "ExecuteTime": { - "end_time": "2024-04-03T16:07:38.633700400Z", - "start_time": "2024-04-03T16:07:37.844627200Z" + "end_time": "2024-04-06T14:56:18.492056800Z", + "start_time": "2024-04-06T14:56:16.553635700Z" } }, "outputs": [ @@ -16,7 +16,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "C:\\Users\\stasb\\PycharmProjects\\sampo\\venv\\lib\\site-packages\\scipy\\__init__.py:169: UserWarning: A NumPy version >=1.18.5 and <1.26.0 is required for this version of SciPy (detected version 1.26.4\n", + "C:\\Users\\Quarter\\PycharmProjects\\sampo\\venv\\lib\\site-packages\\scipy\\__init__.py:169: UserWarning: A NumPy version >=1.18.5 and <1.26.0 is required for this version of SciPy (detected version 1.26.4\n", " warnings.warn(f\"A NumPy version >={np_minversion} and <{np_maxversion}\"\n" ] }, @@ -26,10 +26,23 @@ "text": [ "Can not find native module; switching to default\n" ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[matplotlib] [DEBUG] matplotlib data path: C:\\Users\\Quarter\\PycharmProjects\\sampo\\venv\\lib\\site-packages\\matplotlib\\mpl-data\n", + "[matplotlib] [DEBUG] CONFIGDIR=C:\\Users\\Quarter\\.matplotlib\n", + "[matplotlib] [DEBUG] interactive is False\n", + "[matplotlib] [DEBUG] platform is win32\n", + "[matplotlib] [DEBUG] CACHEDIR=C:\\Users\\Quarter\\.matplotlib\n", + "[matplotlib.font_manager] [DEBUG] Using fontManager instance from C:\\Users\\Quarter\\.matplotlib\\fontlist-v330.json\n" + ] } ], "source": [ "import sampo.scheduler\n", + "from sampo.hybrid.population_tabu import TabuPopulationScheduler\n", "\n", "from sampo.hybrid.cycle import CycleHybridScheduler\n", "from sampo.api.genetic_api import ScheduleGenerationScheme\n", @@ -37,7 +50,7 @@ "from sampo.hybrid.population import HeuristicPopulationScheduler, GeneticPopulationScheduler\n", "\n", "heuristics = HeuristicPopulationScheduler([HEFTScheduler(), HEFTBetweenScheduler(), TopologicalScheduler()])\n", - "genetic1 = GeneticPopulationScheduler(GeneticScheduler(sgs_type=ScheduleGenerationScheme.Parallel))\n", + "genetic1 = TabuPopulationScheduler()\n", "genetic2 = GeneticPopulationScheduler(GeneticScheduler(sgs_type=ScheduleGenerationScheme.Parallel))\n", "\n", "hybrid = CycleHybridScheduler(heuristics, [genetic1, genetic2])" @@ -56,8 +69,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-04-03T16:07:38.696699500Z", - "start_time": "2024-04-03T16:07:38.635702800Z" + "end_time": "2024-04-06T14:56:18.508087600Z", + "start_time": "2024-04-06T14:56:18.494058200Z" } }, "id": "ca16a12c3f9bab5d", @@ -70,986 +83,42 @@ "name": "stdout", "output_type": "stream", "text": [ - "Genetic optimizing took 1.0008811950683594 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] Toolbox initialization & first population took 0.0 ms\n", - "[SAMPO] [INFO] First population evaluation took 34.501075744628906 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=3, best fitness=(186.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=5, best fitness=(186.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=9, best fitness=(186.0,) --\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 0.0 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] -- Generation 4, population=17, best fitness=(186.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=33, best fitness=(169.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(150.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(139.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(139.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(125.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(122.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(114.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(114.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(106.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(103.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(100.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(100.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(98.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(95.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(95.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(90.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(90.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(86.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(83.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] Final fitness: (79.0,)\n", - "[SAMPO] [INFO] Generations processing took 29808.282375335693 ms\n", - "[SAMPO] [INFO] Full genetic processing took 29845.81232070923 ms\n", - "[SAMPO] [INFO] Evaluation time: 27313.807725906372\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 1.9986629486083984 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 1.0006427764892578 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 581.0277462005615 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(79.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(78.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] Final fitness: (77.0,)\n", - "[SAMPO] [INFO] Generations processing took 32212.069511413574 ms\n", - "[SAMPO] [INFO] Full genetic processing took 32797.101736068726 ms\n", - "[SAMPO] [INFO] Evaluation time: 30046.712160110474\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 0.9987354278564453 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 0.0 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 578.0177116394043 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(77.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] Final fitness: (75.0,)\n", - "[SAMPO] [INFO] Generations processing took 31421.304941177368 ms\n", - "[SAMPO] [INFO] Full genetic processing took 32003.27229499817 ms\n", - "[SAMPO] [INFO] Evaluation time: 29240.514278411865\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 0.0 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 0.0 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 584.0227603912354 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(75.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(74.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] Final fitness: (73.0,)\n", - "[SAMPO] [INFO] Generations processing took 31454.72002029419 ms\n", - "[SAMPO] [INFO] Full genetic processing took 32040.709495544434 ms\n", - "[SAMPO] [INFO] Evaluation time: 29224.04646873474\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 1.031637191772461 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 1.031637191772461 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 571.0294246673584 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(73.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] Final fitness: (72.0,)\n", - "[SAMPO] [INFO] Generations processing took 31425.951957702637 ms\n", - "[SAMPO] [INFO] Full genetic processing took 32000.94962120056 ms\n", - "[SAMPO] [INFO] Evaluation time: 29238.579988479614\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 0.0 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 0.0 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 578.0298709869385 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] Final fitness: (72.0,)\n", - "[SAMPO] [INFO] Generations processing took 31788.572788238525 ms\n", - "[SAMPO] [INFO] Full genetic processing took 32370.574712753296 ms\n", - "[SAMPO] [INFO] Evaluation time: 29623.445749282837\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 0.9999275207519531 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 0.9999275207519531 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 582.026481628418 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(72.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] Final fitness: (71.0,)\n", - "[SAMPO] [INFO] Generations processing took 31527.050495147705 ms\n", - "[SAMPO] [INFO] Full genetic processing took 32113.001585006714 ms\n", - "[SAMPO] [INFO] Evaluation time: 29292.228937149048\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 1.0223388671875 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 0.0 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 566.028356552124 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(71.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] Final fitness: (70.0,)\n", - "[SAMPO] [INFO] Generations processing took 31045.90678215027 ms\n", - "[SAMPO] [INFO] Full genetic processing took 31614.901781082153 ms\n", - "[SAMPO] [INFO] Evaluation time: 28876.801252365112\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 0.9791851043701172 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 0.9791851043701172 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 557.9993724822998 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] Final fitness: (70.0,)\n", - "[SAMPO] [INFO] Generations processing took 31278.913021087646 ms\n", - "[SAMPO] [INFO] Full genetic processing took 31838.85955810547 ms\n", - "[SAMPO] [INFO] Evaluation time: 29065.153121948242\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 0.9641647338867188 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 0.0 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 560.0244998931885 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] Final fitness: (70.0,)\n", - "[SAMPO] [INFO] Generations processing took 31128.105878829956 ms\n", - "[SAMPO] [INFO] Full genetic processing took 31691.089868545532 ms\n", - "[SAMPO] [INFO] Evaluation time: 28931.764364242554\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 1.0008811950683594 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 1.0008811950683594 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 573.1713771820068 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] Final fitness: (70.0,)\n", - "[SAMPO] [INFO] Generations processing took 31062.047481536865 ms\n", - "[SAMPO] [INFO] Full genetic processing took 31639.246463775635 ms\n", - "[SAMPO] [INFO] Evaluation time: 28940.62566757202\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 1.9977092742919922 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 1.0027885437011719 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 556.5237998962402 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] Final fitness: (70.0,)\n", - "[SAMPO] [INFO] Generations processing took 31402.079343795776 ms\n", - "[SAMPO] [INFO] Full genetic processing took 31962.600708007812 ms\n", - "[SAMPO] [INFO] Evaluation time: 29197.723150253296\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 1.0039806365966797 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 1.0039806365966797 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 552.9623031616211 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] Final fitness: (70.0,)\n", - "[SAMPO] [INFO] Generations processing took 34150.842905044556 ms\n", - "[SAMPO] [INFO] Full genetic processing took 34705.838441848755 ms\n", - "[SAMPO] [INFO] Evaluation time: 31711.9197845459\n", - "[SAMPO] [INFO] Toolbox initialization & first population took 0.0 ms\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 0.0 ms\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[SAMPO] [INFO] First population evaluation took 627.0170211791992 ms\n", - "[SAMPO] [INFO] -- Generation 1, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 2, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 3, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 4, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 5, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 6, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 7, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 8, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 9, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 10, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 11, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 12, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 13, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 14, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 15, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 16, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 17, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 18, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 19, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 20, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 21, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 22, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 23, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 24, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 25, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 26, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 27, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 28, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 29, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 30, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 31, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 32, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 33, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 34, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 35, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 36, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 37, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 38, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 39, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 40, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 41, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 42, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 43, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 44, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 45, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 46, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 47, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 48, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 49, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] -- Generation 50, population=50, best fitness=(70.0,) --\n", - "[SAMPO] [INFO] Final fitness: (70.0,)\n", - "[SAMPO] [INFO] Generations processing took 32349.047422409058 ms\n", - "[SAMPO] [INFO] Full genetic processing took 32978.07812690735 ms\n", - "[SAMPO] [INFO] Evaluation time: 30229.533910751343\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Genetic optimizing took 0.9989738464355469 ms\n" + "Genetic optimizing took 2.000570297241211 ms\n", + "[TABU] iteration 0\n", + "[TABU] iteration 1\n", + "[TABU] iteration 2\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[1;31mKeyboardInterrupt\u001B[0m Traceback (most recent call last)", + "Cell \u001B[1;32mIn[3], line 6\u001B[0m\n\u001B[0;32m 3\u001B[0m SAMPO\u001B[38;5;241m.\u001B[39mbackend\u001B[38;5;241m.\u001B[39mcache_scheduler_info(wg, contractors)\n\u001B[0;32m 4\u001B[0m SAMPO\u001B[38;5;241m.\u001B[39mbackend\u001B[38;5;241m.\u001B[39mcache_genetic_info()\n\u001B[1;32m----> 6\u001B[0m schedule \u001B[38;5;241m=\u001B[39m \u001B[43mhybrid\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mschedule\u001B[49m\u001B[43m(\u001B[49m\u001B[43mwg\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcontractors\u001B[49m\u001B[43m)\u001B[49m\n", + "File \u001B[1;32m~\\PycharmProjects\\sampo\\sampo\\hybrid\\cycle.py:76\u001B[0m, in \u001B[0;36mCycleHybridScheduler.schedule\u001B[1;34m(self, wg, contractors, spec, assigned_parent_time, sgs_type, landscape)\u001B[0m\n\u001B[0;32m 73\u001B[0m cur_fitness \u001B[38;5;241m=\u001B[39m pop_fitness\n\u001B[0;32m 75\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m scheduler \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_cycle_schedulers:\n\u001B[1;32m---> 76\u001B[0m pop \u001B[38;5;241m=\u001B[39m \u001B[43mscheduler\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mschedule\u001B[49m\u001B[43m(\u001B[49m\u001B[43mpop\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mwg\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcontractors\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mspec\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43massigned_parent_time\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mlandscape\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 78\u001B[0m best_ind \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_get_best_individual(pop)\n\u001B[0;32m 80\u001B[0m toolbox \u001B[38;5;241m=\u001B[39m create_toolbox(wg\u001B[38;5;241m=\u001B[39mwg, contractors\u001B[38;5;241m=\u001B[39mcontractors, landscape\u001B[38;5;241m=\u001B[39mlandscape,\n\u001B[0;32m 81\u001B[0m assigned_parent_time\u001B[38;5;241m=\u001B[39massigned_parent_time, spec\u001B[38;5;241m=\u001B[39mspec,\n\u001B[0;32m 82\u001B[0m sgs_type\u001B[38;5;241m=\u001B[39msgs_type)\n", + "File \u001B[1;32m~\\PycharmProjects\\sampo\\sampo\\hybrid\\population_tabu.py:46\u001B[0m, in \u001B[0;36mTabuPopulationScheduler.schedule\u001B[1;34m(self, initial_population, wg, contractors, spec, assigned_parent_time, landscape)\u001B[0m\n\u001B[0;32m 41\u001B[0m tabu_leader \u001B[38;5;241m=\u001B[39m ChromosomeRW\u001B[38;5;241m.\u001B[39mfrom_sampo_chromosome(leader)\n\u001B[0;32m 43\u001B[0m opt_ord, opt_res \u001B[38;5;241m=\u001B[39m get_optimiser(tabu_toolbox,\n\u001B[0;32m 44\u001B[0m use_vp\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mTrue\u001B[39;00m,\n\u001B[0;32m 45\u001B[0m optimisers_lifetime\u001B[38;5;241m=\u001B[39mOptimiserLifetime\u001B[38;5;241m.\u001B[39mShort)\n\u001B[1;32m---> 46\u001B[0m tabu_leader \u001B[38;5;241m=\u001B[39m \u001B[43mopt_ord\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43moptimize\u001B[49m\u001B[43m(\u001B[49m\u001B[43mtabu_leader\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 47\u001B[0m tabu_leader \u001B[38;5;241m=\u001B[39m opt_res\u001B[38;5;241m.\u001B[39moptimize(tabu_leader)\n\u001B[0;32m 49\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m initial_population \u001B[38;5;241m+\u001B[39m tabu_leader\u001B[38;5;241m.\u001B[39mto_sampo_chromosome()\n", + "File \u001B[1;32m~\\PycharmProjects\\sampo\\tabusearch\\tabu_search.py:112\u001B[0m, in \u001B[0;36mTabuSearch.optimize\u001B[1;34m(self, x0)\u001B[0m\n\u001B[0;32m 109\u001B[0m history\u001B[38;5;241m.\u001B[39mappend(copy(x))\n\u001B[0;32m 111\u001B[0m \u001B[38;5;28;01mwhile\u001B[39;00m \u001B[38;5;28;01mTrue\u001B[39;00m:\n\u001B[1;32m--> 112\u001B[0m neighbours \u001B[38;5;241m=\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mget_neighbours\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 113\u001B[0m choice \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mchoose(neighbours)\n\u001B[0;32m 114\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m choice \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n", + "File \u001B[1;32m~\\PycharmProjects\\sampo\\tabusearch\\tabu_search.py:128\u001B[0m, in \u001B[0;36mTabuSearch.get_neighbours\u001B[1;34m(self, x)\u001B[0m\n\u001B[0;32m 127\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mget_neighbours\u001B[39m(\u001B[38;5;28mself\u001B[39m, x: Solution) \u001B[38;5;241m-\u001B[39m\u001B[38;5;241m>\u001B[39m Iterable[Solution]:\n\u001B[1;32m--> 128\u001B[0m generated \u001B[38;5;241m=\u001B[39m [(behaviour\u001B[38;5;241m.\u001B[39mmutation_type, behaviour\u001B[38;5;241m.\u001B[39mmutate(x)) \u001B[38;5;28;01mfor\u001B[39;00m behaviour \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mmutation_behaviour]\n\u001B[0;32m 129\u001B[0m solutions \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39msolution_factory(generated)\n\u001B[0;32m 130\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mfiltering_memory_criterion\u001B[38;5;241m.\u001B[39mfilter(solutions)\n", + "File \u001B[1;32m~\\PycharmProjects\\sampo\\tabusearch\\tabu_search.py:128\u001B[0m, in \u001B[0;36m\u001B[1;34m(.0)\u001B[0m\n\u001B[0;32m 127\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mget_neighbours\u001B[39m(\u001B[38;5;28mself\u001B[39m, x: Solution) \u001B[38;5;241m-\u001B[39m\u001B[38;5;241m>\u001B[39m Iterable[Solution]:\n\u001B[1;32m--> 128\u001B[0m generated \u001B[38;5;241m=\u001B[39m [(behaviour\u001B[38;5;241m.\u001B[39mmutation_type, \u001B[43mbehaviour\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mmutate\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m)\u001B[49m) \u001B[38;5;28;01mfor\u001B[39;00m behaviour \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mmutation_behaviour]\n\u001B[0;32m 129\u001B[0m solutions \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39msolution_factory(generated)\n\u001B[0;32m 130\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mfiltering_memory_criterion\u001B[38;5;241m.\u001B[39mfilter(solutions)\n", + "File \u001B[1;32m~\\PycharmProjects\\sampo\\tabusearch\\mutation\\base.py:22\u001B[0m, in \u001B[0;36mMutationBehaviour.mutate\u001B[1;34m(self, pivot)\u001B[0m\n\u001B[0;32m 15\u001B[0m \u001B[38;5;250m\u001B[39m\u001B[38;5;124;03m\"\"\"\u001B[39;00m\n\u001B[0;32m 16\u001B[0m \u001B[38;5;124;03mMain interface for generation of new solution space.\u001B[39;00m\n\u001B[0;32m 17\u001B[0m \u001B[38;5;124;03m:param pivot: Previous solution, whom neighbourhood should be found.\u001B[39;00m\n\u001B[0;32m 18\u001B[0m \u001B[38;5;124;03m:return: New solution space.\u001B[39;00m\n\u001B[0;32m 19\u001B[0m \u001B[38;5;124;03m\"\"\"\u001B[39;00m\n\u001B[0;32m 20\u001B[0m \u001B[38;5;66;03m# TODO: erase\u001B[39;00m\n\u001B[0;32m 21\u001B[0m \u001B[38;5;66;03m# return [self._solution_factory(*mutation) for mutation in self._generate_mutations(pivot.position)]\u001B[39;00m\n\u001B[1;32m---> 22\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_generate_mutations\u001B[49m\u001B[43m(\u001B[49m\u001B[43mpivot\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mposition\u001B[49m\u001B[43m)\u001B[49m\n", + "File \u001B[1;32m~\\PycharmProjects\\sampo\\tabusearch\\experiments\\scheduling\\order_neighbourhood.py:73\u001B[0m, in \u001B[0;36mvariable_partitioning_order_shuffle\u001B[1;34m(ind, is_order_correct, distances, one_distance_trials, rng)\u001B[0m\n\u001B[0;32m 69\u001B[0m shuffled[trial_start:trial_start \u001B[38;5;241m+\u001B[39m distance] \\\n\u001B[0;32m 70\u001B[0m \u001B[38;5;241m=\u001B[39m shuffled[np_shuffled(np\u001B[38;5;241m.\u001B[39marange(trial_start, trial_start \u001B[38;5;241m+\u001B[39m distance))]\n\u001B[0;32m 72\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m is_order_correct(shuffled):\n\u001B[1;32m---> 73\u001B[0m result\u001B[38;5;241m.\u001B[39mappend((\u001B[43mind\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mcopy\u001B[49m\u001B[43m(\u001B[49m\u001B[43mactivity_list\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mshuffled\u001B[49m\u001B[43m)\u001B[49m, \u001B[38;5;124mf\u001B[39m\u001B[38;5;124m'\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mtrial_start\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m:\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mdistance\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;124m'\u001B[39m))\n\u001B[0;32m 75\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m result\n", + "File \u001B[1;32m~\\PycharmProjects\\sampo\\tabusearch\\utility\\chromosome.py:112\u001B[0m, in \u001B[0;36mChromosomeRW.copy\u001B[1;34m(self, **kwargs)\u001B[0m\n\u001B[0;32m 102\u001B[0m new_chromosome \u001B[38;5;241m=\u001B[39m \\\n\u001B[0;32m 103\u001B[0m ChromosomeRW(\u001B[38;5;241m*\u001B[39m\u001B[38;5;241m*\u001B[39m{\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mactivity_list\u001B[39m\u001B[38;5;124m'\u001B[39m: kwargs\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mactivity_list\u001B[39m\u001B[38;5;124m'\u001B[39m, \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_activity_list\u001B[38;5;241m.\u001B[39mcopy()),\n\u001B[0;32m 104\u001B[0m \u001B[38;5;124m'\u001B[39m\u001B[38;5;124mcontractor_resource_pools\u001B[39m\u001B[38;5;124m'\u001B[39m: kwargs\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mcontractor_resource_pools\u001B[39m\u001B[38;5;124m'\u001B[39m,\n\u001B[1;32m (...)\u001B[0m\n\u001B[0;32m 109\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_resource_activity_alloc\u001B[38;5;241m.\u001B[39mcopy()),\n\u001B[0;32m 110\u001B[0m \u001B[38;5;124m'\u001B[39m\u001B[38;5;124mvalidate_sizes\u001B[39m\u001B[38;5;124m'\u001B[39m: kwargs\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mvalidate_sizes\u001B[39m\u001B[38;5;124m'\u001B[39m, \u001B[38;5;28;01mFalse\u001B[39;00m)})\n\u001B[0;32m 111\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_rest_info:\n\u001B[1;32m--> 112\u001B[0m new_chromosome\u001B[38;5;241m.\u001B[39madd_rest_info(\u001B[38;5;241m*\u001B[39m\u001B[43mdeepcopy\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43m_rest_info\u001B[49m\u001B[43m)\u001B[49m)\n\u001B[0;32m 114\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m new_chromosome\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:146\u001B[0m, in \u001B[0;36mdeepcopy\u001B[1;34m(x, memo, _nil)\u001B[0m\n\u001B[0;32m 144\u001B[0m copier \u001B[38;5;241m=\u001B[39m _deepcopy_dispatch\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;28mcls\u001B[39m)\n\u001B[0;32m 145\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m copier \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[1;32m--> 146\u001B[0m y \u001B[38;5;241m=\u001B[39m \u001B[43mcopier\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 147\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m 148\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28missubclass\u001B[39m(\u001B[38;5;28mcls\u001B[39m, \u001B[38;5;28mtype\u001B[39m):\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:206\u001B[0m, in \u001B[0;36m_deepcopy_list\u001B[1;34m(x, memo, deepcopy)\u001B[0m\n\u001B[0;32m 204\u001B[0m append \u001B[38;5;241m=\u001B[39m y\u001B[38;5;241m.\u001B[39mappend\n\u001B[0;32m 205\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m a \u001B[38;5;129;01min\u001B[39;00m x:\n\u001B[1;32m--> 206\u001B[0m append(\u001B[43mdeepcopy\u001B[49m\u001B[43m(\u001B[49m\u001B[43ma\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m)\u001B[49m)\n\u001B[0;32m 207\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m y\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:172\u001B[0m, in \u001B[0;36mdeepcopy\u001B[1;34m(x, memo, _nil)\u001B[0m\n\u001B[0;32m 170\u001B[0m y \u001B[38;5;241m=\u001B[39m x\n\u001B[0;32m 171\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m--> 172\u001B[0m y \u001B[38;5;241m=\u001B[39m \u001B[43m_reconstruct\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mrv\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 174\u001B[0m \u001B[38;5;66;03m# If is its own copy, don't memoize.\u001B[39;00m\n\u001B[0;32m 175\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m y \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m x:\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:271\u001B[0m, in \u001B[0;36m_reconstruct\u001B[1;34m(x, memo, func, args, state, listiter, dictiter, deepcopy)\u001B[0m\n\u001B[0;32m 269\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m state \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[0;32m 270\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m deep:\n\u001B[1;32m--> 271\u001B[0m state \u001B[38;5;241m=\u001B[39m \u001B[43mdeepcopy\u001B[49m\u001B[43m(\u001B[49m\u001B[43mstate\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 272\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mhasattr\u001B[39m(y, \u001B[38;5;124m'\u001B[39m\u001B[38;5;124m__setstate__\u001B[39m\u001B[38;5;124m'\u001B[39m):\n\u001B[0;32m 273\u001B[0m y\u001B[38;5;241m.\u001B[39m__setstate__(state)\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:146\u001B[0m, in \u001B[0;36mdeepcopy\u001B[1;34m(x, memo, _nil)\u001B[0m\n\u001B[0;32m 144\u001B[0m copier \u001B[38;5;241m=\u001B[39m _deepcopy_dispatch\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;28mcls\u001B[39m)\n\u001B[0;32m 145\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m copier \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[1;32m--> 146\u001B[0m y \u001B[38;5;241m=\u001B[39m \u001B[43mcopier\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 147\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m 148\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28missubclass\u001B[39m(\u001B[38;5;28mcls\u001B[39m, \u001B[38;5;28mtype\u001B[39m):\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:231\u001B[0m, in \u001B[0;36m_deepcopy_dict\u001B[1;34m(x, memo, deepcopy)\u001B[0m\n\u001B[0;32m 229\u001B[0m memo[\u001B[38;5;28mid\u001B[39m(x)] \u001B[38;5;241m=\u001B[39m y\n\u001B[0;32m 230\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m key, value \u001B[38;5;129;01min\u001B[39;00m x\u001B[38;5;241m.\u001B[39mitems():\n\u001B[1;32m--> 231\u001B[0m y[deepcopy(key, memo)] \u001B[38;5;241m=\u001B[39m \u001B[43mdeepcopy\u001B[49m\u001B[43m(\u001B[49m\u001B[43mvalue\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 232\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m y\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:172\u001B[0m, in \u001B[0;36mdeepcopy\u001B[1;34m(x, memo, _nil)\u001B[0m\n\u001B[0;32m 170\u001B[0m y \u001B[38;5;241m=\u001B[39m x\n\u001B[0;32m 171\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m--> 172\u001B[0m y \u001B[38;5;241m=\u001B[39m \u001B[43m_reconstruct\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mrv\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 174\u001B[0m \u001B[38;5;66;03m# If is its own copy, don't memoize.\u001B[39;00m\n\u001B[0;32m 175\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m y \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m x:\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:297\u001B[0m, in \u001B[0;36m_reconstruct\u001B[1;34m(x, memo, func, args, state, listiter, dictiter, deepcopy)\u001B[0m\n\u001B[0;32m 295\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m key, value \u001B[38;5;129;01min\u001B[39;00m dictiter:\n\u001B[0;32m 296\u001B[0m key \u001B[38;5;241m=\u001B[39m deepcopy(key, memo)\n\u001B[1;32m--> 297\u001B[0m value \u001B[38;5;241m=\u001B[39m \u001B[43mdeepcopy\u001B[49m\u001B[43m(\u001B[49m\u001B[43mvalue\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 298\u001B[0m y[key] \u001B[38;5;241m=\u001B[39m value\n\u001B[0;32m 299\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:172\u001B[0m, in \u001B[0;36mdeepcopy\u001B[1;34m(x, memo, _nil)\u001B[0m\n\u001B[0;32m 170\u001B[0m y \u001B[38;5;241m=\u001B[39m x\n\u001B[0;32m 171\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[1;32m--> 172\u001B[0m y \u001B[38;5;241m=\u001B[39m \u001B[43m_reconstruct\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;241;43m*\u001B[39;49m\u001B[43mrv\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 174\u001B[0m \u001B[38;5;66;03m# If is its own copy, don't memoize.\u001B[39;00m\n\u001B[0;32m 175\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m y \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m x:\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:271\u001B[0m, in \u001B[0;36m_reconstruct\u001B[1;34m(x, memo, func, args, state, listiter, dictiter, deepcopy)\u001B[0m\n\u001B[0;32m 269\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m state \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[0;32m 270\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m deep:\n\u001B[1;32m--> 271\u001B[0m state \u001B[38;5;241m=\u001B[39m \u001B[43mdeepcopy\u001B[49m\u001B[43m(\u001B[49m\u001B[43mstate\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 272\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mhasattr\u001B[39m(y, \u001B[38;5;124m'\u001B[39m\u001B[38;5;124m__setstate__\u001B[39m\u001B[38;5;124m'\u001B[39m):\n\u001B[0;32m 273\u001B[0m y\u001B[38;5;241m.\u001B[39m__setstate__(state)\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:146\u001B[0m, in \u001B[0;36mdeepcopy\u001B[1;34m(x, memo, _nil)\u001B[0m\n\u001B[0;32m 144\u001B[0m copier \u001B[38;5;241m=\u001B[39m _deepcopy_dispatch\u001B[38;5;241m.\u001B[39mget(\u001B[38;5;28mcls\u001B[39m)\n\u001B[0;32m 145\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m copier \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[1;32m--> 146\u001B[0m y \u001B[38;5;241m=\u001B[39m \u001B[43mcopier\u001B[49m\u001B[43m(\u001B[49m\u001B[43mx\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 147\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m 148\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28missubclass\u001B[39m(\u001B[38;5;28mcls\u001B[39m, \u001B[38;5;28mtype\u001B[39m):\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:231\u001B[0m, in \u001B[0;36m_deepcopy_dict\u001B[1;34m(x, memo, deepcopy)\u001B[0m\n\u001B[0;32m 229\u001B[0m memo[\u001B[38;5;28mid\u001B[39m(x)] \u001B[38;5;241m=\u001B[39m y\n\u001B[0;32m 230\u001B[0m \u001B[38;5;28;01mfor\u001B[39;00m key, value \u001B[38;5;129;01min\u001B[39;00m x\u001B[38;5;241m.\u001B[39mitems():\n\u001B[1;32m--> 231\u001B[0m y[deepcopy(key, memo)] \u001B[38;5;241m=\u001B[39m \u001B[43mdeepcopy\u001B[49m\u001B[43m(\u001B[49m\u001B[43mvalue\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmemo\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 232\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m y\n", + "File \u001B[1;32m~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\copy.py:128\u001B[0m, in \u001B[0;36mdeepcopy\u001B[1;34m(x, memo, _nil)\u001B[0m\n\u001B[0;32m 124\u001B[0m d[PyStringMap] \u001B[38;5;241m=\u001B[39m PyStringMap\u001B[38;5;241m.\u001B[39mcopy\n\u001B[0;32m 126\u001B[0m \u001B[38;5;28;01mdel\u001B[39;00m d, t\n\u001B[1;32m--> 128\u001B[0m \u001B[38;5;28;01mdef\u001B[39;00m \u001B[38;5;21mdeepcopy\u001B[39m(x, memo\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mNone\u001B[39;00m, _nil\u001B[38;5;241m=\u001B[39m[]):\n\u001B[0;32m 129\u001B[0m \u001B[38;5;250m \u001B[39m\u001B[38;5;124;03m\"\"\"Deep copy operation on arbitrary Python objects.\u001B[39;00m\n\u001B[0;32m 130\u001B[0m \n\u001B[0;32m 131\u001B[0m \u001B[38;5;124;03m See the module's __doc__ string for more info.\u001B[39;00m\n\u001B[0;32m 132\u001B[0m \u001B[38;5;124;03m \"\"\"\u001B[39;00m\n\u001B[0;32m 134\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m memo \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n", + "\u001B[1;31mKeyboardInterrupt\u001B[0m: " ] } ], @@ -1064,8 +133,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-04-03T16:15:12.701994Z", - "start_time": "2024-04-03T16:07:38.668701300Z" + "end_time": "2024-04-06T15:17:29.179438900Z", + "start_time": "2024-04-06T14:56:19.246095400Z" } }, "id": "f6660d32cf8ab626", @@ -1073,28 +142,19 @@ }, { "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": "70" - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "schedule.execution_time" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2024-04-03T16:15:12.720993500Z", - "start_time": "2024-04-03T16:15:12.697994Z" + "end_time": "2024-04-06T14:02:48.788028300Z", + "start_time": "2024-04-06T14:02:48.783027500Z" } }, "id": "b1b74a82acd50d54", - "execution_count": 4 + "execution_count": null }, { "cell_type": "code", diff --git a/experiments/hybridisation.py b/experiments/hybridisation.py new file mode 100644 index 00000000..dcb53d13 --- /dev/null +++ b/experiments/hybridisation.py @@ -0,0 +1,65 @@ +import json + +import pathos +from tqdm import tqdm + +import sampo.scheduler +from sampo.backend.multiproc import MultiprocessingComputationalBackend + +from sampo.hybrid.population_tabu import TabuPopulationScheduler + +from sampo.hybrid.cycle import CycleHybridScheduler +from sampo.api.genetic_api import ScheduleGenerationScheme +from sampo.scheduler import HEFTScheduler, HEFTBetweenScheduler, TopologicalScheduler, GeneticScheduler +from sampo.hybrid.population import HeuristicPopulationScheduler, GeneticPopulationScheduler + +from sampo.generator.environment import get_contractor_by_wg +from sampo.generator import SimpleSynthetic + +from sampo.base import SAMPO +from sampo.schemas import WorkGraph + +def run_experiment(args): + graph_size, iteration = args + + heuristics = HeuristicPopulationScheduler([HEFTScheduler(), HEFTBetweenScheduler(), TopologicalScheduler()]) + # genetic1 = TabuPopulationScheduler() + genetic1 = GeneticPopulationScheduler(GeneticScheduler(mutate_order=0.2, + mutate_resources=0.2, + sgs_type=ScheduleGenerationScheme.Parallel)) + genetic2 = GeneticPopulationScheduler(GeneticScheduler(mutate_order=0.001, + mutate_resources=0.001, + sgs_type=ScheduleGenerationScheme.Parallel)) + + hybrid_combine = CycleHybridScheduler(heuristics, [genetic1, genetic2], max_plateau_size=1) + hybrid_genetic1 = CycleHybridScheduler(heuristics, [genetic1], max_plateau_size=1) + hybrid_genetic2 = CycleHybridScheduler(heuristics, [genetic2], max_plateau_size=1) + + wg = WorkGraph.load('wgs', f'{graph_size}_{iteration}') + contractors = [get_contractor_by_wg(wg)] + + # SAMPO.backend = MultiprocessingComputationalBackend(n_cpus=10) + SAMPO.backend.cache_scheduler_info(wg, contractors) + SAMPO.backend.cache_genetic_info() + + schedule_hybrid_combine = hybrid_combine.schedule(wg, contractors) + schedule_genetic1 = hybrid_genetic1.schedule(wg, contractors) + schedule_genetic2 = hybrid_genetic2.schedule(wg, contractors) + + # print(f'Hybrid combine: {schedule_hybrid_combine.execution_time}') + # print(f'Scheduler 1 cycled: {schedule_genetic1.execution_time}') + # print(f'Scheduler 2 cycled: {schedule_genetic2.execution_time}') + return schedule_hybrid_combine.execution_time, schedule_genetic1.execution_time, schedule_genetic2.execution_time + +if __name__ == '__main__': + arguments = [(graph_size, iteration) for graph_size in [100, 200, 300, 400, 500] for iteration in range(5)] + results = {graph_size: [] for graph_size in [100, 200, 300, 400, 500]} + + with pathos.multiprocessing.Pool(processes=11) as p: + r = p.map(run_experiment, arguments) + + for (graph_size, _), (combined_time, time1, time2) in zip(arguments, r): + results[graph_size].append((combined_time / time1, combined_time / time2)) + + with open('hybrid_results.json', 'w') as f: + json.dump(results, f) diff --git a/experiments/hybridisation_results_proc.py b/experiments/hybridisation_results_proc.py new file mode 100644 index 00000000..4fdf5d71 --- /dev/null +++ b/experiments/hybridisation_results_proc.py @@ -0,0 +1,20 @@ +import json +from itertools import chain +from random import Random + +import matplotlib.pyplot as plt + +with open('hybrid_results.json', 'r') as f: + results = json.load(f) + +results = {int(graph_size): [100 * (1 - res) for res in chain(*result)] + for graph_size, result in results.items()} +graph_sizes = results.keys() + +rand = Random() + +plt.title('Прирост качества планов\nот применения гибридизации', fontsize=16) +plt.xlabel('Размер графа') +plt.ylabel('% прироста качества относительно базового алгоритма') +plt.boxplot(results.values(), labels=graph_sizes) +plt.show() diff --git a/experiments/wg_generate.py b/experiments/wg_generate.py new file mode 100644 index 00000000..a35a3ac4 --- /dev/null +++ b/experiments/wg_generate.py @@ -0,0 +1,14 @@ +from sampo.generator import SimpleSynthetic + +from tqdm import tqdm + +ss = SimpleSynthetic(rand=231) + +for size in range(100, 500 + 1, 100): + for i in tqdm(range(100)): + wg = ss.work_graph(bottom_border=size - 5, + top_border=size) + while not (size - 5 <= wg.vertex_count <= size): + wg = ss.work_graph(bottom_border=size - 20, + top_border=size) + wg.dump('wgs', f'{size}_{i}') diff --git a/sampo/backend/multiproc.py b/sampo/backend/multiproc.py index f4dd03c7..944e0628 100644 --- a/sampo/backend/multiproc.py +++ b/sampo/backend/multiproc.py @@ -139,7 +139,11 @@ def cache_genetic_info(self, super().cache_genetic_info(population_size, mutate_order, mutate_resources, mutate_zones, deadline, weights, init_schedules, assigned_parent_time, fitness_weights, sgs_type, only_lft_initialization, is_multiobjective) - self._init_chromosomes = init_chromosomes_f(self._wg, self._contractors, init_schedules, self._landscape) + if init_schedules: + self._init_chromosomes = init_chromosomes_f(self._wg, self._contractors, init_schedules, + self._landscape) + else: + self._init_chromosomes = [] self._pool = None def compute_chromosomes(self, fitness: FitnessFunction, chromosomes: list[ChromosomeType]) -> list[float]: diff --git a/sampo/hybrid/cycle.py b/sampo/hybrid/cycle.py index 36038b73..79e2204f 100644 --- a/sampo/hybrid/cycle.py +++ b/sampo/hybrid/cycle.py @@ -39,10 +39,12 @@ def run(self, cur_fitness = Time.inf().value plateau_steps = 0 - while plateau_steps < self._max_plateau_size: + while True: pop_fitness = self._get_population_fitness(pop) if pop_fitness == cur_fitness: plateau_steps += 1 + if plateau_steps == self._max_plateau_size: + break else: plateau_steps = 0 cur_fitness = pop_fitness @@ -59,23 +61,7 @@ def schedule(self, assigned_parent_time: Time = Time(0), sgs_type: ScheduleGenerationScheme = ScheduleGenerationScheme.Parallel, landscape: LandscapeConfiguration = LandscapeConfiguration()) -> Schedule: - pop = self._starting_scheduler.schedule([], wg, contractors, spec, assigned_parent_time, landscape) - - cur_fitness = Time.inf().value - plateau_steps = 0 - - while plateau_steps < self._max_plateau_size: - pop_fitness = self._get_population_fitness(pop) - if pop_fitness == cur_fitness: - plateau_steps += 1 - else: - plateau_steps = 0 - cur_fitness = pop_fitness - - for scheduler in self._cycle_schedulers: - pop = scheduler.schedule(pop, wg, contractors, spec, assigned_parent_time, landscape) - - best_ind = self._get_best_individual(pop) + best_ind = self.run(wg, contractors, spec, assigned_parent_time, landscape) toolbox = create_toolbox(wg=wg, contractors=contractors, landscape=landscape, assigned_parent_time=assigned_parent_time, spec=spec, diff --git a/sampo/hybrid/population_tabu.py b/sampo/hybrid/population_tabu.py new file mode 100644 index 00000000..6812d77b --- /dev/null +++ b/sampo/hybrid/population_tabu.py @@ -0,0 +1,56 @@ +import numpy as np + +from sampo.api.genetic_api import ChromosomeType, FitnessFunction +from sampo.base import SAMPO +from sampo.hybrid.population import PopulationScheduler +from sampo.scheduler.genetic import TimeFitness +from sampo.scheduler.utils import get_worker_contractor_pool +from sampo.schemas import WorkGraph, Contractor, Time, LandscapeConfiguration +from sampo.schemas.schedule_spec import ScheduleSpec + +from sampo.scheduler.genetic.converter import ChromosomeType +from tabusearch.experiments.scheduling.fixtures import setup_toolbox + +from tabusearch.experiments.scheduling.scheduling_utils import get_optimiser, OptimiserLifetime +from tabusearch.utility.chromosome import ChromosomeRW + + +class TabuPopulationScheduler(PopulationScheduler): + + def __init__(self, fitness: FitnessFunction = TimeFitness()): + self._fitness = fitness + + def _get_population_fitness(self, pop: list[ChromosomeType]): + # return best chromosome's fitness + return min(SAMPO.backend.compute_chromosomes(self._fitness, pop)) + + def _get_best_individual(self, pop: list[ChromosomeType], fitness: list[float] | None = None) -> ChromosomeType: + fitness = fitness or SAMPO.backend.compute_chromosomes(self._fitness, pop) + return pop[np.argmin(fitness)] + + def schedule(self, + initial_population: list[ChromosomeType], + wg: WorkGraph, + contractors: list[Contractor], + spec: ScheduleSpec = ScheduleSpec(), + assigned_parent_time: Time = Time(0), + landscape: LandscapeConfiguration = LandscapeConfiguration()) -> list[ChromosomeType]: + tabu_toolbox = setup_toolbox(wg, contractors, get_worker_contractor_pool(contractors)) + + leader = self._get_best_individual(initial_population) + fitness = SAMPO.backend.compute_chromosomes(TimeFitness(), [leader]) + print(f'TABU initial fitness: {fitness}') + + tabu_leader = ChromosomeRW.from_sampo_chromosome(leader) + + opt_ord, opt_res = get_optimiser(tabu_toolbox, + use_vp=True, + optimisers_lifetime=OptimiserLifetime.Short) + tabu_leader = opt_ord.optimize(tabu_leader) + tabu_leader = opt_res.optimize(tabu_leader.position) + + chromosome = tabu_leader.position.to_sampo_chromosome() + fitness = SAMPO.backend.compute_chromosomes(TimeFitness(), [chromosome]) + print(f'TABU fitness: {fitness}') + + return initial_population + [chromosome] diff --git a/sampo/scheduler/base.py b/sampo/scheduler/base.py index 2df6c0a4..a060fcf2 100644 --- a/sampo/scheduler/base.py +++ b/sampo/scheduler/base.py @@ -102,6 +102,9 @@ def optimize_resources_using_spec(work_unit: WorkUnit, worker_team: list[Worker] data in its closure and run optimization process when receives `optimize_array`. Passing None or default value means this function should only apply spec. """ + worker_reqs = set(wr.kind for wr in work_unit.worker_reqs) + worker_team = [worker for worker in worker_team if worker.name in worker_reqs] + if len(work_spec.assigned_workers) == len(work_unit.worker_reqs): # all resources passed in spec, skipping optimize_resources step for worker in worker_team: diff --git a/sampo/scheduler/genetic/schedule_builder.py b/sampo/scheduler/genetic/schedule_builder.py index 10b7c10c..caada9eb 100644 --- a/sampo/scheduler/genetic/schedule_builder.py +++ b/sampo/scheduler/genetic/schedule_builder.py @@ -130,7 +130,7 @@ def build_schedules_with_cache(wg: WorkGraph, init_schedules: dict[str, tuple[Schedule, list[GraphNode] | None, ScheduleSpec, float]], rand: random.Random, spec: ScheduleSpec, - weights: list[int], + weights: list[int] = None, pop: list[ChromosomeType] = None, landscape: LandscapeConfiguration = LandscapeConfiguration(), fitness_object: FitnessFunction = TimeFitness(), @@ -176,15 +176,19 @@ def build_schedules_with_cache(wg: WorkGraph, init_schedules, assigned_parent_time, fitness_weights, sgs_type, only_lft_initialization, is_multiobjective) - # create population of a given size - pop = pop or SAMPO.backend.generate_first_population(population_size) - SAMPO.logger.info(f'Toolbox initialization & first population took {(time.time() - start) * 1000} ms') have_deadline = deadline is not None fitness_f = fitness_object if not have_deadline else TimeFitness() if have_deadline: toolbox.register_individual_constructor((-1,)) + + # create population of a given size + if pop is None: + pop = SAMPO.backend.generate_first_population(population_size) + else: + pop = [toolbox.Individual(chromosome) for chromosome in pop] + evaluation_start = time.time() hof = tools.ParetoFront(similar=compare_individuals)