From 4df8ebe245e9e2ebad022246823d1104a00d56d9 Mon Sep 17 00:00:00 2001 From: Winni <winnus@posteo.de> Date: Mon, 19 Jun 2023 09:12:31 +0200 Subject: [PATCH] v0.01 Multiple island models, operator stacks, first operators, evolutionary phases, python process pool paralelization, experiments and first simple fitness function tested. --- .gitignore | 26 + diagramms/Evolution_02.drawio | 492 +++++++++ diagramms/Evolution_03.drawio | 493 +++++++++ diagramms/Evolutionary_phase_00.drawio | 121 +++ src/PyGMA.ipynb | 1360 +++++++++++++++++++++++- src/config.py | 105 ++ src/controller.py | 254 +++++ src/evolutionary_phase.py | 61 ++ src/experiment.py | 92 ++ src/genetic_operators.py | 135 +++ src/individual.py | 7 + src/population.py | 118 ++ src/population_old.py | 33 + src/testing_notebook.ipynb | 363 +++++++ 14 files changed, 3659 insertions(+), 1 deletion(-) create mode 100755 diagramms/Evolution_02.drawio create mode 100755 diagramms/Evolution_03.drawio create mode 100755 diagramms/Evolutionary_phase_00.drawio create mode 100755 src/config.py create mode 100755 src/controller.py create mode 100755 src/evolutionary_phase.py create mode 100755 src/experiment.py create mode 100755 src/genetic_operators.py create mode 100755 src/individual.py create mode 100755 src/population.py create mode 100755 src/population_old.py create mode 100755 src/testing_notebook.ipynb diff --git a/.gitignore b/.gitignore index 9dff1a6..c12ea59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,30 @@ # no ipython checkpoints *.ipynb_checkpoints +# IPython +profile_default/ +ipython_config.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + + +# no drawio backups +*.bkp + + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + diff --git a/diagramms/Evolution_02.drawio b/diagramms/Evolution_02.drawio new file mode 100755 index 0000000..b8ec2ea --- /dev/null +++ b/diagramms/Evolution_02.drawio @@ -0,0 +1,492 @@ +<mxfile host="Electron" modified="2023-06-05T12:06:50.225Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.2.8 Chrome/112.0.5615.165 Electron/24.2.0 Safari/537.36" etag="UTpLcjPi-5bOA8WhXdmH" version="21.2.8" type="device"> + <diagram name="Page-1" id="ZgEUCu97vCsvLgyVy6hc"> + <mxGraphModel dx="1968" dy="2938" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-17" value="Population" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-800" y="340" width="250" height="270" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-8" value="+ population_index: int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="26" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-18" value="+ population_name: string" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="52" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-33" value="+ epoch_counter: int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="78" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-100" value="+ individuals: array" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="104" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-29" value="+ operator: operator" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="130" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-90" value="+ mean_individual_fitness: float" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="156" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-19" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="182" width="250" height="8" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-64" value="+ instantiate_individuals()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="190" width="250" height="28" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-20" value="+ recombine(operator(g_0, g_1))" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="218" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-8" value="+ apply_operator(operator)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="244" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-21" value="Individual" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-60" y="164" width="160" height="138" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-22" value="+ gene: array " style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-21" vertex="1"> + <mxGeometry y="26" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-25" value="+ fitness: float" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-21" vertex="1"> + <mxGeometry y="52" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-99" value="+ population: population" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-21" vertex="1"> + <mxGeometry y="78" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-23" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="fyUvw5QtPV9Wiu8gB0H8-21" vertex="1"> + <mxGeometry y="104" width="160" height="8" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-24" value="+ method(type): type" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-21" vertex="1"> + <mxGeometry y="112" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-26" value="World_controller" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-445" width="330" height="112" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-27" value="+ populations: array(Populatoon" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-26" vertex="1"> + <mxGeometry y="26" width="330" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-51" value="+ epoch: int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-26" vertex="1"> + <mxGeometry y="52" width="330" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-28" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="fyUvw5QtPV9Wiu8gB0H8-26" vertex="1"> + <mxGeometry y="78" width="330" height="8" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-29" value="+ epoch()&nbsp;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-26" vertex="1"> + <mxGeometry y="86" width="330" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-30" value="<b><font style="font-size: 30px;">Class diagramms</font></b>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="-520" y="-130" width="270" height="50" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-31" value="<font size="1"><b style="font-size: 30px;">Flowchart</b></font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1735" y="-240" width="160" height="50" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-34" value="main" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1735" y="-180" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-115" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="fyUvw5QtPV9Wiu8gB0H8-35" target="YBbd6qHGsjDS6U28tkjz-114" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="fyUvw5QtPV9Wiu8gB0H8-35" target="YBbd6qHGsjDS6U28tkjz-9" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1580.0000000000005" y="160.00000000000023" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-35" value="mpi?" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.decision;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="1745" y="156" width="100" height="100" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-42" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1875" y="174" width="30" height="30" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-45" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1695" y="173" width="30" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-1" value="since the programm will be run as sbatch<br>and the like it is nice if there is at least one<br>place to define all the params and a contfig file might be nice<br>Read config herer for decide if mpi shall be used or not.<br>Make this file a python dict that is imported in the end<br><br>This step includes to define all user functions like experiments and&nbsp; on_init...<br>It will load all these functions from the respective files and pass them to the controller instance or the worker instance" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1465" y="-110" width="640" height="130" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-32" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-9" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1600" y="640" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-172" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-9" target="YBbd6qHGsjDS6U28tkjz-168" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-9" value="CONTROLLER<br>INIT" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="500" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-30" value="Think:<br>&nbsp;operators distributed among different populations (each has one)<br>and then let the populations meet at some point to make new population.<br>Which operator to use then for this population? the one from each?<br>Or make thwo populations one with each operator?<br>Which populations to ditch then to not reach more then max? (just make not more then N*2 Pops )<br><br>Maybe for the name of a population make a random string which can reflect from which indexes the populations where made<br>so it is possible in the end to track how the most fittest individuan emerged.<br>It would be good since then one would have a "stammbaum" for each individual and as such can<br>Decide if population fusion/combination is bringing good :)<br>also for master thesis evolver this could be helpfull to understand the algorithm.<br><br><div>having n operrators per pop and the abbillity to produce w new offsprings per op.</div><div>If to much &gt; pop sixe warning</div><div>Does the combining of ops yeld better results? maybe a performance test.</div><div>for islands merge one could think of own operators that are used only for merging!?</div><div>Then leave the option to take ops for the fusioned pops from the pop's they wehere fusioned, maybe also randomly?</div><div>Is there a way to incorporate fremde dna?</div><div>maybe keep it simple as possible but keep the design options to easly extend.</div><div>See the whole as planning ordering building traineing fo you</div>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="-820" y="28" width="680" height="320" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-33" target="YBbd6qHGsjDS6U28tkjz-34" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-33" value="while Controller.fitness or Controller.epochs&nbsp;" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.loop_limit;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="1550" y="640" width="100" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-37" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-34" target="YBbd6qHGsjDS6U28tkjz-36" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-39" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-34" target="YBbd6qHGsjDS6U28tkjz-36" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-42" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-34" target="YBbd6qHGsjDS6U28tkjz-40" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-49" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-34" target="YBbd6qHGsjDS6U28tkjz-45" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-34" target="6sdkXRkWTDobi1n3qOID-22" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-34" value="Controller.epoch()" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="838" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-36" value="population.mutate()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1281" y="838" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-38" value="call mutate on all the populations" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1240" y="797" width="200" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-40" value="population.recombine(<br>operator(g_0,g_1))" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1281" y="1148" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-44" value="will create N new individuals based on the the operators<br>&nbsp;and replace them with the last in the list.<br>N &lt;= popsize, if N==popsize no elitism :)" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1220" y="1095" width="320" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-176" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-45" target="YBbd6qHGsjDS6U28tkjz-173" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-45" value="population.instantiiate_<br>individuals(mpi=true)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1281" y="990" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-50" value="Here the fitness value will be evaluated by conducting the experiment<br>Based on bool mpi use the mpi passing model<br>or the process pool model to distribute the genes from<br>the populations to the experiments." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1126" y="918" width="390" height="70" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-52" value="Experiment" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-520" y="777" width="160" height="164" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-53" value="+ inputs: ?" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="26" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-54" value="+ outputs:?" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="52" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-57" value="+ Environment" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="78" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-35" value="+ Fitness_function?" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="104" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-55" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="130" width="160" height="8" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-56" value="+ ?" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="138" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-58" value="Environment" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-256" y="826" width="230" height="112" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-59" value="+ name: string" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-58" vertex="1"> + <mxGeometry y="26" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-62" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="YBbd6qHGsjDS6U28tkjz-58" vertex="1"> + <mxGeometry y="52" width="230" height="8" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-63" value="+ instantiate_individual(gene)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-58" vertex="1"> + <mxGeometry y="60" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-34" value="+ save_instantiation(filename, gene)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-58" vertex="1"> + <mxGeometry y="86" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-85" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-74" target="YBbd6qHGsjDS6U28tkjz-75" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-88" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-74" target="YBbd6qHGsjDS6U28tkjz-87" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-74" target="6sdkXRkWTDobi1n3qOID-21" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-74" value="Combine populations into new one?" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.decision;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="1550" y="1394" width="100" height="100" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-75" target="6sdkXRkWTDobi1n3qOID-16" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-75" value="Controller.<br>population_fusion<br>(Indexes)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1213" y="1414" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-79" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1511" y="1418" width="30" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-80" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1650" y="1414" width="30" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-81" value="There needs to be some configurable parameter maybe:<br>&nbsp;epochs<br>certain change in fitness<br>Gene diversity<br>&nbsp;on which to start this combination process.<br>Gene diversity tracking and if it stagnates then this could be called<br>Experiment or fitness function could also set a flag to call this<br>in the next round" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1416" y="1217" width="380" height="130" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-97" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="6sdkXRkWTDobi1n3qOID-21" target="YBbd6qHGsjDS6U28tkjz-96" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1590" y="2020" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-86" value="This will fusion the populations at the indexes inside the Controller<br>Population array. It will allow therefore to choose not only the fittest<br>But also random choices possible.<br>How to fusion populations?<br>Apply the genetic operators on them to create new individuals.<br>Make two pops, one with the operator from population one, one from the other one" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1022" y="1314" width="460" height="100" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-87" value="Controller.<br>population_removal<br>(Indexes)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1206" y="1700" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-89" value="Since new populations are there the need to shrink.<br>Indexes for more option.<br>But generally take the ones with the worst fitness.<br>But it might be okay to first test the newly generated because to make sure that you<br>do not remove some that are better then the newly generated?<br>So here a eval and experimental step of the new populations could be helpfull.<br>And generally it might be good for the diversity to keel the old populations?<br>Maybe make a switch for that so these are kept anyway?<br>Could be done in a index selection function" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1013" y="1547" width="470" height="140" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-102" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-96" target="YBbd6qHGsjDS6U28tkjz-101" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-96" value="Controller.<br>get_fittest(N)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="1860" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-98" value="Get the N fittest members from all populations.<br>Display some information about them" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1473" y="1800" width="270" height="40" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-105" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-101" target="YBbd6qHGsjDS6U28tkjz-104" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-101" value="Controller.<br>experiment.<br>world.<br>instantiate(gene)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="2025" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-103" value="Instantiate the most fittest ones so that one can work with them&nbsp;" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1436" y="1966" width="360" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-104" value="Save" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="2220" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-106" value="Save the results:<br>the most fittest genes<br>the instantiation of the most fittest genes.<br>The instantiation is saved via the method the<br>experiment/world is implementing.<br>If it is not implementing such save feature one can save the gene string and pass&nbsp;<br>it to the representative function in the world to get something usefull" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1375" y="2099" width="460" height="110" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-108" value="+ save_instantiation(gene):<br>Will save the instantiation of the individual<br>This will allow it for further use and<br>reflects the result of the genetic algorithm.<br><br>instantiate_individual(gene) will use the fitness funtion to test the individual?<br>Or will it make the object (a logic circuit) which is then passed back to the Experiment<br>Which will then evaluate it based on the fitness function?" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="-256" y="698" width="480" height="130" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-161" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-114" target="YBbd6qHGsjDS6U28tkjz-9" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1970.0000000000005" y="363" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-162" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-114" target="YBbd6qHGsjDS6U28tkjz-116" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="2377.5" y="440" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-114" value="controller or<br>Worker?" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.decision;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="2315" y="236" width="100" height="100" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-122" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-116" target="YBbd6qHGsjDS6U28tkjz-121" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-116" value="Init_Worker<br>Wait for work" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="2589" y="320" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-128" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-121" target="YBbd6qHGsjDS6U28tkjz-125" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-131" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-121" target="YBbd6qHGsjDS6U28tkjz-130" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-121" value="get_gene()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2590" y="462" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-125" value="EXPERIMENT<br>WORKFLOW" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2373" y="461" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-130" value="return fitness" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2589" y="600" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-133" value="Controller init&nbsp;" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontStyle=1;fontSize=30;fontColor=#006600;" parent="1" vertex="1"> + <mxGeometry x="1010" y="186" width="230" height="50" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-151" value="Experiment workflow" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontStyle=1;fontSize=30;fontColor=#006600;" parent="1" vertex="1"> + <mxGeometry x="2089.5" y="748" width="330" height="50" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-152" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-154" target="YBbd6qHGsjDS6U28tkjz-155" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-153" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-154" target="YBbd6qHGsjDS6U28tkjz-156" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-10" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-154" target="6sdkXRkWTDobi1n3qOID-9" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-154" value="experiment.<br>test_individual(gene)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2253" y="1060" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-155" value="world.instantiate_<br>individual(gene)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2053" y="1060" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-156" value="world.test_<br>individual(input, outputs)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2049" y="1190" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-157" value="These are all objects where each object is one experiment(with its world)<br>on one individual.<br>As such this can be passed to a worker wrapper and here<br>for each individual a own worker process is generated testing the individual and<br>returns the fitness value, or whatever value is represented." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="2069" y="797" width="450" height="90" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-159" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="fyUvw5QtPV9Wiu8gB0H8-34" target="YBbd6qHGsjDS6U28tkjz-158" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1795" y="-120" as="sourcePoint" /> + <mxPoint x="1795" y="156" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-160" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-158" target="fyUvw5QtPV9Wiu8gB0H8-35" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-158" value="read_config()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1735" y="26" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-164" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-165" target="YBbd6qHGsjDS6U28tkjz-169" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-165" value="init_populations()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1053" y="500" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-166" value="will create a population with given params<br>will create all gene strings and the like" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="985" y="435" width="250" height="40" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-167" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-168" target="YBbd6qHGsjDS6U28tkjz-165" edge="1"> + <mxGeometry relative="1" as="geometry"> + <Array as="points"> + <mxPoint x="1216" y="530" /> + <mxPoint x="1216" y="530" /> + </Array> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-168" value="Controlller = world_controller()" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1306" y="500" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-169" value="init_individ.()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="730" y="500" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-170" value="Will create the individuals inside the population.<br>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="650" y="445" width="280" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-171" value="World_controller will handle all the populations<br>the genetic operators applied and<br>has functons to mutate&nbsp;<br>as well as produce offsprings.<br>This is but just a bridge that calls all these funcitons&nbsp;<br>on the populations itself." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="960" y="291" width="300" height="100" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-180" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-173" target="YBbd6qHGsjDS6U28tkjz-177" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-181" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-173" target="YBbd6qHGsjDS6U28tkjz-179" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-173" value="use MPI?" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.decision;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="860" y="1050" width="100" height="100" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-177" value="pass genes to MPI workers" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1000" y="1130" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-183" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-179" target="YBbd6qHGsjDS6U28tkjz-182" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-179" value="pass genes to process worker que/wrapper" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="620" y="1130" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-185" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-182" target="YBbd6qHGsjDS6U28tkjz-184" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-182" value="proces_pool_worker<br>wrapper function" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="620" y="1270" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-184" value="EXERIMENT<br>WORKFLOW" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="620" y="1410" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="6sdkXRkWTDobi1n3qOID-1" target="YBbd6qHGsjDS6U28tkjz-154" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-1" value="Init_experiment()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2253" y="912" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-4" value="Init experiment will need to read all its own experiment configurations from its own config file.<br>This way the experiment can be treated independently from the Controller config." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="2090" y="983" width="520" height="40" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-9" value="Contrpoller call_gene_modification" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2253" y="1392" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-11" value="This could be a module/interface in which the fitness function can advise the controller to&nbsp;<br>Apply specific genetic operators, like the gene string extending operator<br>Recombine new populations<br>build entire new populations<br>sort out some populations.<br>Basically a function which can be called with differient params to achieve the above behaviour<br>Or maybe more a set of functions in the controller class that can be called if needed here from the experiment." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="2010" y="1260" width="610" height="110" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="6sdkXRkWTDobi1n3qOID-16" target="YBbd6qHGsjDS6U28tkjz-173" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-16" value="instantiate<br>individuals of new pops" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="850" y="1414" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-19" value="This is necessary to ensure that the<br>population and the individuals got<br>fitness values" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="812" y="1340" width="210" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-29" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="6sdkXRkWTDobi1n3qOID-21" target="YBbd6qHGsjDS6U28tkjz-33" edge="1"> + <mxGeometry relative="1" as="geometry"> + <Array as="points"> + <mxPoint x="1870" y="1650" /> + <mxPoint x="1870" y="670" /> + </Array> + </mxGeometry> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-21" value="print or log information about epoch" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="1620" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-26" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="6sdkXRkWTDobi1n3qOID-22" target="YBbd6qHGsjDS6U28tkjz-74" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-22" value="check if the algorithm stagnates (no diversity)" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="1148" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-30" value="World<br>experiment<br>controller<br>populations<br>individuals<br>operators" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="2880" y="1223" width="80" height="100" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-31" value="controller.pops_stagnation_check()<br>make all of these functions to have a better code overview" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1545" y="1080" width="330" height="40" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-32" value="On all populations set the epoch counder one up<br>so again you would pack this here into functions.<br>Like _populatios.mutat()<br>_populations_instantiate()<br>_populations_apply_operatos()" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1193" y="700" width="280" height="90" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-1" value="Operator_interface" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-297" y="480" width="230" height="86" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-2" value="+ name: string" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="2305VUciKoEtOX_F4iJQ-1" vertex="1"> + <mxGeometry y="26" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-3" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="2305VUciKoEtOX_F4iJQ-1" vertex="1"> + <mxGeometry y="52" width="230" height="8" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-4" value="+ apply_operator(gene_0, gene_1)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="2305VUciKoEtOX_F4iJQ-1" vertex="1"> + <mxGeometry y="60" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-6" value="Thies will be an interface to the operators used to produce offsprings<br>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="-390" y="435" width="390" height="30" as="geometry" /> + </mxCell> + <mxCell id="ju8TFpcfmoSFrrAgH8_M-1" value="Gene_modification_interface" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="130" y="460" width="230" height="86" as="geometry" /> + </mxCell> + <mxCell id="ju8TFpcfmoSFrrAgH8_M-2" value="+ name: string" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="ju8TFpcfmoSFrrAgH8_M-1" vertex="1"> + <mxGeometry y="26" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="ju8TFpcfmoSFrrAgH8_M-3" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="ju8TFpcfmoSFrrAgH8_M-1" vertex="1"> + <mxGeometry y="52" width="230" height="8" as="geometry" /> + </mxCell> + <mxCell id="ju8TFpcfmoSFrrAgH8_M-5" value="+ apply_modification(gene_0)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="ju8TFpcfmoSFrrAgH8_M-1" vertex="1"> + <mxGeometry y="60" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="ju8TFpcfmoSFrrAgH8_M-6" value="Unlike an operator here it is clear that no new offrprings will be generated<br>Here an inplace modification takes place like extending the gene string&nbsp;<br>or do something else with it" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="15" y="395" width="410" height="60" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-1" value="population.mutate()" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="3438" y="977" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-2" value="call mutate on all the populations" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1"> + <mxGeometry x="3397" y="936" width="200" height="30" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-3" value="population.recombine(<br>operator(g_0,g_1))" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="3438" y="1287" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-4" value="population.instantiiate_<br>individuals(mpi=true)" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="3438" y="1129" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-5" value="On all populations set the epoch counder one up<br>so again you would pack this here into functions.<br>Like _populatios.mutat()<br>_populations_instantiate()<br>_populations_apply_operatos()" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1"> + <mxGeometry x="3350" y="839" width="280" height="90" as="geometry" /> + </mxCell> + </root> + </mxGraphModel> + </diagram> +</mxfile> diff --git a/diagramms/Evolution_03.drawio b/diagramms/Evolution_03.drawio new file mode 100755 index 0000000..da58e8f --- /dev/null +++ b/diagramms/Evolution_03.drawio @@ -0,0 +1,493 @@ +<mxfile host="Electron" modified="2023-06-07T08:04:09.576Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.2.8 Chrome/112.0.5615.165 Electron/24.2.0 Safari/537.36" etag="9CxsecTT4_spO_kGUgh1" version="21.2.8" type="device"> + <diagram name="Page-1" id="ZgEUCu97vCsvLgyVy6hc"> + <mxGraphModel dx="1605" dy="2632" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-17" value="Population" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-800" y="340" width="250" height="270" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-8" value="+ population_index: int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="26" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-18" value="+ population_name: string" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="52" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-33" value="+ epoch_counter: int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="78" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-100" value="+ individuals: array" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="104" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-29" value="+ operator: operator" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="130" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-90" value="+ mean_individual_fitness: float" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="156" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-19" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="182" width="250" height="8" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-64" value="+ instantiate_individuals()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="190" width="250" height="28" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-20" value="+ recombine(operator(g_0, g_1))" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="218" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-8" value="+ apply_operator(operator)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-17" vertex="1"> + <mxGeometry y="244" width="250" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-21" value="Individual" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-60" y="164" width="160" height="138" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-22" value="+ gene: array " style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-21" vertex="1"> + <mxGeometry y="26" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-25" value="+ fitness: float" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-21" vertex="1"> + <mxGeometry y="52" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-99" value="+ population: population" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-21" vertex="1"> + <mxGeometry y="78" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-23" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="fyUvw5QtPV9Wiu8gB0H8-21" vertex="1"> + <mxGeometry y="104" width="160" height="8" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-24" value="+ method(type): type" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-21" vertex="1"> + <mxGeometry y="112" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-26" value="World_controller" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-445" width="330" height="112" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-27" value="+ populations: array(Populatoon" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-26" vertex="1"> + <mxGeometry y="26" width="330" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-51" value="+ epoch: int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-26" vertex="1"> + <mxGeometry y="52" width="330" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-28" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="fyUvw5QtPV9Wiu8gB0H8-26" vertex="1"> + <mxGeometry y="78" width="330" height="8" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-29" value="+ epoch()&nbsp;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="fyUvw5QtPV9Wiu8gB0H8-26" vertex="1"> + <mxGeometry y="86" width="330" height="26" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-30" value="<b><font style="font-size: 30px;">Class diagramms</font></b>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="-520" y="-130" width="270" height="50" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-31" value="<font size="1"><b style="font-size: 30px;">Flowchart</b></font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1735" y="-240" width="160" height="50" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-34" value="main" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1735" y="-180" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-115" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="fyUvw5QtPV9Wiu8gB0H8-35" target="YBbd6qHGsjDS6U28tkjz-114" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="fyUvw5QtPV9Wiu8gB0H8-35" target="YBbd6qHGsjDS6U28tkjz-9" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1580.0000000000005" y="160.00000000000023" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-35" value="mpi?" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.decision;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="1745" y="156" width="100" height="100" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-42" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1875" y="174" width="30" height="30" as="geometry" /> + </mxCell> + <mxCell id="fyUvw5QtPV9Wiu8gB0H8-45" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1695" y="173" width="30" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-1" value="since the programm will be run as sbatch<br>and the like it is nice if there is at least one<br>place to define all the params and a contfig file might be nice<br>Read config herer for decide if mpi shall be used or not.<br>Make this file a python dict that is imported in the end<br><br>This step includes to define all user functions like experiments and&nbsp; on_init...<br>It will load all these functions from the respective files and pass them to the controller instance or the worker instance" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1465" y="-110" width="640" height="130" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-172" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="YBbd6qHGsjDS6U28tkjz-9" target="YBbd6qHGsjDS6U28tkjz-168" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="TjDierjk1-rNDTtvZhPD-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-9" target="TjDierjk1-rNDTtvZhPD-2" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-9" value="CONTROLLER<br>INIT" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="500" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-30" value="Think:<br>&nbsp;operators distributed among different populations (each has one)<br>and then let the populations meet at some point to make new population.<br>Which operator to use then for this population? the one from each?<br>Or make thwo populations one with each operator?<br>Which populations to ditch then to not reach more then max? (just make not more then N*2 Pops )<br><br>Maybe for the name of a population make a random string which can reflect from which indexes the populations where made<br>so it is possible in the end to track how the most fittest individuan emerged.<br>It would be good since then one would have a "stammbaum" for each individual and as such can<br>Decide if population fusion/combination is bringing good :)<br>also for master thesis evolver this could be helpfull to understand the algorithm.<br><br><div>having n operrators per pop and the abbillity to produce w new offsprings per op.</div><div>If to much &gt; pop sixe warning</div><div>Does the combining of ops yeld better results? maybe a performance test.</div><div>for islands merge one could think of own operators that are used only for merging!?</div><div>Then leave the option to take ops for the fusioned pops from the pop's they wehere fusioned, maybe also randomly?</div><div>Is there a way to incorporate fremde dna?</div><div>maybe keep it simple as possible but keep the design options to easly extend.</div><div>See the whole as planning ordering building traineing fo you</div>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="-820" y="28" width="680" height="320" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-33" target="YBbd6qHGsjDS6U28tkjz-34" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-33" value="while phase not completed" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.loop_limit;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="1550" y="640" width="100" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-42" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="YBbd6qHGsjDS6U28tkjz-34" target="YBbd6qHGsjDS6U28tkjz-40" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-49" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-34" target="YBbd6qHGsjDS6U28tkjz-45" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-34" target="6sdkXRkWTDobi1n3qOID-22" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-34" target="HAsKsfTJxQwT5OBsK-yM-7" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-34" value="Controller.epoch()" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="838" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-40" value="controller.apply_<br>operators()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1281" y="1163" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-44" value="Will apply all the operators a population has<br>"operator stack"<br>Mutate, crossover, permutation, addtion/deletion etc<br>The operators are used defined and can be stacked into the<br>populations to have them do certain things" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1171" y="1055" width="340" height="90" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-176" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="YBbd6qHGsjDS6U28tkjz-45" target="YBbd6qHGsjDS6U28tkjz-173" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-45" value="population.instantiiate_<br>individuals(mpi=true)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1281" y="838" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-50" value="On all populations set the epoch counder one up<br style="border-color: var(--border-color);">so again you would pack this here into functions.<br style="border-color: var(--border-color);">Like:<br style="border-color: var(--border-color);">_populations_instantiate()<br style="border-color: var(--border-color);">_populations_apply_operatos()<br><br>Here the fitness value will be evaluated by conducting the experiment<br>Based on bool mpi use the mpi passing model<br>or the process pool model to distribute the genes from<br>the populations to the experiments." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1146" y="668" width="390" height="160" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-52" value="Experiment" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-520" y="777" width="160" height="164" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-53" value="+ inputs: ?" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="26" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-54" value="+ outputs:?" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="52" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-57" value="+ Environment" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="78" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-35" value="+ Fitness_function?" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="104" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-55" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="130" width="160" height="8" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-56" value="+ ?" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-52" vertex="1"> + <mxGeometry y="138" width="160" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-58" value="Environment" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-256" y="826" width="230" height="112" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-59" value="+ name: string" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-58" vertex="1"> + <mxGeometry y="26" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-62" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="YBbd6qHGsjDS6U28tkjz-58" vertex="1"> + <mxGeometry y="52" width="230" height="8" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-63" value="+ instantiate_individual(gene)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-58" vertex="1"> + <mxGeometry y="60" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-34" value="+ save_instantiation(filename, gene)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="YBbd6qHGsjDS6U28tkjz-58" vertex="1"> + <mxGeometry y="86" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-85" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-74" target="YBbd6qHGsjDS6U28tkjz-75" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-88" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-74" target="YBbd6qHGsjDS6U28tkjz-87" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-74" target="6sdkXRkWTDobi1n3qOID-21" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-74" value="Combine populations into new one?" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.decision;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="1550" y="1394" width="100" height="100" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-75" target="6sdkXRkWTDobi1n3qOID-16" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-75" value="Controller.<br>population_fusion<br>(Indexes)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1213" y="1414" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-79" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1511" y="1418" width="30" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-80" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1650" y="1414" width="30" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-81" value="There needs to be some configurable parameter maybe:<br>&nbsp;epochs<br>certain change in fitness<br>Gene diversity<br>&nbsp;on which to start this combination process.<br>Gene diversity tracking and if it stagnates then this could be called<br>Experiment or fitness function could also set a flag to call this<br>in the next round" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1416" y="1217" width="380" height="130" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-97" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="6sdkXRkWTDobi1n3qOID-21" target="YBbd6qHGsjDS6U28tkjz-96" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1590" y="2020" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-86" value="This will fusion the populations at the indexes inside the Controller<br>Population array. It will allow therefore to choose not only the fittest<br>But also random choices possible.<br>How to fusion populations?<br>Apply the genetic operators on them to create new individuals.<br>Make two pops, one with the operator from population one, one from the other one" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1022" y="1314" width="460" height="100" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-87" value="Controller.<br>population_removal<br>(Indexes)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1206" y="1700" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-89" value="Since new populations are there the need to shrink.<br>Indexes for more option.<br>But generally take the ones with the worst fitness.<br>But it might be okay to first test the newly generated because to make sure that you<br>do not remove some that are better then the newly generated?<br>So here a eval and experimental step of the new populations could be helpfull.<br>And generally it might be good for the diversity to keel the old populations?<br>Maybe make a switch for that so these are kept anyway?<br>Could be done in a index selection function" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1013" y="1547" width="470" height="140" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-102" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-96" target="YBbd6qHGsjDS6U28tkjz-101" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-96" value="Controller.<br>get_fittest(N)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="1860" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-98" value="Get the N fittest members from all populations.<br>Display some information about them" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1473" y="1800" width="270" height="40" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-105" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-101" target="YBbd6qHGsjDS6U28tkjz-104" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-101" value="Controller.<br>experiment.<br>world.<br>instantiate(gene)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="2025" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-103" value="Instantiate the most fittest ones so that one can work with them&nbsp;" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1436" y="1966" width="360" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-104" value="Save" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="2220" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-106" value="Save the results:<br>the most fittest genes<br>the instantiation of the most fittest genes.<br>The instantiation is saved via the method the<br>experiment/world is implementing.<br>If it is not implementing such save feature one can save the gene string and pass&nbsp;<br>it to the representative function in the world to get something usefull" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1375" y="2099" width="460" height="110" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-108" value="+ save_instantiation(gene):<br>Will save the instantiation of the individual<br>This will allow it for further use and<br>reflects the result of the genetic algorithm.<br><br>instantiate_individual(gene) will use the fitness funtion to test the individual?<br>Or will it make the object (a logic circuit) which is then passed back to the Experiment<br>Which will then evaluate it based on the fitness function?" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="-256" y="698" width="480" height="130" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-161" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="YBbd6qHGsjDS6U28tkjz-114" target="YBbd6qHGsjDS6U28tkjz-9" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1970.0000000000005" y="363" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-162" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-114" target="YBbd6qHGsjDS6U28tkjz-116" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="2377.5" y="440" as="sourcePoint" /> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-114" value="controller or<br>Worker?" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.decision;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="2315" y="236" width="100" height="100" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-122" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-116" target="YBbd6qHGsjDS6U28tkjz-121" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-116" value="Init_Worker<br>Wait for work" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="2589" y="320" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-128" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-121" target="YBbd6qHGsjDS6U28tkjz-125" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-131" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-121" target="YBbd6qHGsjDS6U28tkjz-130" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-121" value="get_gene()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2590" y="462" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-125" value="EXPERIMENT<br>WORKFLOW" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2373" y="461" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-130" value="return fitness" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2589" y="600" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-133" value="Controller init&nbsp;" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontStyle=1;fontSize=30;fontColor=#006600;" parent="1" vertex="1"> + <mxGeometry x="1010" y="186" width="230" height="50" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-151" value="Experiment workflow" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontStyle=1;fontSize=30;fontColor=#006600;" parent="1" vertex="1"> + <mxGeometry x="2089.5" y="748" width="330" height="50" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-152" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-154" target="YBbd6qHGsjDS6U28tkjz-155" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-153" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-154" target="YBbd6qHGsjDS6U28tkjz-156" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-10" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-154" target="6sdkXRkWTDobi1n3qOID-9" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-154" value="experiment.<br>test_individual(gene)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2253" y="1060" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-155" value="world.instantiate_<br>individual(gene)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2053" y="1060" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-156" value="world.test_<br>individual(input, outputs)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2049" y="1190" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-157" value="These are all objects where each object is one experiment(with its world)<br>on one individual.<br>As such this can be passed to a worker wrapper and here<br>for each individual a own worker process is generated testing the individual and<br>returns the fitness value, or whatever value is represented." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="2069" y="797" width="450" height="90" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-159" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="fyUvw5QtPV9Wiu8gB0H8-34" target="YBbd6qHGsjDS6U28tkjz-158" edge="1"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="1795" y="-120" as="sourcePoint" /> + <mxPoint x="1795" y="156" as="targetPoint" /> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-160" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="YBbd6qHGsjDS6U28tkjz-158" target="fyUvw5QtPV9Wiu8gB0H8-35" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-158" value="read_config()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1735" y="26" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-164" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="YBbd6qHGsjDS6U28tkjz-165" target="YBbd6qHGsjDS6U28tkjz-169" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-165" value="init_populations()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1053" y="500" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-166" value="will create a population with given params<br>will create all gene strings and the like" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="985" y="435" width="250" height="40" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-167" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="YBbd6qHGsjDS6U28tkjz-168" target="YBbd6qHGsjDS6U28tkjz-165" edge="1"> + <mxGeometry relative="1" as="geometry"> + <Array as="points"> + <mxPoint x="1216" y="530" /> + <mxPoint x="1216" y="530" /> + </Array> + </mxGeometry> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-168" value="Controlller = world_controller()" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1306" y="500" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-169" value="init_individ.()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="730" y="500" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-170" value="Will create the individuals inside the population.<br>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="650" y="445" width="280" height="30" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-171" value="World_controller will handle all the populations<br>the genetic operators applied and<br>has functons to mutate&nbsp;<br>as well as produce offsprings.<br>This is but just a bridge that calls all these funcitons&nbsp;<br>on the populations itself." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="960" y="291" width="300" height="100" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-180" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="YBbd6qHGsjDS6U28tkjz-173" target="YBbd6qHGsjDS6U28tkjz-177" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-181" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="YBbd6qHGsjDS6U28tkjz-173" target="YBbd6qHGsjDS6U28tkjz-179" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-173" value="use MPI?" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.decision;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="860" y="1050" width="100" height="100" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-177" value="pass genes to MPI workers" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1000" y="1130" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-183" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="YBbd6qHGsjDS6U28tkjz-179" target="YBbd6qHGsjDS6U28tkjz-182" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-179" value="pass genes to process worker que/wrapper" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="620" y="1130" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-185" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="YBbd6qHGsjDS6U28tkjz-182" target="YBbd6qHGsjDS6U28tkjz-184" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-182" value="proces_pool_worker<br>wrapper function" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="620" y="1270" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="YBbd6qHGsjDS6U28tkjz-184" value="EXERIMENT<br>WORKFLOW" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="620" y="1410" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="6sdkXRkWTDobi1n3qOID-1" target="YBbd6qHGsjDS6U28tkjz-154" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-1" value="Init_experiment()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2253" y="912" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-4" value="Init experiment will need to read all its own experiment configurations from its own config file.<br>This way the experiment can be treated independently from the Controller config." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="2090" y="983" width="520" height="40" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-9" value="Contrpoller call_gene_modification" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="2253" y="1392" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-11" value="This could be a module/interface in which the fitness function can advise the controller to&nbsp;<br>Apply specific genetic operators, like the gene string extending operator<br>Recombine new populations<br>build entire new populations<br>sort out some populations.<br>Basically a function which can be called with differient params to achieve the above behaviour<br>Or maybe more a set of functions in the controller class that can be called if needed here from the experiment." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="2010" y="1260" width="610" height="110" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="6sdkXRkWTDobi1n3qOID-16" target="YBbd6qHGsjDS6U28tkjz-173" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-16" value="instantiate<br>individuals of new pops" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="850" y="1414" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-19" value="This is necessary to ensure that the<br>population and the individuals got<br>fitness values" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="812" y="1340" width="210" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-29" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="6sdkXRkWTDobi1n3qOID-21" target="YBbd6qHGsjDS6U28tkjz-33" edge="1"> + <mxGeometry relative="1" as="geometry"> + <Array as="points"> + <mxPoint x="1870" y="1650" /> + <mxPoint x="1870" y="670" /> + </Array> + </mxGeometry> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-21" value="print or log information about epoch" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="1620" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-26" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="6sdkXRkWTDobi1n3qOID-22" target="YBbd6qHGsjDS6U28tkjz-74" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-22" value="check if the algorithm stagnates (no diversity)" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="1540" y="1148" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-30" value="World<br>experiment<br>controller<br>populations<br>individuals<br>operators" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="2880" y="1223" width="80" height="100" as="geometry" /> + </mxCell> + <mxCell id="6sdkXRkWTDobi1n3qOID-31" value="controller.pops_stagnation_check()<br>config.stagnation_test_true?<br>Have stagnation operators (like a heavy mutation)<br>Or revombination operators that merge two populations?<br>Stop this behaviour automatically if stagnation resolved (how to check? with epoch and diversity tracking))<br>or does this makes sense as one could restart the algo right away?<br>Think it makes sense as stucking in a local optima can maybe be changed by having high exploration (mutation)" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1500" y="1010" width="620" height="110" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-1" value="Operator_interface" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="-297" y="480" width="230" height="86" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-2" value="+ name: string" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="2305VUciKoEtOX_F4iJQ-1" vertex="1"> + <mxGeometry y="26" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-3" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="2305VUciKoEtOX_F4iJQ-1" vertex="1"> + <mxGeometry y="52" width="230" height="8" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-4" value="+ apply_operator(gene_0, gene_1)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="2305VUciKoEtOX_F4iJQ-1" vertex="1"> + <mxGeometry y="60" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="2305VUciKoEtOX_F4iJQ-6" value="Thies will be an interface to the operators used to produce offsprings<br>since they replace the whole old genes:<br>case:<br>op_0 and op_1 want to add.<br>have a rmoval operator that removes n weak members and then you can add them in the stack<br>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="-460" y="355" width="530" height="90" as="geometry" /> + </mxCell> + <mxCell id="ju8TFpcfmoSFrrAgH8_M-1" value="Gene_modification_interface" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxGeometry x="130" y="460" width="230" height="86" as="geometry" /> + </mxCell> + <mxCell id="ju8TFpcfmoSFrrAgH8_M-2" value="+ name: string" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="ju8TFpcfmoSFrrAgH8_M-1" vertex="1"> + <mxGeometry y="26" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="ju8TFpcfmoSFrrAgH8_M-3" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="ju8TFpcfmoSFrrAgH8_M-1" vertex="1"> + <mxGeometry y="52" width="230" height="8" as="geometry" /> + </mxCell> + <mxCell id="ju8TFpcfmoSFrrAgH8_M-5" value="+ apply_modification(gene_0)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="ju8TFpcfmoSFrrAgH8_M-1" vertex="1"> + <mxGeometry y="60" width="230" height="26" as="geometry" /> + </mxCell> + <mxCell id="ju8TFpcfmoSFrrAgH8_M-6" value="Unlike an operator here it is clear that no new offrprings will be generated<br>Here an inplace modification takes place like extending the gene string&nbsp;<br>or do something else with it" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="15" y="395" width="410" height="60" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-1" value="population.mutate()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="3438" y="977" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-2" value="call mutate on all the populations" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="3397" y="936" width="200" height="30" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-3" value="population.recombine(<br>operator(g_0,g_1))" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="3438" y="1287" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-4" value="population.instantiiate_<br>individuals(mpi=true)" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="3438" y="1129" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-5" value="On all populations set the epoch counder one up<br>so again you would pack this here into functions.<br>Like _populatios.mutat()<br>_populations_instantiate()<br>_populations_apply_operatos()" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="3350" y="839" width="280" height="90" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-7" value="Controller.sort_<br>population_<br>individuals()" style="whiteSpace=wrap;html=1;rounded=1;" parent="1" vertex="1"> + <mxGeometry x="1281" y="983" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="HAsKsfTJxQwT5OBsK-yM-9" value="Will sort the population individuals based on their fitness" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1206" y="938" width="320" height="30" as="geometry" /> + </mxCell> + <mxCell id="TjDierjk1-rNDTtvZhPD-1" value="Idea, define evolutional phases.<br>controller has phase array<br>loops and asks if phase.phase_completed(population_fitness, epochs): init_new_phase(phase_shift_operators)<br>mpiw knows from (gene, phase) which experiment he shall coduct<br>Each phase has its own:<br>Opearator stack (no! this is population specific!) it can create new populations or modifie the ones given when it starts (an thus can change the operators)<br>start_one_time_operator_stack<br>and abbility to call a population fusion/modification setup<br>experiment<br><br><br>Now it is definend on which fitness or value the cotnroller shall switch into the new phase (phase.phase_copmleted()<br>by doing that he will:<br>&nbsp;change its operator stack<br>change the experiment<br>apply phase operators (that can extend the genes or remove some)<br>Recombine new populations<br style="border-color: var(--border-color);">build entire new populations<br style="border-color: var(--border-color);">sort out some populations.<br>stuff like this.&nbsp;<br>Then it will swicht to the new phase." style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1"> + <mxGeometry x="1915" y="1475" width="840" height="320" as="geometry" /> + </mxCell> + <mxCell id="TjDierjk1-rNDTtvZhPD-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="TjDierjk1-rNDTtvZhPD-2" target="YBbd6qHGsjDS6U28tkjz-33" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="TjDierjk1-rNDTtvZhPD-2" value="for all phases" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.loop_limit;whiteSpace=wrap;" parent="1" vertex="1"> + <mxGeometry x="1550" y="566" width="100" height="60" as="geometry" /> + </mxCell> + </root> + </mxGraphModel> + </diagram> +</mxfile> diff --git a/diagramms/Evolutionary_phase_00.drawio b/diagramms/Evolutionary_phase_00.drawio new file mode 100755 index 0000000..d3c76a9 --- /dev/null +++ b/diagramms/Evolutionary_phase_00.drawio @@ -0,0 +1,121 @@ +<mxfile host="Electron" modified="2023-06-07T07:59:49.940Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.2.8 Chrome/112.0.5615.165 Electron/24.2.0 Safari/537.36" etag="YgHwFUcc9r55OOwR9qNA" version="21.2.8" type="device"> + <diagram name="Page-1" id="2i5Abm-Dt_nIWe2C1-qx"> + <mxGraphModel dx="1687" dy="986" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-4" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-2" target="4sxowvsSm-NQVkN4Gn7M-3"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-2" target="4sxowvsSm-NQVkN4Gn7M-5"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-2" value="PHASE_0" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1"> + <mxGeometry x="320" y="360" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-44" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-3" target="4sxowvsSm-NQVkN4Gn7M-29"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-3" value="PHASHE_1" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="980" y="360" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-12" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-5" target="4sxowvsSm-NQVkN4Gn7M-11"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-5" value="INIT" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="320" y="500" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-16" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;curved=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-7" target="4sxowvsSm-NQVkN4Gn7M-14"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-7" value="PHASE_DONE?" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="320" y="780" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-27" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-11" target="4sxowvsSm-NQVkN4Gn7M-7"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-11" value="START_OPERATORS" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="320" y="640" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-18" value="" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;curved=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-14" target="4sxowvsSm-NQVkN4Gn7M-17"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-14" value="EXPERIMENTS" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="550" y="880" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-20" value="" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;curved=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-17" target="4sxowvsSm-NQVkN4Gn7M-19"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-17" value="OPERATOR<br>STACK" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="550" y="1010" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-22" value="" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;curved=1;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-19" target="4sxowvsSm-NQVkN4Gn7M-21"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-19" value="STAGNATION<br>CHECK" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="320" y="1110" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-24" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-21" target="4sxowvsSm-NQVkN4Gn7M-23"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-21" value="ISLAND<br>FUSION" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="110" y="1000" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-25" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;curved=1;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-23" target="4sxowvsSm-NQVkN4Gn7M-7"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-23" value="STAGNATION<br>OPERATORS" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="110" y="850" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-28" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-29" target="4sxowvsSm-NQVkN4Gn7M-33"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-29" value="INIT" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="980" y="530" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-30" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;curved=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-31" target="4sxowvsSm-NQVkN4Gn7M-35"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-31" value="PHASE_DONE?" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="980" y="810" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-32" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-33" target="4sxowvsSm-NQVkN4Gn7M-31"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-33" value="START_OPERATORS" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="980" y="670" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-34" value="" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;curved=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-35" target="4sxowvsSm-NQVkN4Gn7M-37"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-35" value="EXPERIMENTS" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="1210" y="910" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-36" value="" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;curved=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-37" target="4sxowvsSm-NQVkN4Gn7M-39"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-37" value="OPERATOR<br>STACK" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="1210" y="1040" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-38" value="" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;curved=1;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-39" target="4sxowvsSm-NQVkN4Gn7M-41"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-39" value="STAGNATION<br>CHECK" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="980" y="1140" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-40" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-41" target="4sxowvsSm-NQVkN4Gn7M-43"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-41" value="ISLAND<br>FUSION" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="770" y="1030" width="120" height="60" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-42" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;curved=1;" edge="1" parent="1" source="4sxowvsSm-NQVkN4Gn7M-43" target="4sxowvsSm-NQVkN4Gn7M-31"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <mxCell id="4sxowvsSm-NQVkN4Gn7M-43" value="STAGNATION<br>OPERATORS" style="whiteSpace=wrap;html=1;rounded=1;" vertex="1" parent="1"> + <mxGeometry x="770" y="880" width="120" height="60" as="geometry" /> + </mxCell> + </root> + </mxGraphModel> + </diagram> +</mxfile> diff --git a/src/PyGMA.ipynb b/src/PyGMA.ipynb index 78d7a30..a15835f 100755 --- a/src/PyGMA.ipynb +++ b/src/PyGMA.ipynb @@ -2,9 +2,1367 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "1c9a80e2-37b8-46f5-94ba-d547329f2234", "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Init controller\n", + "[<population.Population object at 0x7f1e2039f650>, <population.Population object at 0x7f1e203f9b90>, <population.Population object at 0x7f1e203fa350>]\n", + "[<genetic_operators.Removal_operator object at 0x7f1e4a7542d0>, <genetic_operators.Single_point_crossover_operator object at 0x7f1e4a7747d0>]\n", + "[ True False False False False True False False True True True False\n", + " False False False True False True False True False True True True\n", + " True True False True False True True False False True True True\n", + " True False True True False True True False False True False True\n", + " False False False True False False True True False True True True]\n", + "Evolutionary phase Phase_0\n", + "epoch 0, Pop max fitness [9.925775054145103e-07, 2.12027020723521e-06, 1.6586828731041255e-06]\n", + "epoch 1, Pop max fitness [1.3549254249046132e-06, 1.545657167057718e-06, 1.9955061202172707e-06]\n", + "epoch 2, Pop max fitness [1.3549254249046132e-06, 1.585273443816324e-06, 0.0005668934240362812]\n", + "epoch 3, Pop max fitness [2.2883504654504845e-06, 3.542180282807674e-06, 3.122268015486449e-05]\n", + "epoch 4, Pop max fitness [2.2883504654504845e-06, 4.140598150808866e-06, 1.0268627289903886e-05]\n", + "epoch 5, Pop max fitness [2.2883504654504845e-06, 3.443455025033918e-06, 4.2322668020992044e-05]\n", + "epoch 6, Pop max fitness [2.2883504654504845e-06, 3.4950614781314002e-06, 0.0005347593582887701]\n", + "epoch 7, Pop max fitness [2.320476347384591e-06, 4.202051441513747e-06, 0.0005347593582887701]\n", + "epoch 8, Pop max fitness [2.841118946285805e-06, 1.0342972984154565e-05, 2.7753878604534985e-05]\n", + "epoch 9, Pop max fitness [2.841118946285805e-06, 2.738000711880185e-05, 9.838646202282565e-05]\n", + "epoch 10, Pop max fitness [2.841118946285805e-06, 1.7602224921230043e-05, 0.0007262164124909223]\n", + "epoch 11, Pop max fitness [2.841118946285805e-06, 0.00011133377866844801, 0.0078125]\n", + "epoch 12, Pop max fitness [2.841118946285805e-06, 1.8345930872532473e-05, 0.0005875440658049354]\n", + "epoch 13, Pop max fitness [2.841118946285805e-06, 1.8117254873541563e-05, 0.00023529411764705883]\n", + "epoch 14, Pop max fitness [3.054386404315237e-06, 6.878052135635188e-05, 6.046680372475511e-05]\n", + "epoch 15, Pop max fitness [3.054386404315237e-06, 9.405568096313017e-05, 6.383657835939994e-05]\n", + "epoch 16, Pop max fitness [3.054386404315237e-06, 0.00010121457489878542, 8.246062505153789e-05]\n", + "epoch 17, Pop max fitness [3.054386404315237e-06, 2.684275514038761e-05, 0.00018642803877703205]\n", + "epoch 18, Pop max fitness [3.054386404315237e-06, 0.0003891050583657588, 0.00012208521548040532]\n", + "epoch 19, Pop max fitness [3.054386404315237e-06, 7.651109410864575e-05, 0.00012682308180088776]\n", + "epoch 20, Pop max fitness [3.054386404315237e-06, 9.793360101850946e-05, 0.011235955056179775]\n", + "epoch 21, Pop max fitness [3.054386404315237e-06, 0.0010660980810234541, 0.00012729124236252545]\n", + "epoch 22, Pop max fitness [3.054386404315237e-06, 0.001597444089456869, 5.140595280933532e-05]\n", + "epoch 23, Pop max fitness [3.054386404315237e-06, 0.015625, 0.00023952095808383233]\n", + "epoch 24, Pop max fitness [3.054386404315237e-06, 4.11370274383973e-05, 0.00022026431718061675]\n", + "epoch 25, Pop max fitness [3.054386404315237e-06, 7.530120481927712e-05, 0.00034698126301179735]\n", + "epoch 26, Pop max fitness [3.054386404315237e-06, 7.551159102922299e-05, 6.390593047034765e-05]\n", + "epoch 27, Pop max fitness [3.054386404315237e-06, 3.292831505811848e-05, 6.503219093451258e-05]\n", + "epoch 28, Pop max fitness [3.054386404315237e-06, 5.421817393190197e-05, 3.566969859104691e-05]\n", + "epoch 29, Pop max fitness [3.054386404315237e-06, 8.86839304717985e-05, 0.0002969121140142518]\n", + "epoch 30, Pop max fitness [3.054386404315237e-06, 4.1981528127623844e-05, 0.0007102272727272727]\n", + "epoch 31, Pop max fitness [3.054386404315237e-06, 2.4898538455792647e-05, 9.588647041902388e-05]\n", + "epoch 32, Pop max fitness [3.054386404315237e-06, 3.6621987841500034e-05, 0.00022401433691756272]\n", + "epoch 33, Pop max fitness [3.054386404315237e-06, 1.4829094683769556e-05, 0.00015328019619865113]\n", + "epoch 34, Pop max fitness [3.054386404315237e-06, 1.4829974344144385e-05, 0.0002069108214359611]\n", + "epoch 35, Pop max fitness [3.054386404315237e-06, 2.9383245673317074e-05, 0.0015015015015015015]\n", + "epoch 36, Pop max fitness [3.054386404315237e-06, 3.2156408772268315e-05, 0.0002018978396931153]\n", + "epoch 37, Pop max fitness [3.054386404315237e-06, 6.165988407941794e-05, 0.0011389521640091116]\n", + "epoch 38, Pop max fitness [3.054386404315237e-06, 5.3239631581749454e-05, 0.002207505518763797]\n", + "epoch 39, Pop max fitness [3.054386404315237e-06, 0.00011065619121389841, 0.0015220700152207]\n", + "epoch 40, Pop max fitness [3.054386404315237e-06, 4.957120904178853e-05, 0.0035460992907801418]\n", + "epoch 41, Pop max fitness [3.054386404315237e-06, 0.0001771479185119575, 0.00017406440382941688]\n", + "epoch 42, Pop max fitness [3.054386404315237e-06, 0.0002595380223202699, 6.509992839007877e-05]\n", + "epoch 43, Pop max fitness [3.054386404315237e-06, 0.002793296089385475, 0.0025]\n", + "epoch 44, Pop max fitness [3.054386404315237e-06, 7.204610951008646e-05, 9.007386056566384e-05]\n", + "epoch 45, Pop max fitness [3.054386404315237e-06, 2.8506271379703534e-05, 2.896703551358554e-05]\n", + "epoch 46, Pop max fitness [3.054386404315237e-06, 0.00012610340479192938, 3.5258444397433186e-05]\n", + "epoch 47, Pop max fitness [3.054386404315237e-06, 5.7766737912310095e-05, 3.5124692658939236e-05]\n", + "epoch 48, Pop max fitness [3.054386404315237e-06, 0.00022558087074216106, 5.733944954128441e-05]\n", + "epoch 49, Pop max fitness [3.054386404315237e-06, 0.00018162005085361425, 5.126627704296114e-05]\n", + "epoch 50, Pop max fitness [3.054386404315237e-06, 0.0001444460494005489, 8.568246080027418e-05]\n", + "epoch 51, Pop max fitness [3.054386404315237e-06, 0.0007369196757553427, 0.0004508566275924256]\n", + "epoch 52, Pop max fitness [3.054386404315237e-06, 0.0016181229773462784, 8.340979230961715e-05]\n", + "epoch 53, Pop max fitness [3.054386404315237e-06, 5.709717939933767e-05, 5.5154155865644475e-05]\n", + "epoch 54, Pop max fitness [3.054386404315237e-06, 6.145148405333988e-05, 3.765769158350593e-05]\n", + "epoch 55, Pop max fitness [3.054386404315237e-06, 2.1634251346732147e-05, 9.709680551509856e-05]\n", + "epoch 56, Pop max fitness [3.054386404315237e-06, 7.544892108042855e-05, 5.426819341184132e-05]\n", + "epoch 57, Pop max fitness [3.054386404315237e-06, 8.532423208191126e-05, 4.411505205576143e-05]\n", + "epoch 58, Pop max fitness [3.054386404315237e-06, 8.628127696289905e-05, 3.7085110328203226e-05]\n", + "epoch 59, Pop max fitness [3.054386404315237e-06, 8.771929824561403e-05, 0.0001545833977430824]\n", + "epoch 60, Pop max fitness [3.054386404315237e-06, 9.74184120798831e-05, 3.963064241271351e-05]\n", + "epoch 61, Pop max fitness [3.054386404315237e-06, 0.00020234722784297855, 4.732831653178096e-05]\n", + "epoch 62, Pop max fitness [3.054386404315237e-06, 0.00010932546190007652, 0.00010136847440446021]\n", + "epoch 63, Pop max fitness [3.054386404315237e-06, 0.00023741690408357076, 0.0001002004008016032]\n", + "epoch 64, Pop max fitness [3.054386404315237e-06, 0.00019201228878648233, 3.435717721432007e-05]\n", + "epoch 65, Pop max fitness [3.054386404315237e-06, 0.0005449591280653951, 4.0064102564102564e-05]\n", + "epoch 66, Pop max fitness [3.054386404315237e-06, 0.000576036866359447, 4.369101712687871e-05]\n", + "epoch 67, Pop max fitness [3.054386404315237e-06, 0.0003246753246753247, 4.416570974295557e-05]\n", + "epoch 68, Pop max fitness [3.054386404315237e-06, 0.0008090614886731392, 3.009419482981733e-05]\n", + "epoch 69, Pop max fitness [3.054386404315237e-06, 0.00015477480266212662, 4.02592696968477e-05]\n", + "epoch 70, Pop max fitness [3.054386404315237e-06, 0.00010147133434804668, 0.00011189437171310283]\n", + "epoch 71, Pop max fitness [3.054386404315237e-06, 0.0005117707267144319, 0.00011129660545353366]\n", + "epoch 72, Pop max fitness [3.054386404315237e-06, 0.0006261740763932373, 0.0001514004542013626]\n", + "epoch 73, Pop max fitness [3.054386404315237e-06, 0.00042211903756859433, 6.01286753652817e-05]\n", + "epoch 74, Pop max fitness [3.054386404315237e-06, 6.44039415212211e-05, 0.0001661405549094534]\n", + "epoch 75, Pop max fitness [3.054386404315237e-06, 3.28709486555782e-05, 0.00030674846625766873]\n", + "epoch 76, Pop max fitness [3.054386404315237e-06, 3.402865212508933e-05, 0.0017985611510791368]\n", + "epoch 77, Pop max fitness [3.054386404315237e-06, 5.2656521510189036e-05, 0.0006724949562878278]\n", + "epoch 78, Pop max fitness [3.054386404315237e-06, 2.9463759575721862e-05, 0.02702702702702703]\n", + "epoch 79, Pop max fitness [3.054386404315237e-06, 1.963286541670757e-05, 0.0009216589861751152]\n", + "epoch 80, Pop max fitness [3.054386404315237e-06, 1.8372221201543268e-05, 0.0021929824561403508]\n", + "epoch 81, Pop max fitness [3.054386404315237e-06, 1.8422652493506014e-05, 0.005780346820809248]\n", + "epoch 82, Pop max fitness [3.054386404315237e-06, 0.0008149959250203749, 0.005128205128205128]\n", + "epoch 83, Pop max fitness [3.054386404315237e-06, 0.000333000333000333, 0.00012283503255128362]\n", + "epoch 84, Pop max fitness [3.054386404315237e-06, 2.399232245681382e-05, 0.00026845637583892615]\n", + "epoch 85, Pop max fitness [3.054386404315237e-06, 7.984031936127745e-05, 0.008849557522123894]\n", + "epoch 86, Pop max fitness [3.054386404315237e-06, 6.868131868131868e-05, 0.0007288629737609329]\n", + "epoch 87, Pop max fitness [3.054386404315237e-06, 0.0007112375533428165, 0.0001820498816675769]\n", + "epoch 88, Pop max fitness [3.054386404315237e-06, 4.699689820471849e-05, 0.0001199760047990402]\n", + "epoch 89, Pop max fitness [3.054386404315237e-06, 1.8361426315596197e-05, 0.0001010611419909045]\n", + "epoch 90, Pop max fitness [3.054386404315237e-06, 8.724480893386844e-05, 0.00013008976193573565]\n", + "epoch 91, Pop max fitness [3.054386404315237e-06, 8.01153661272232e-05, 0.00020496003279360525]\n", + "epoch 92, Pop max fitness [3.054386404315237e-06, 6.368209896198179e-05, 0.0008802816901408451]\n", + "epoch 93, Pop max fitness [3.054386404315237e-06, 4.345181194055792e-05, 0.00031725888324873094]\n", + "epoch 94, Pop max fitness [3.054386404315237e-06, 6.72314105149926e-05, 0.00015842839036755386]\n", + "epoch 95, Pop max fitness [3.054386404315237e-06, 8.594018563080097e-05, 0.00031776294884016526]\n", + "epoch 96, Pop max fitness [3.054386404315237e-06, 0.000471253534401508, 0.00012330456226880394]\n", + "epoch 97, Pop max fitness [3.054386404315237e-06, 0.00010109179134654265, 0.00016954899966090201]\n", + "epoch 98, Pop max fitness [3.054386404315237e-06, 0.0012804097311139564, 0.00018221574344023323]\n", + "epoch 99, Pop max fitness [3.054386404315237e-06, 0.00032690421706440013, 0.00010206164523372117]\n", + "epoch 100, Pop max fitness [3.054386404315237e-06, 0.00015229972586049346, 0.0006203473945409429]\n", + "epoch 101, Pop max fitness [3.054386404315237e-06, 5.547542438699656e-05, 0.0005241090146750524]\n", + "epoch 102, Pop max fitness [3.054386404315237e-06, 0.007407407407407408, 0.0013227513227513227]\n", + "epoch 103, Pop max fitness [3.054386404315237e-06, 2.5145213608589605e-05, 0.00013377926421404682]\n", + "epoch 104, Pop max fitness [3.054386404315237e-06, 2.4183796856106408e-05, 0.00012344155042587335]\n", + "epoch 105, Pop max fitness [3.054386404315237e-06, 0.0001874062968515742, 0.0006402048655569782]\n", + "epoch 106, Pop max fitness [3.054386404315237e-06, 1.360655291588429e-05, 0.002824858757062147]\n", + "epoch 107, Pop max fitness [3.054386404315237e-06, 5.4344872561273845e-05, 0.0001123721766490617]\n", + "epoch 108, Pop max fitness [3.054386404315237e-06, 8.161932745674175e-05, 6.605892456070815e-05]\n", + "epoch 109, Pop max fitness [3.054386404315237e-06, 0.0003717472118959108, 0.0015625]\n", + "epoch 110, Pop max fitness [3.054386404315237e-06, 4.8666536889234965e-05, 5.883391186680002e-05]\n", + "epoch 111, Pop max fitness [3.054386404315237e-06, 8.33472245374229e-05, 0.001053740779768177]\n", + "epoch 112, Pop max fitness [3.054386404315237e-06, 2.6375481352534682e-05, 0.0002063557573256294]\n", + "epoch 113, Pop max fitness [3.054386404315237e-06, 4.5964331678617394e-05, 0.00014771048744460856]\n", + "epoch 114, Pop max fitness [3.054386404315237e-06, 3.5923411287135827e-05, 6.952169076751947e-05]\n", + "epoch 115, Pop max fitness [3.054386404315237e-06, 4.19533478771606e-05, 5.1535765821480104e-05]\n", + "epoch 116, Pop max fitness [3.054386404315237e-06, 4.32264199878966e-05, 0.0002206531332744925]\n", + "epoch 117, Pop max fitness [3.054386404315237e-06, 1.3482540110556829e-05, 5.972288580984233e-05]\n", + "epoch 118, Pop max fitness [3.054386404315237e-06, 9.675484257987112e-06, 0.004310344827586207]\n", + "epoch 119, Pop max fitness [3.054386404315237e-06, 0.00019554165037152912, 0.000141622999575131]\n", + "epoch 120, Pop max fitness [3.054386404315237e-06, 4.211590296495957e-05, 9.664917316632357e-06]\n", + "epoch 121, Pop max fitness [3.054386404315237e-06, 0.00018165304268846503, 9.072352007257882e-06]\n", + "epoch 122, Pop max fitness [3.054386404315237e-06, 4.2780748663101606e-05, 8.56677803478112e-05]\n", + "epoch 123, Pop max fitness [3.054386404315237e-06, 1.598261091931978e-05, 0.0016260162601626016]\n", + "epoch 124, Pop max fitness [3.054386404315237e-06, 1.8243847262510718e-05, 5.79609343302614e-05]\n", + "epoch 125, Pop max fitness [3.054386404315237e-06, 0.00020755500207555002, 4.9137634514274483e-05]\n", + "epoch 126, Pop max fitness [3.054386404315237e-06, 7.237984944991314e-05, 0.00018165304268846503]\n", + "epoch 127, Pop max fitness [3.054386404315237e-06, 3.936078091789341e-05, 4.154031487558676e-05]\n", + "epoch 128, Pop max fitness [3.054386404315237e-06, 5.245488879563575e-05, 0.008403361344537815]\n", + "epoch 129, Pop max fitness [3.054386404315237e-06, 4.5124317494697894e-05, 0.0002003606491685033]\n", + "epoch 130, Pop max fitness [3.054386404315237e-06, 0.00021767522855898998, 0.00036483035388544326]\n", + "epoch 131, Pop max fitness [3.054386404315237e-06, 0.00018846588767433095, 0.00018155410312273057]\n", + "epoch 132, Pop max fitness [3.054386404315237e-06, 0.0001142334932602239, 0.00013245033112582781]\n", + "epoch 133, Pop max fitness [3.054386404315237e-06, 6.697923643670462e-05, 0.0001389274798555154]\n", + "epoch 134, Pop max fitness [3.054386404315237e-06, 0.000145623998835008, 0.000326477309826967]\n", + "epoch 135, Pop max fitness [3.054386404315237e-06, 0.0003237293622531564, 0.0001311131506490101]\n", + "epoch 136, Pop max fitness [3.054386404315237e-06, 0.00030959752321981426, 0.00015715857300015716]\n", + "epoch 137, Pop max fitness [3.054386404315237e-06, 0.0001088139281828074, 0.00023391812865497077]\n", + "epoch 138, Pop max fitness [3.054386404315237e-06, 0.00011291779584462511, 0.00039888312724371757]\n", + "epoch 139, Pop max fitness [3.054386404315237e-06, 7.634753397465261e-05, 0.00025043826696719256]\n", + "epoch 140, Pop max fitness [3.054386404315237e-06, 0.0005787037037037037, 0.00018971732119142478]\n", + "epoch 141, Pop max fitness [3.054386404315237e-06, 5.787706910522051e-05, 0.00018953752843062926]\n", + "epoch 142, Pop max fitness [3.054386404315237e-06, 0.00023084025854108956, 0.00043159257660768235]\n", + "epoch 143, Pop max fitness [3.054386404315237e-06, 0.0005402485143165856, 9.991008092716555e-05]\n", + "epoch 144, Pop max fitness [3.054386404315237e-06, 0.0004033884630899556, 0.0002872737719046251]\n", + "epoch 145, Pop max fitness [3.054386404315237e-06, 0.00017927572606669058, 0.00034423407917383823]\n", + "epoch 146, Pop max fitness [3.054386404315237e-06, 9.128251939753537e-05, 0.0008445945945945946]\n", + "epoch 147, Pop max fitness [3.054386404315237e-06, 0.00011188185276348176, 0.0008445945945945946]\n", + "epoch 148, Pop max fitness [3.054386404315237e-06, 0.0002105706464518846, 0.0006093845216331506]\n", + "epoch 149, Pop max fitness [3.054386404315237e-06, 2.7544415369783778e-05, 8.028259473346178e-05]\n", + "epoch 150, Pop max fitness [3.054386404315237e-06, 0.017543859649122806, 0.0004923682914820286]\n", + "epoch 151, Pop max fitness [3.054386404315237e-06, 2.8447074218416637e-05, 0.00039603960396039607]\n", + "epoch 152, Pop max fitness [3.054386404315237e-06, 3.260940455227288e-05, 0.0005717552887364208]\n", + "epoch 153, Pop max fitness [3.054386404315237e-06, 3.950539248607435e-05, 0.00043047783039173483]\n", + "epoch 154, Pop max fitness [3.054386404315237e-06, 6.215426689042202e-05, 0.001326259946949602]\n", + "epoch 155, Pop max fitness [3.054386404315237e-06, 3.238132245320899e-05, 0.002136752136752137]\n", + "epoch 156, Pop max fitness [3.054386404315237e-06, 2.56285399420795e-05, 0.0005747126436781609]\n", + "epoch 157, Pop max fitness [3.054386404315237e-06, 2.489481938808534e-05, 0.0006493506493506494]\n", + "epoch 158, Pop max fitness [3.054386404315237e-06, 1.3614147822417056e-05, 0.0006397952655150352]\n", + "epoch 159, Pop max fitness [3.054386404315237e-06, 0.00011215791834903544, 0.0004894762604013706]\n", + "epoch 160, Pop max fitness [3.054386404315237e-06, 2.4716379544724288e-05, 0.0010030090270812437]\n", + "epoch 161, Pop max fitness [3.054386404315237e-06, 4.94486475794887e-05, 0.00019976028765481422]\n", + "epoch 162, Pop max fitness [3.054386404315237e-06, 0.0001336719689881032, 0.0001915341888527102]\n", + "epoch 163, Pop max fitness [3.054386404315237e-06, 0.00011821728336682824, 0.0001414227124876255]\n", + "epoch 164, Pop max fitness [3.054386404315237e-06, 4.4093654923056575e-05, 0.00011841326228537596]\n", + "epoch 165, Pop max fitness [3.054386404315237e-06, 0.00015865460891638903, 0.00033467202141900936]\n", + "epoch 166, Pop max fitness [3.054386404315237e-06, 0.00014369880729989942, 0.000544069640914037]\n", + "epoch 167, Pop max fitness [3.054386404315237e-06, 0.00011024142872891633, 0.004608294930875576]\n", + "epoch 168, Pop max fitness [3.054386404315237e-06, 1.0543629539032516e-05, 0.00014511681903932666]\n", + "epoch 169, Pop max fitness [3.054386404315237e-06, 1.888788153520701e-05, 0.00014150275930380644]\n", + "epoch 170, Pop max fitness [3.054386404315237e-06, 1.4950364788900849e-05, 0.00032615786040443573]\n", + "epoch 171, Pop max fitness [3.054386404315237e-06, 8.831113780069943e-06, 0.00013458950201884252]\n", + "epoch 172, Pop max fitness [3.054386404315237e-06, 4.468674591116275e-05, 0.0002538071065989848]\n", + "epoch 173, Pop max fitness [3.054386404315237e-06, 4.801690194948622e-05, 9.476876421531463e-05]\n", + "epoch 174, Pop max fitness [3.054386404315237e-06, 6.519754857217368e-05, 6.665777896280495e-05]\n", + "epoch 175, Pop max fitness [3.054386404315237e-06, 0.00014302059496567506, 0.001049317943336831]\n", + "epoch 176, Pop max fitness [3.054386404315237e-06, 0.00010195758564437195, 0.0006825938566552901]\n", + "epoch 177, Pop max fitness [3.054386404315237e-06, 2.654702806020866e-05, 0.0012121212121212121]\n", + "epoch 178, Pop max fitness [3.054386404315237e-06, 2.6551257202028515e-05, 0.00029824038174768865]\n", + "epoch 179, Pop max fitness [3.054386404315237e-06, 2.5178769261758485e-05, 0.00029824038174768865]\n", + "epoch 180, Pop max fitness [3.054386404315237e-06, 0.000164446637066272, 0.0007230657989877079]\n", + "epoch 181, Pop max fitness [3.054386404315237e-06, 0.0001556420233463035, 0.0001839249586168843]\n", + "epoch 182, Pop max fitness [3.054386404315237e-06, 9.418856550814731e-05, 0.00018138944313440957]\n", + "epoch 183, Pop max fitness [3.054386404315237e-06, 0.00016608536787908985, 0.0005878894767783657]\n", + "epoch 184, Pop max fitness [3.054386404315237e-06, 0.00027616680475006904, 0.0005858230814294083]\n", + "epoch 185, Pop max fitness [3.054386404315237e-06, 0.00016231131309852296, 0.0003901677721420211]\n", + "epoch 186, Pop max fitness [3.054386404315237e-06, 6.362942224484602e-05, 0.00024455857177794083]\n", + "epoch 187, Pop max fitness [3.054386404315237e-06, 2.8184098531608467e-05, 0.0004945598417408506]\n", + "epoch 188, Pop max fitness [3.054386404315237e-06, 2.862294988121476e-05, 0.00022634676324128565]\n", + "epoch 189, Pop max fitness [3.054386404315237e-06, 4.8243921265920496e-05, 0.00014742739200943535]\n", + "epoch 190, Pop max fitness [3.054386404315237e-06, 4.8225308641975306e-05, 4.808617041738796e-05]\n", + "epoch 191, Pop max fitness [3.054386404315237e-06, 0.00023912003825920613, 0.00012100677637947725]\n", + "epoch 192, Pop max fitness [3.054386404315237e-06, 0.00010955302366345311, 6.237135907191417e-05]\n", + "epoch 193, Pop max fitness [3.054386404315237e-06, 0.0004987531172069825, 5.7178798101663906e-05]\n", + "epoch 194, Pop max fitness [3.054386404315237e-06, 8.100445524503848e-05, 0.00010772379618657762]\n", + "epoch 195, Pop max fitness [3.054386404315237e-06, 5.6863414079381326e-05, 0.014285714285714285]\n", + "epoch 196, Pop max fitness [3.054386404315237e-06, 9.966115208291808e-05, 0.003937007874015748]\n", + "epoch 197, Pop max fitness [3.054386404315237e-06, 5.43980851874014e-05, 0.000244140625]\n", + "epoch 198, Pop max fitness [3.054386404315237e-06, 0.0005015045135406219, 0.00021043771043771043]\n", + "epoch 199, Pop max fitness [3.054386404315237e-06, 0.00014269406392694063, 5.7597051030987213e-05]\n", + "epoch 200, Pop max fitness [3.054386404315237e-06, 8.709284096847239e-05, 5.477051155657794e-05]\n", + "epoch 201, Pop max fitness [3.054386404315237e-06, 0.0012658227848101266, 8.305647840531562e-05]\n", + "epoch 202, Pop max fitness [3.054386404315237e-06, 2.1909644625564174e-05, 0.0018018018018018018]\n", + "epoch 203, Pop max fitness [3.054386404315237e-06, 2.3614981344164738e-05, 0.001941747572815534]\n", + "epoch 204, Pop max fitness [3.054386404315237e-06, 0.0007680491551459293, 0.0013003901170351106]\n", + "epoch 205, Pop max fitness [3.054386404315237e-06, 6.309148264984228e-05, 4.686255213458925e-05]\n", + "epoch 206, Pop max fitness [3.054386404315237e-06, 4.163544008660171e-05, 6.113590511707526e-05]\n", + "epoch 207, Pop max fitness [3.054386404315237e-06, 1.3342762218634503e-05, 0.0013157894736842105]\n", + "epoch 208, Pop max fitness [3.054386404315237e-06, 1.7354181490030022e-05, 0.00015192950470981463]\n", + "epoch 209, Pop max fitness [3.054386404315237e-06, 0.0002605523710265763, 0.0004068348250610252]\n", + "epoch 210, Pop max fitness [3.054386404315237e-06, 0.00011841326228537596, 4.1221814584278e-05]\n", + "epoch 211, Pop max fitness [3.054386404315237e-06, 0.00013356484573260317, 0.0004730368968779565]\n", + "epoch 212, Pop max fitness [3.054386404315237e-06, 9.994003597841295e-05, 1.0000000000000001e+45]\n", + "Finished phase Phase_0\n", + "--------------------------------\n", + "Evolutionary phase Phase_0\n", + "epoch 0, Pop max fitness [4.3651729044987475e-06, 0.00021258503401360543, 6.156119182467373e-05]\n", + "epoch 1, Pop max fitness [1.555451858764971e-05, 0.0013698630136986301, 4.5093795093795094e-05]\n", + "epoch 2, Pop max fitness [1.555451858764971e-05, 7.09622480840193e-05, 6.172077521293668e-05]\n", + "epoch 3, Pop max fitness [1.5557422446249105e-05, 0.00016989466530750936, 6.942515967786726e-05]\n", + "epoch 4, Pop max fitness [1.5557422446249105e-05, 2.896451846488052e-05, 9.931472837421789e-05]\n", + "epoch 5, Pop max fitness [1.5557422446249105e-05, 0.0005701254275940707, 0.00017571604287471446]\n", + "epoch 6, Pop max fitness [1.5557422446249105e-05, 0.0005512679162072767, 0.0019342359767891683]\n", + "epoch 7, Pop max fitness [1.5557422446249105e-05, 5.562044607597753e-05, 8.545547769612032e-05]\n", + "epoch 8, Pop max fitness [1.5557422446249105e-05, 0.00010036130068245685, 0.0001315097317201473]\n", + "epoch 9, Pop max fitness [1.5557422446249105e-05, 0.0006203473945409429, 0.000243842965130456]\n", + "epoch 10, Pop max fitness [1.5557422446249105e-05, 2.709072684420123e-05, 7.34322220590395e-05]\n", + "epoch 11, Pop max fitness [1.5557422446249105e-05, 1.1693444654926448e-05, 7.172572084349448e-05]\n", + "epoch 12, Pop max fitness [1.5557422446249105e-05, 1.548467017652524e-05, 9.299730307821073e-05]\n", + "epoch 13, Pop max fitness [1.5557422446249105e-05, 2.6752273943285178e-05, 4.260032376246059e-05]\n", + "epoch 14, Pop max fitness [1.5557422446249105e-05, 0.0008271298593879239, 5.447809980387884e-05]\n", + "epoch 15, Pop max fitness [1.5557422446249105e-05, 0.0007616146230007616, 0.0003448275862068965]\n", + "epoch 16, Pop max fitness [1.5557422446249105e-05, 0.0018315018315018315, 0.00012202562538133008]\n", + "epoch 17, Pop max fitness [1.5557422446249105e-05, 9.399379640943698e-05, 3.609326499675161e-05]\n", + "epoch 18, Pop max fitness [1.5557422446249105e-05, 0.00012938284383490748, 4.846370068818455e-05]\n", + "epoch 19, Pop max fitness [1.5557422446249105e-05, 0.00017027073046143367, 6.732193348592971e-05]\n", + "epoch 20, Pop max fitness [1.5557422446249105e-05, 0.0027247956403269754, 0.00016818028927009755]\n", + "epoch 21, Pop max fitness [1.5557422446249105e-05, 0.00012146240738491437, 8.589589417625838e-05]\n", + "epoch 22, Pop max fitness [1.5557422446249105e-05, 0.0008097165991902834, 4.501665616278023e-05]\n", + "epoch 23, Pop max fitness [1.5557422446249105e-05, 3.9022867400296575e-05, 0.00010715816545220746]\n", + "epoch 24, Pop max fitness [1.5557422446249105e-05, 2.025972973520533e-05, 0.0003508771929824561]\n", + "epoch 25, Pop max fitness [1.5557422446249105e-05, 8.602890571231934e-05, 0.0001199616122840691]\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Process ForkProcess-9582:\n", + "Process ForkProcess-9599:\n", + "Process ForkProcess-9583:\n", + "Process ForkProcess-9598:\n", + "Process ForkProcess-9563:\n", + "Process ForkProcess-9572:\n", + "Process ForkProcess-9597:\n", + "Process ForkProcess-9589:\n", + "Traceback (most recent call last):\n", + "Process ForkProcess-9595:\n", + "Process ForkProcess-9561:\n", + "Process ForkProcess-9585:\n", + "Process ForkProcess-9571:\n", + "Process ForkProcess-9576:\n", + "Process ForkProcess-9573:\n", + "Process ForkProcess-9588:\n", + "Process ForkProcess-9567:\n", + "Process ForkProcess-9564:\n", + "Process ForkProcess-9579:\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Process ForkProcess-9592:\n", + "Process ForkProcess-9565:\n", + "Process ForkProcess-9586:\n", + "Process ForkProcess-9596:\n", + "Process ForkProcess-9575:\n", + "Process ForkProcess-9577:\n", + "Process ForkProcess-9580:\n", + "Process ForkProcess-9574:\n", + "Process ForkProcess-9566:\n", + "Process ForkProcess-9569:\n", + "Process ForkProcess-9578:\n", + "Process ForkProcess-9568:\n", + "Traceback (most recent call last):\n", + "Process ForkProcess-9581:\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Process ForkProcess-9590:\n", + "Traceback (most recent call last):\n", + "Process ForkProcess-9570:\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Process ForkProcess-9594:\n", + "Traceback (most recent call last):\n", + "Process ForkProcess-9593:\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Process ForkProcess-9584:\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + "Process ForkProcess-9600:\n", + "Traceback (most recent call last):\n", + "Process ForkProcess-9587:\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + "Process ForkProcess-9591:\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 122, in get\n", + " return _ForkingPickler.loads(res)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 314, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/process.py\", line 108, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/home/juppy/venv_evolution/lib64/python3.11/site-packages/numpy/random/_pickle.py\", line 58, in __generator_ctor\n", + " return Generator(bit_generator_ctor(bit_generator_name))\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/concurrent/futures/process.py\", line 244, in _process_worker\n", + " call_item = call_queue.get(block=True)\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + " File \"/usr/lib64/python3.11/multiprocessing/queues.py\", line 102, in get\n", + " with self._rlock:\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n", + "KeyboardInterrupt\n", + " File \"/usr/lib64/python3.11/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[1], line 86\u001b[0m\n\u001b[1;32m 82\u001b[0m controller()\n\u001b[1;32m 83\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[0;32m---> 86\u001b[0m \u001b[43mmain\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", + "Cell \u001b[0;32mIn[1], line 82\u001b[0m, in \u001b[0;36mmain\u001b[0;34m()\u001b[0m\n\u001b[1;32m 79\u001b[0m controller()\n\u001b[1;32m 80\u001b[0m \u001b[38;5;66;03m# for no mpi the main process is the controller\u001b[39;00m\n\u001b[1;32m 81\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m---> 82\u001b[0m \u001b[43mcontroller\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 83\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n", + "Cell \u001b[0;32mIn[1], line 32\u001b[0m, in \u001b[0;36mcontroller\u001b[0;34m()\u001b[0m\n\u001b[1;32m 29\u001b[0m \u001b[38;5;28mprint\u001b[39m(GAController\u001b[38;5;241m.\u001b[39mpopulations[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m.\u001b[39mindividuals[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m.\u001b[39mgenome)\n\u001b[1;32m 31\u001b[0m \u001b[38;5;66;03m# evolution for all phases\u001b[39;00m\n\u001b[0;32m---> 32\u001b[0m \u001b[43mGAController\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mevolve\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 33\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mEvolve finished\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 35\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mFirst best genes\u001b[39m\u001b[38;5;124m'\u001b[39m)\n", + "File \u001b[0;32m~/hostshared/pygma/src/controller.py:232\u001b[0m, in \u001b[0;36mController.evolve\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 226\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__apply_operator_stack()\n\u001b[1;32m 228\u001b[0m \u001b[38;5;66;03m# instantiate individuals (get them a fitness value)\u001b[39;00m\n\u001b[1;32m 229\u001b[0m \u001b[38;5;66;03m# tell them the phase index becaus the worker processes\u001b[39;00m\n\u001b[1;32m 230\u001b[0m \u001b[38;5;66;03m# (mpi and local) will have their instance of the\u001b[39;00m\n\u001b[1;32m 231\u001b[0m \u001b[38;5;66;03m# phase list and with it know the experiments.\u001b[39;00m\n\u001b[0;32m--> 232\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__instantiate_individuals\u001b[49m\u001b[43m(\u001b[49m\u001b[43mphase_index\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mp_index\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 234\u001b[0m \u001b[38;5;66;03m# check if algorithm stagnates\u001b[39;00m\n\u001b[1;32m 235\u001b[0m \u001b[38;5;66;03m# IMP\u001b[39;00m\n\u001b[1;32m 236\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 242\u001b[0m \u001b[38;5;66;03m# ----------\u001b[39;00m\n\u001b[1;32m 243\u001b[0m \u001b[38;5;66;03m# information\u001b[39;00m\n\u001b[1;32m 244\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mepoch \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mepochs\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m, Pop max fitness \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_population_fitness()\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m)\n", + "File \u001b[0;32m~/hostshared/pygma/src/controller.py:96\u001b[0m, in \u001b[0;36mController.__instantiate_individuals\u001b[0;34m(self, phase_index)\u001b[0m\n\u001b[1;32m 94\u001b[0m futures \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m 95\u001b[0m \u001b[38;5;66;03m# starting a worker for each individual\u001b[39;00m\n\u001b[0;32m---> 96\u001b[0m \u001b[43m\u001b[49m\u001b[38;5;28;43;01mwith\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mProcessPoolExecutor\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmax_workers\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mnum_local_processes\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mas\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mexecutor\u001b[49m\u001b[43m:\u001b[49m\n\u001b[1;32m 97\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mw_tuple\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mworker_tuples\u001b[49m\u001b[43m:\u001b[49m\n\u001b[1;32m 98\u001b[0m \u001b[43m \u001b[49m\u001b[43mfutures\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mappend\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 99\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecutor\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msubmit\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 100\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_instantiate_individual_local_process\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 105\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 106\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/usr/lib64/python3.11/concurrent/futures/_base.py:647\u001b[0m, in \u001b[0;36mExecutor.__exit__\u001b[0;34m(self, exc_type, exc_val, exc_tb)\u001b[0m\n\u001b[1;32m 646\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__exit__\u001b[39m(\u001b[38;5;28mself\u001b[39m, exc_type, exc_val, exc_tb):\n\u001b[0;32m--> 647\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshutdown\u001b[49m\u001b[43m(\u001b[49m\u001b[43mwait\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m 648\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mFalse\u001b[39;00m\n", + "File \u001b[0;32m/usr/lib64/python3.11/concurrent/futures/process.py:825\u001b[0m, in \u001b[0;36mProcessPoolExecutor.shutdown\u001b[0;34m(self, wait, cancel_futures)\u001b[0m\n\u001b[1;32m 822\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_executor_manager_thread_wakeup\u001b[38;5;241m.\u001b[39mwakeup()\n\u001b[1;32m 824\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_executor_manager_thread \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m wait:\n\u001b[0;32m--> 825\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_executor_manager_thread\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mjoin\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 826\u001b[0m \u001b[38;5;66;03m# To reduce the risk of opening too many files, remove references to\u001b[39;00m\n\u001b[1;32m 827\u001b[0m \u001b[38;5;66;03m# objects that use file descriptors.\u001b[39;00m\n\u001b[1;32m 828\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_executor_manager_thread \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n", + "File \u001b[0;32m/usr/lib64/python3.11/threading.py:1112\u001b[0m, in \u001b[0;36mThread.join\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 1109\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcannot join current thread\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 1111\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m timeout \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m-> 1112\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_wait_for_tstate_lock\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1113\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1114\u001b[0m \u001b[38;5;66;03m# the behavior of a negative timeout isn't documented, but\u001b[39;00m\n\u001b[1;32m 1115\u001b[0m \u001b[38;5;66;03m# historically .join(timeout=x) for x<0 has acted as if timeout=0\u001b[39;00m\n\u001b[1;32m 1116\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_wait_for_tstate_lock(timeout\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mmax\u001b[39m(timeout, \u001b[38;5;241m0\u001b[39m))\n", + "File \u001b[0;32m/usr/lib64/python3.11/threading.py:1132\u001b[0m, in \u001b[0;36mThread._wait_for_tstate_lock\u001b[0;34m(self, block, timeout)\u001b[0m\n\u001b[1;32m 1129\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[1;32m 1131\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1132\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[43mlock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43macquire\u001b[49m\u001b[43m(\u001b[49m\u001b[43mblock\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m)\u001b[49m:\n\u001b[1;32m 1133\u001b[0m lock\u001b[38;5;241m.\u001b[39mrelease()\n\u001b[1;32m 1134\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stop()\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], + "source": [ + "from config import CONFIG, check_config\n", + "from controller import Controller\n", + "import numpy as np\n", + "\n", + "# remove here\n", + "def bool2int(x):\n", + " r = 0\n", + " for i, b in enumerate(x):\n", + " if b: r += b<<i \n", + " return r\n", + "\n", + "def mpi_worker():\n", + " # IMP:\n", + " # logic for the mpi worker\n", + "\n", + " return 0\n", + "\n", + "\n", + "def controller():\n", + " \"\"\"\n", + " Main controller logic for the algorithm\n", + " It will be called if the calling process shall be the controller.\n", + " \"\"\"\n", + " # Init controller\n", + " GAController = Controller(CONFIG, rng_seed=9)\n", + " print('Init controller')\n", + " print(GAController.populations)\n", + " print(GAController.populations[0].genetic_operator_stack)\n", + " print(GAController.populations[0].individuals[0].genome)\n", + " \n", + " # evolution for all phases\n", + " GAController.evolve()\n", + " print('Evolve finished')\n", + " \n", + " print('First best genes')\n", + " # todo find the population with the best gene\n", + " print(GAController.populations[0].individuals[0].fitness)\n", + " print(GAController.populations[0].individuals[1].fitness)\n", + " \n", + " print(GAController.populations[0].individuals[0].genome)\n", + " gene = GAController.populations[0].individuals[0].genome\n", + " numbers = np.split(gene, 3)\n", + " # convert the numbers to ints\n", + " x = bool2int(numbers[0])\n", + " y = bool2int(numbers[1])\n", + " z = bool2int(numbers[2])\n", + " \n", + " print(f'{x} , {y}, {z}')\n", + " print(x*2 + y*3 + z)\n", + " \n", + " # epoch loop\n", + " #GAController.epoch()\n", + " #print('Epoch')\n", + " #print(GAController.populations[0].individuals[0].genome)\n", + " \n", + " \n", + " \n", + "\n", + " return\n", + "\n", + "\n", + "def main():\n", + " # read config\n", + " check_config()\n", + " config = CONFIG\n", + "\n", + " # check if MPI should be used\n", + " if config[\"use_mpi\"]:\n", + " comm = MPI.COMM_WORLD\n", + " rank = comm.Get_rank()\n", + " rank = 0\n", + "\n", + " # if mpi worker switch to worker mode\n", + " if rank != 0:\n", + " mpi_worker()\n", + " \n", + " # rank 0 is the controller\n", + " else:\n", + " controller()\n", + " # for no mpi the main process is the controller\n", + " else:\n", + " controller()\n", + " return\n", + "\n", + "\n", + "main()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "adbd5d14-c9e9-464f-93ef-9cd43687f61d", + "metadata": {}, + "outputs": [], + "source": [ + "errir" + ] + }, + { + "cell_type": "markdown", + "id": "0555b2ad-8795-493d-b5ce-b3ea9d53ed82", + "metadata": {}, + "source": [ + "# code testing\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8b0ef895-c6dd-4dac-a25a-0cef85b32b18", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e1608e77-3c94-41bf-9d62-a74abc69cf0e", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "np.binary_repr(12)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "20500045-7cd1-4bf8-8dcf-ad8f4670e01e", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "rng = np.random.default_rng(9)\n", + "a = rng.integers(low=0, high=2, size=10, dtype=np.bool_)\n", + "a.dtype" + ] + }, + { + "cell_type": "markdown", + "id": "18e861ff-db8e-417e-ba86-ace6f73dd457", + "metadata": {}, + "source": [ + "# boolean operators" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5c1d8c25-f148-49ac-9494-c9dfd2284609", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "\n", + "a = np.ones(4, dtype=np.bool_)\n", + "b = np.ones(4, dtype=np.bool_)\n", + "b[0] = 0\n", + "\n", + "# and\n", + "print(a & b)\n", + "# or\n", + "print(a|b)\n", + "# not\n", + "print(~b)\n", + "# xor\n", + "print(a ^ b)\n", + "# shift left\n", + "print(0b001 << 2)\n", + "# shift right\n", + "print(0b100 >> 2)\n" + ] + }, + { + "cell_type": "markdown", + "id": "c879c3b6-9593-4334-aa1f-9f26395ba4b2", + "metadata": {}, + "source": [ + "# boolean conversion to integers" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e0900d64-f2ca-45f2-8a20-cac71797c3fa", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "# for floats see\n", + "# https://stackoverflow.com/questions/14504323/how-can-i-convert-32-bit-binary-number-to-floating-point-number\n", + "\n", + "# used from here\n", + "# https://stackoverflow.com/questions/15505514/binary-numpy-array-to-list-of-integers\n", + "def bool2int(x):\n", + " r = 0\n", + " for i, b in enumerate(x):\n", + " if b: r += b<<i \n", + " return r\n", + "\n", + "a = np.ones(4, dtype=np.bool_)\n", + "a[1:3] = 0 \n", + "print(a)\n", + "bool2int(a)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "03e1e23b-5f8b-4bea-afbe-2c0cada617a4", + "metadata": {}, + "outputs": [], + "source": [ + "gene = np.array([0,0,1], dtype=np.bool_)\n", + "mutation_rate = 0.4\n", + "int(mutation_rate*gene.size)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "04c422f1-19c7-4c7f-8cda-1981afaca1a3", + "metadata": {}, + "outputs": [], + "source": [ + "rng = np.random.default_rng(9)\n", + "\n", + "indexes = rng.integers(low=0, high=gene.size, size=int(mutation_rate*gene.size))\n", + "indexes" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b345398c-871c-4884-bbcd-144435e6ced6", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "mutants = rng.integers(low=0, high=2, size=indexes.size, dtype=np.bool_)\n", + "mutants" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2eb76c18-c754-4c69-860b-e399f7d3129a", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "gene" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f04c0eb4-1f44-4c18-ba5d-522db27ebd53", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "gene[indexes] = not gene[indexes]\n", + "gene" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "91504cbb-111e-4006-834e-cd78e592c8b9", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "from genetic_operators import Mutation_operator\n", + "\n", + "\n", + "a = np.array([0,0,1], dtype=np.bool_)\n", + "b = np.array([1,0,1], dtype=np.bool_)\n", + "p_old = [a.copy(),b.copy()]\n", + "p_new = [a,b]\n", + "m = Mutation_operator(1)\n", + "n = m.operate(p_old, p_new)\n", + "n = m.operate(p_old, n)\n", + "n = m.operate(p_old, n)\n", + "n = m.operate(p_old, n)\n", + "n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "98c7c006-d09e-4a0f-832a-bde673d5dd1b", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "p_old" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "baa4bca8-884d-4ead-bb18-f00fe41b4c82", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "p_new" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cd541cdd-e8a4-42ba-8ce2-45f0774ca091", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "indexes = np.array([0,1])\n", + "a[indexes] = ~a[indexes]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a4eab6fc-8ff8-4287-80fb-16244b6d3304", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "a" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7c4b97f7-1dc4-42b8-a2e6-50cf7d9c787a", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "a[indexes]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a94cdc0b-736a-4eb0-8ef3-6cf15dd85957", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "np.invert(a)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "af49dbab-b3de-460e-a878-4999cf5d0821", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "a = [1,2,3,3,4]\n", + "b = [9,66]\n", + "\n", + "for i in zip(a,b):\n", + " print(i)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "74b286ba-749b-4db9-ae23-5d474e0fdc13", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "a = np.array([0,0,1], dtype=np.bool_)\n", + "b = np.array([1,0,1], dtype=np.bool_)\n", + "\n", + "c = [a.copy(),a]\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "02864e9f-302a-46f6-a1a8-1418e6fd08f4", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "c[0][0] = True\n", + "c" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "129c9a6f-84b8-412d-929f-2f190a7015be", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "a" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fe92f1af-d7b4-4332-82ae-e96fa9502fe3", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "a.copy()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "462895ce-3f6e-4a4c-a7aa-afd3952c514d", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "a = np.array([0,0,1], dtype=np.bool_)\n", + "\n", + "np.array(a.copy(), dtype=np.bool_)\n", + "a.size" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a61dfa16-4470-416d-823c-2bc383db1149", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "a = [1,2,3]\n", + "for n, i in enumerate(a):\n", + " print(n, i)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "57908ff3-10b6-4fc0-83c8-0634f1982458", + "metadata": {}, + "outputs": [], + "source": [ + "from genetic_operators import Genetic_operator\n", + "\n", + "op = Mutation_operator()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7bc7544d-7b9a-4fb5-bde6-71897ee9c9e0", + "metadata": {}, + "outputs": [], + "source": [ + "rng = np.random.default_rng(0)\n", + "k_point = rng.integers(low=0, high=a.size, size=1)[0]\n", + "k_point" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "96328a1f-2fe8-4316-991f-684218b3597b", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "parent_1[k_point:]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "43a66e83-7e10-470a-bdcd-7a696a917783", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "parent_0 = rng.integers(low=0, high=2, size=4, dtype=np.bool_)\n", + "parent_1 = rng.integers(low=0, high=2, size=4, dtype=np.bool_)\n", + "child = np.concatenate((parent_0[:k_point], parent_1[k_point:]))\n", + "child.dtype" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "22685129-5bc2-448d-a36d-73a8925d8065", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "parent_0" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "74793350-663d-4d28-ad0f-9ddee3efcc0e", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "parent_1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0986ed69-676c-4d45-a93a-e61a09aeee97", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "a = [[1],[2],[3],[4]]\n", + "a" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "33c55fbc-2631-4100-bc22-cef7e1cbd5de", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "num_genes_to_remove = 2\n", + "a[:len(a)-num_genes_to_remove]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4c45f577-39c2-4daf-a535-116a2a3fda95", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "a[num_genes_to_remove:]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3a0db8f4-ce53-443c-b27e-202d704a29a1", + "metadata": {}, "outputs": [], "source": [] } diff --git a/src/config.py b/src/config.py new file mode 100755 index 0000000..fbb9f28 --- /dev/null +++ b/src/config.py @@ -0,0 +1,105 @@ +from genetic_operators import Mutation_operator, Single_point_crossover_operator, Removal_operator +from evolutionary_phase import Simple_evolutionary_phase +from experiment import Function_optimisation_experiment + + +# ----------------------------- +# Genetic operator definition +# ----------------------------- + +OP_MUTATION = Mutation_operator(0.06) +OP_REMOVAL = Removal_operator(6) +OP_CROSSOVER = Single_point_crossover_operator(6) + + +# ----------------------------- +# Phase definition +# ----------------------------- +# phase 0 +# phase starting operators (applied at phase start) +PHASE0_SOP = [OP_MUTATION, OP_MUTATION] +# phase Experiment (conducted on individuals) +PHASE0_EXPERIMENT = Function_optimisation_experiment() +PHASE0 = Simple_evolutionary_phase( + 'Phase_0', PHASE0_SOP, PHASE0_EXPERIMENT) + +# phase 1 + + +# ----------------------------- +# Configuration parameters +# ----------------------------- +CONFIG = { + # ------------- + # Processes + # -------------- + # use mpi parallelization + 'use_mpi': False, + + # if mpi=False, how many local parallel processe + 'num_local_processes': 1, + + + # ------------- + # Populations + # -------------- + # how many island populations to use + # is defined by the genetic operators stacks + # used to recombine/produce, mutate, extend + 'genetic_operator_stack': [ + # pop 0 + [OP_REMOVAL, OP_CROSSOVER], + # pop 1 + [OP_REMOVAL, OP_CROSSOVER, OP_MUTATION], + # pop 2 + [OP_REMOVAL, OP_REMOVAL, OP_REMOVAL, OP_MUTATION, OP_CROSSOVER, OP_CROSSOVER, OP_CROSSOVER] + ], + + # how many island populations to use + # 'num_populations': 3, + + # how many individuals per population + 'num_individuals': 30, + + # genome lenght + 'genome_length': 60, + + # init populations from defined gene strings + # this will ovveride: + # num_populations, num_individuals, genome_length + 'use_predefined_defined_genes': False, + 'predefined_genes': [ + # pop 0 + [[0, 0, 1], [0, 1, 1]], + # pop 1 + [[0, 1, 1], [1, 1, 1]] + ], + + # ------------- + # Evolutinary Phases + # -------------- + 'evolutionary_phases': [ + PHASE0, PHASE0 + ] + +} +# ----------------------------- +# check configured parameters +# ----------------------------- + + +def check_config(): + # IMP + # will check if all parameters are available and within + # reasonable range + # really do this? + # only for most critical parts that have to fit. + + # check if genetic operators are enough in every phase + if CONFIG['use_predefined_defined_genes'] and len(CONFIG['genetic_operator_stack']) != len(CONFIG['predefined_genes']): + print( + f"Warning: having an genetic operator stack for only {len(CONFIG['genetic_operator_stack'])} but there are genes defined for {len(CONFIG['predefined_genes'])}. Will not use all genes, only those having an operator stack.") + + return + + return diff --git a/src/controller.py b/src/controller.py new file mode 100755 index 0000000..905b701 --- /dev/null +++ b/src/controller.py @@ -0,0 +1,254 @@ +from population import Population +from concurrent.futures import ProcessPoolExecutor +import numpy as np +# FIXME: +# implement correct print functions in the classes +# such that print(object) can be called +# implement usefull controller output + +class Controller: + """ + GA Controller. + Handels the algorithm logic. + """ + + def __init__(self, config, rng_seed=9): + self.config = config + + # Population objects + self.populations = [] + + # random number generator + self.rng = np.random.default_rng(rng_seed) + + # phases + # self.evolutional_phases = config['evolutionary_phases'] + + # init populations + self.__init_populations() + + # epochs + self.epochs = 0 + + def __init_populations(self): + """ + Initialize the populations + """ + if self.config["use_predefined_defined_genes"]: + # make pops + for genetic_op_stack, genes in zip(self.config["genetic_operator_stack"], self.config["predefined_genes"]): + pop = Population(genetic_op_stack, self.rng) + pop.init_individuals(genomes=genes) + # append + self.populations.append(pop) + + else: + for genetic_operator_stack in self.config["genetic_operator_stack"]: + # make population + pop = Population(genetic_operator_stack, self.rng) + pop.init_individuals( + num_individuals=self.config["num_individuals"], + genome_length=self.config["genome_length"], + ) + # append + self.populations.append(pop) + + def __instantiate_individuals(self, phase_index): + """ + Will instantiate the individuals in the environment function specified + in the experiment of the phase. + Parameters + ---------- + phase_index: int + the index of the pase list specified in the confid by the user. + Used to conduct the correct experiment for the phase. + """ + # pass genes of all populations to the workers + # one idea is to pass the indexes, meaning: + # pass + # (pop_index, indiv_index, phase_index, gene) + # receive back + # (pop_index, indiv_index, fitness) + # then rewrite the fitness into the population individuals + + # nicer would be to pass the individual itself and having the reference updated + # this will not work with mpi though + + # this is not the nicest pythonic way with the indexes of the populations + # but it will work for now + # FIXME: find a more pythonic way + + # make list that workers should evaluate + worker_tuples = [] + for i_pop, pop in enumerate(self.populations): + for i_indiv, indiv in enumerate(pop.individuals): + worker_tuples.append( + (i_pop, i_indiv, phase_index, indiv.genome)) + + # instantiation via mpi or local worker + # --------------------------------------- + if self.config['use_mpi']: + raise NotImplementedError + else: + # save worker futures + futures = [] + # starting a worker for each individual + with ProcessPoolExecutor(max_workers=self.config['num_local_processes']) as executor: + for w_tuple in worker_tuples: + futures.append( + executor.submit( + self._instantiate_individual_local_process, + pop_index=w_tuple[0], + indiv_index=w_tuple[1], + phase_index=w_tuple[2], + gene=w_tuple[3], + ) + ) + + # write back the fitness values into the individuals + for future in futures: + # result will be a tuple (pop_index, indiv_index, fitness) + result = future.result() + self.populations[result[0] + ].individuals[result[1]].fitness = result[2] + + # sort the popuPopulations based on their fitness values + for pop in self.populations: + pop.sort_individuals() + + def _instantiate_individual_local_process(self, pop_index, indiv_index, phase_index, gene): + # FIXME: + # is it really the case that when a new worker is instantiated + # that it will get a full deep copy of all the objects? + # As such the experiment for an individual is called + # on a single, only by this worker used instance of the + # experiment right? + # I think so but cannot find the source (despite my brain) that + # verifyes that. + """ + Will make an experiment with the gene + Parameters + ---------- + pop_index: int + index of the population inside the controller population list + indiv_index: int + index of the individual inside its population + phase_index: int + index of the configuration phase array. + If you have the config you can get the experiment :) + gene: list + gene of the individual (numpy.array(dtype=numpy.bool_)) + """ + # instantiate the experiment and evaluate the individual + experiment = self.config['evolutionary_phases'][phase_index].experiment + + # conduct the experiment + #print(pop_index) + #print('worker controller has',self.epochs,'epochs and is at',self) + #print(self) + fitness = experiment.conduct(gene) + + # return result tuple + return (pop_index, indiv_index, fitness) + + # not used + def epoch(self): + """ + One epoch: + Instantiate individuals and evaluate their fitness. + Apply operator stack. + May combine island populations + """ + # instantiate individuals (get them a fitness value) + self.__instantiate_individuals() + + # genetic operator stack + # NOTE: after applying the stack the fitness values + # will be zero again for all individuals + self.__apply_operator_stack() + + # fusion islands + # IMP + + def __apply_operator_stack(self): + """ + Applying the operator stack for each population. + """ + for pop in self.populations: + pop.apply_operator_stack() + + def get_population_fitness(self, mean=False) -> list: + """ + Returns the fitness of all populations. + Parameters + ---------- + mean: bool + if true return the mean fitness of the populations, + otherwise the max fitness value + """ + f = [] + for pop in self.populations: + f.append(pop.get_fitness(mean=mean)) + return f + + def evolve(self): + """ + Evolves the genomes through all phases + """ + for p_index, evolutionary_phase in enumerate(self.config['evolutionary_phases']): + # ---------- + # init phase + # ---------- + print(f'Evolutionary phase {evolutionary_phase}') + # reset epochs + self.epochs = 0 + + # call the phase init + # which will return a new population array + self.populations = evolutionary_phase.initialize( + self.populations) + + # apply phase start operators + for op in evolutionary_phase.phase_start_operators: + for population in self.populations: + population.apply_operator(op) + + # ---------- + # phase epochs + # ---------- + while not evolutionary_phase.completed(self.get_population_fitness(), self.epochs): + # conduct a new epoch + # ------------------- + + # apply genetic operator stack on each population + # NOTE: after applying the stack the fitness values + # will be zero again for all individuals + self.__apply_operator_stack() + + # instantiate individuals (get them a fitness value) + # tell them the phase index becaus the worker processes + # (mpi and local) will have their instance of the + # phase list and with it know the experiments. + self.__instantiate_individuals(phase_index=p_index) + + # check if algorithm stagnates + # IMP + + # fusion islands but what is the condition? + # whenever a new phase happens the phase can do + # this on their own. + + # epoch done + # ---------- + # information + print(f'epoch {self.epochs}, Pop max fitness {self.get_population_fitness()}') + + # increment counter + self.epochs += 1 + + # ---------- + # finalize + # ---------- + print(f'Finished phase {evolutionary_phase}') + print('--------------------------------') + #print('--------------------------------') diff --git a/src/evolutionary_phase.py b/src/evolutionary_phase.py new file mode 100755 index 0000000..0ec02a7 --- /dev/null +++ b/src/evolutionary_phase.py @@ -0,0 +1,61 @@ +from genetic_operators import Genetic_operator +from experiment import Experiment +from population import Population + +# -------------- +# Interface idea +# -------------- + + +class Evolutionary_phase: + """ + A phase in the evolutionary algorithm + This class serves as informal interface and has to be extended + """ + + def __init__(self, name, phase_start_operators, experiment): + self.name = name + self.phase_start_operators: Genetic_operator = phase_start_operators + self.experiment: Experiment = experiment + + def __str__(self): + return self.name + + def completed(self, population_fitness: list, epochs: int) -> bool: + """ + Called to check if the phase has reached its end. + """ + raise NotImplementedError + + def initialize(self, populations: list) -> list: + """ + Here one can combine fusion/recombine, change the genetic operators... + returns a list with the populations that shall be used from now on. + For example one could define new genetic operators and then apply + them by change the population.genetic_operator_stack = new_stack + """ + # modifie popopulations + return populations + +# -------------- +# Phases +# -------------- + + +class Simple_evolutionary_phase(Evolutionary_phase): + + # def __init__(self, phase_start_operators, experiment): + # super().__init__(phase_start_operators, experiment) + + def completed(self, population_fitness: list, epochs: int) -> bool: + """ + Called to check if the phase has reached its end. + """ + max_fitness = max(population_fitness) + if max_fitness > 0.9: + return True + + if epochs > 500: + return True + + return False diff --git a/src/experiment.py b/src/experiment.py new file mode 100755 index 0000000..979d901 --- /dev/null +++ b/src/experiment.py @@ -0,0 +1,92 @@ +import numpy as np +# https://towardsdatascience.com/an-extensible-evolutionary-algorithm-example-in-python-7372c56a557b +# traveling salesman problem here +# -------------- +# Interface idea +# -------------- + + +class Experiment: + """ + Class defining an experiment. + """ + + def __init__(self): + self.inputs = [] + self.expected_outputs = [] + self.environment = None + + def conduct(self, gene): + """ + Conducts the experiment with the given gene + Returns the fitness value. + Parameters + ---------- + gene: numpy.array(dtype=numpy.bool_) + For easy objectives just implement your function. + For complex objective functions involving simulations the + gene is instantiatet in an environment, + returning the phenotype from the genotype. + The phenotype can then be used to process the inputs and + give back its outputs. + """ + # Idea + # ----- + # instantiate individual + # individual = self.environment.instantiate_individual(gene) + + # test the individual + # outputs = individual(self.inputs) + # if outputs == self.expected_outputs: + # return 0.999 + + # return 0.0 + + raise NotImplementedError + +# -------------- +# Experiments +# -------------- + + +def bool2int(x): + r = 0 + for i, b in enumerate(x): + if b: + r += b << i + return r + + +class Function_optimisation_experiment(Experiment): + """ + Find values for the function such that it matches a certain output + """ + + def f(self, x, y, z): + return x*2 + y*3 + z + + def conduct(self, gene): + # split gene into blocks that are binary representation + # of the numbers + numbers = np.split(gene, 3) + # convert the numbers to ints + x = bool2int(numbers[0]) + y = bool2int(numbers[1]) + z = bool2int(numbers[2]) + + # define the objective output + output = 424242 + + # calculate the outpup + r = self.f(x, y, z) + + # calc error and fitness + error = abs(r-output) + + # if error is small fitness is high + if error == 0: + error = 0.000000000000000000000000000000000000000000001 + fitness = 1/error + + #print(f'error: {error} fitness {fitness}') + return fitness diff --git a/src/genetic_operators.py b/src/genetic_operators.py new file mode 100755 index 0000000..0b02c16 --- /dev/null +++ b/src/genetic_operators.py @@ -0,0 +1,135 @@ +import numpy as np + +# ----------------- +# Formal interface +# ----------------- +# Write the idea into the docs that: +# for the operatos the idea is that they always append new childs +# into the population gene list. +# as such they are able to not remove genes that where made by other +# operators. If the population should be keep small apply the +# population shrinkage operator which will shrink the new_population +# in the first place so that now other operators can add new genes. +# The user knows how much he adds and as such the stack shall always +# come to no increase in the end. +# e.g. remove(4), crossover(2), add_random(4)... + + +class Genetic_operator(): + """ + This class will apply a genetic operator to a set of genes. + """ + + def operate(self, old_population, new_population): + """ + Applys the genetic operator on the genes + Parameters + ---------- + old_population: list of numpy.array(dtype=numpy.bool_) genes + genes before the operator stack is applied, sorted by their fitness + new_population: list + current state of modifications in operator stack + Note that if this is not the first operator which is applied + the actual fitness (the indexes, fitness_0 >= fitness_1) unclear. + Fitness is always represented at the point where + no operator was applied after an evaluation of the individuals. + + return: list + new genes to be used, these have to be arrays of numpy booleans! + """ + + raise NotImplementedError + +# ----------------- +# Genetic Operators +# ----------------- + + +class Mutation_operator(Genetic_operator): + """ + This class represents a mutation operator. + """ + + def __init__(self, mutation_rate, rng_seed=9): + self.mutation_rate = mutation_rate + self.rng = np.random.default_rng(rng_seed) + + def operate(self, old_population, new_population): + """ + Apply mutation to all genes of the current op stack. + """ + for gene in new_population: + # mutation indexes + # having at least one mutation + mutations = int(self.mutation_rate*gene.size) + if mutations == 0: + mutations = 1 + indexes = self.rng.integers(low=0, high=gene.size, size=mutations) + # flip the bits at indexes + # note, ~ is like np.invert() + gene[indexes] = ~gene[indexes] + return new_population + + +class Removal_operator(Genetic_operator): + """ + This class represents a gene removal operator + """ + + def __init__(self, num_genes_to_remove, remove_last=True): + """ + Parameters + ---------- + num_genes_to_remove: int + number of genes to remove + remove_last: bool + remove the last or first individuals + since list is sorded by fitness remove_last + will remove the not fit ones + """ + self.num_genes_to_remove = num_genes_to_remove + self.remove_last = remove_last + + def operate(self, old_population, new_population): + """ + Removes N genes from the actual gene stack + """ + # remove + if self.remove_last: + return new_population[:len(new_population)-self.num_genes_to_remove] + return new_population[self.num_genes_to_remove:] + + +class Single_point_crossover_operator(Genetic_operator): + """ + This class represents a single point (random) crossover operator. + """ + + def __init__(self, num_new_offsprings, rng_seed=9): + """ + Parameters + ---------- + num_new_offsprings: int + number of new individuals made + """ + self.num_offsprings = num_new_offsprings + self.rng = np.random.default_rng(rng_seed) + + def operate(self, old_population, new_population): + """ + Apply crossover operator with genes from the new population + and append the newly generated genes into the population. + """ + # parent indexes in the population + pop_index = 0 + for _ in range(self.num_offsprings): + # get parent genes + parent_0 = new_population[pop_index] + parent_1 = new_population[pop_index+1] + pop_index += 2 + # have k point wise selection + k_point = self.rng.integers(low=0, high=parent_0.size, size=1)[0] + child = np.concatenate((parent_0[:k_point], parent_1[k_point:])) + # add gene to population + new_population.append(child) + return new_population diff --git a/src/individual.py b/src/individual.py new file mode 100755 index 0000000..49f4789 --- /dev/null +++ b/src/individual.py @@ -0,0 +1,7 @@ +import numpy as np + + +class Individual(): + def __init__(self, genome): + self.genome = np.array(genome, dtype=np.bool_) + self.fitness = 0 \ No newline at end of file diff --git a/src/population.py b/src/population.py new file mode 100755 index 0000000..286f94e --- /dev/null +++ b/src/population.py @@ -0,0 +1,118 @@ +from individual import Individual +from genetic_operators import Genetic_operator +import numpy as np + + +class Population: + def __init__(self, operator_stack, rng): + # self.num_individuals = 0 + # self.gene_length = 0 + self.rng = rng + # self.genomes= genomes + + # individual objects + self.individuals: Individual = [] + + # genetic operators + self.genetic_operator_stack = operator_stack + + def init_individuals(self, genomes=None, num_individuals=None, genome_length=None): + """ + Initiates the individuales with the genomes given or creates n + random individuals with a specified genome length. + + Parameters + ---------- + genomes: numpy.array(dtype=numpy.bool_) + 2D array with the genomes + num_individuals: Int + how many random individuals + genome_length: Int + length of the genes + """ + if genomes is None and (num_individuals is None or genome_length is None): + raise ValueError( + 'Provide a fixed genome or parameters to define them randomly (number and size)') + if genomes is not None: + for gene in genomes: + self.individuals.append(Individual(gene)) + else: + for i in range(num_individuals): + genome = self.rng.integers( + low=0, high=2, size=genome_length, dtype=np.bool_) + self.individuals.append(Individual(genome)) + + def __get_gene_array(self): + """ + Will return a list containing genome copies of all the individuals. + """ + genes = [] + for indiv in self.individuals: + # copy as otherwise will be modified (C-pointer) + # make sure that we really have a numpy bool array! + genes.append(np.array(indiv.genome.copy(), dtype=np.bool_)) + return genes + + def apply_operator_stack(self): + """ + Applys the operator stack on this populations genes. + """ + + # operators getting the genes only + # they get a state before the stack and the current stack state + # hence we save all the genes in two lists and evolve the stack list + # NOTE: this are all numpy arrays, as such you can modified inplace. + # however operators might make new arrays and thus make new individuals. + unmodified_genes = self.__get_gene_array() + current_stack_state = self.__get_gene_array() + + # apply stack + for genetic_operator in self.genetic_operator_stack: + current_stack_state = genetic_operator.operate( + unmodified_genes, current_stack_state) + + # a new generation is born + self.individuals = [] + for gene in current_stack_state: + self.individuals.append(Individual(gene)) + + def apply_operator(self, operator: Genetic_operator): + """ + Applies the genetic operator on all genes of the population + """ + genes = self.__get_gene_array() + op_genes = operator.operate(genes, genes) + + # a new generation is born + # which might have more members then the last one + # hence create complepely new one + self.individuals = [] + for gene in op_genes: + self.individuals.append(Individual(gene)) + + def get_fitness(self, mean=False): + """ + Fitness of the population. + Parameters: + ----------- + mean: bool + if True return the mean fitness + otherwise the max + """ + # fitness list + f = [] + for indiv in self.individuals: + f.append(indiv.fitness) + + if mean: + return sum(f)/len(self.individuals) + return max(f) + + def sort_individuals(self): + """ + Sorts the individuals in the population based on their + fitness values. + """ + self.individuals.sort( + key=lambda Individual: Individual.fitness, reverse=True + ) diff --git a/src/population_old.py b/src/population_old.py new file mode 100755 index 0000000..e7e7360 --- /dev/null +++ b/src/population_old.py @@ -0,0 +1,33 @@ +from individual import Individual + + +class Population: + def __init__(self, num_individuals, gene_length, rng, genomes=False): + self.num_individuals = num_individuals + self.gene_length = gene_length + self.rng = rng + #self.genomes= genomes + + # individual objects + self.individuals = [] + + # init individuals randomly + # or with the provided genomes + if not genomes: + self.__init_individuals_random() + else: + self.__init_individuals_specific(genomes) + + def __init_individuals_random(self): + # IMP + # how to initialize the individual genome length? + for i in range(self.num_individuals): + self.individuals.append(Individual()) + + def __init_individuals_specific(self, genomes): + """ + initiates the individuales with the genomes given. + genomes: 2D array with the genomes + """ + for gene in genomes: + self.individuals.append(Individual(gene)) diff --git a/src/testing_notebook.ipynb b/src/testing_notebook.ipynb new file mode 100755 index 0000000..9a8e539 --- /dev/null +++ b/src/testing_notebook.ipynb @@ -0,0 +1,363 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "082d3205-bc4f-4528-99c7-ae716c5c75e7", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a = [1,2]\n", + "max(a)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "5660fbcf-e2a1-48f5-a63b-41c536e035ec", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "a.reverse()" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "20d34eb6-8b29-4683-82ef-9639e346078b", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[2, 1]" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "cb10b989-95e3-4690-be2d-0728c29fa051", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[2, 3]" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f = 0\n", + "[f := f + fit for fit in a]" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "00e70d76-2d57-4721-b739-5567e49527cc", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 3, 6, 10, 15]" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "total = 0\n", + "[total := total + x for x in [1, 2, 3, 4, 5]]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "1527bef8-3bab-4fdf-8954-b02184ac7098", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "10.0" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "30/3" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "eb85f179-cc72-45bc-8b16-11c3b673172e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.00010001000100010001" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1/9999\n" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "b8e273b2-9813-4ea9-8d0b-ef8815213d6d", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[ True False False True]\n" + ] + }, + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import numpy as np\n", + "\n", + "# used from here\n", + "# https://stackoverflow.com/questions/15505514/binary-numpy-array-to-list-of-integers\n", + "def bool2int(x):\n", + " r = 0\n", + " for i, b in enumerate(x):\n", + " if b: r += b<<i \n", + " return r\n", + "\n", + "a = np.ones(4, dtype=np.bool_)\n", + "a[1:3] = 0 \n", + "print(a)\n", + "bool2int(a[:1])" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "ce76e4b9-f60c-4512-8c33-f836712e49fe", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ True])" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a[:1]" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "c84b7f89-fd76-45cf-8f99-5e54a4bdae18", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "9" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "bool2int(a[:4])" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "2c93a449-d92f-4440-9d09-6c23d9e06983", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "a = np.ones(15, dtype=np.bool_)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "f2801797-a8c1-4346-8c3a-9ef3a5b43368", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[array([ True, True, True, True, True]),\n", + " array([ True, True, True, True, True]),\n", + " array([ True, True, True, True, True])]" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "block_size = 3\n", + "numbers = np.split(a,3)\n", + "numbers" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "0c9811f4-6044-495f-87ce-2d54e8b6e63a", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a.astype(float)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "ca7f6d39-e4aa-461e-bcc5-d15b04b283c5", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f = [1,2]\n", + "sum(f)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "545df3e9-9fa6-44c6-b6a0-85707a316256", + "metadata": {}, + "outputs": [], + "source": [ + "a = [3,9,6]\n", + "a\n", + "sorted(student_objects, key=lambda student: student.age)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "venv_evolution", + "language": "python", + "name": "venv_evolution" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} -- GitLab