{
  "export_version": "0.079",
  "framed_nodes": {
    "A Number": "Frame",
    "A Number.001": "Frame",
    "A Number.002": "Frame",
    "A Number.003": "Frame",
    "A Number.004": "Frame",
    "A Number.005": "Frame",
    "Convex Hull": "Frame.002",
    "Frame.003": "Frame.002",
    "Frame.004": "Frame.001",
    "IcoSphere": "Frame",
    "List Join": "Frame.003",
    "Move": "Frame",
    "Move.001": "Frame",
    "Random Vector MK2": "Frame",
    "Scripted Node Lite": "Frame.001",
    "Stethoscope MK2.002": "Frame.003",
    "UV Connection": "Frame.004",
    "Vector in": "Frame",
    "Viewer Draw Mk3": "Frame.002",
    "Viewer Draw Mk3.001": "Frame",
    "Viewer Draw Mk3.002": "Frame.001",
    "Viewer Draw Mk3.004": "Frame.004",
    "Volume": "Frame.003",
    "Volume.001": "Frame.003"
  },
  "groups": {},
  "nodes": {
    "A Number": {
      "bl_idname": "SvNumberNode",
      "height": 100.0,
      "hide": false,
      "label": "population",
      "location": [
        -1095.7342262268066,
        567.4873657226562
      ],
      "params": {
        "float_": 0.0,
        "float_draft_": 5.0,
        "float_max": 50.0,
        "float_min": 5.0,
        "int_": 20,
        "int_draft_": 20,
        "int_max": 50,
        "int_min": 5,
        "selected_mode": "int",
        "show_limits": 0,
        "to3d": 1
      },
      "width": 140.0
    },
    "A Number.001": {
      "bl_idname": "SvNumberNode",
      "height": 100.0,
      "hide": false,
      "label": "generations",
      "location": [
        -1095.7342262268066,
        485.1723937988281
      ],
      "params": {
        "float_": 0.0,
        "float_draft_": 5.0,
        "float_max": 50.0,
        "float_min": 5.0,
        "int_": 1000,
        "int_draft_": 1000,
        "int_max": 10000,
        "int_min": 200,
        "selected_mode": "int",
        "show_limits": 0,
        "to3d": 1
      },
      "width": 140.0
    },
    "A Number.002": {
      "bl_idname": "SvNumberNode",
      "height": 100.0,
      "hide": false,
      "label": "mutator",
      "location": [
        -1095.7342262268066,
        320.5424499511719
      ],
      "params": {
        "float_": 0.05000000074505806,
        "float_draft_": 0.05000000074505806,
        "float_max": 0.5,
        "float_min": 0.009999999776482582,
        "int_": 0,
        "int_draft_": 1000,
        "int_max": 10000,
        "int_min": 200,
        "selected_mode": "float",
        "show_limits": 0,
        "to3d": 1
      },
      "width": 140.0
    },
    "A Number.003": {
      "bl_idname": "SvNumberNode",
      "height": 100.0,
      "hide": false,
      "label": "threshold",
      "location": [
        -1095.7342262268066,
        402.857421875
      ],
      "params": {
        "float_": 0.699999988079071,
        "float_draft_": 0.800000011920929,
        "float_max": 0.9950000047683716,
        "float_min": 0.5,
        "int_": 0,
        "int_draft_": 20,
        "int_max": 50,
        "int_min": 5,
        "selected_mode": "float",
        "show_limits": 0,
        "to3d": 1
      },
      "width": 140.0
    },
    "A Number.004": {
      "bl_idname": "SvNumberNode",
      "height": 100.0,
      "hide": false,
      "label": "case",
      "location": [
        -1095.7342262268066,
        151.3394317626953
      ],
      "params": {
        "float_": 0.0,
        "float_draft_": 5.0,
        "float_max": 0.5,
        "float_min": 0.009999999776482582,
        "int_": 1,
        "int_draft_": 1,
        "int_max": 1,
        "int_min": 0,
        "selected_mode": "int",
        "show_limits": 0,
        "to3d": 1
      },
      "width": 140.0
    },
    "A Number.005": {
      "bl_idname": "SvNumberNode",
      "height": 100.0,
      "hide": false,
      "label": "selector",
      "location": [
        -1095.7342262268066,
        233.65440368652344
      ],
      "params": {
        "float_": 0.20000000298023224,
        "float_draft_": 0.07999999821186066,
        "float_max": 0.5,
        "float_min": 0.07999999821186066,
        "int_": 0,
        "int_draft_": 20,
        "int_max": 50,
        "int_min": 5,
        "selected_mode": "float",
        "show_limits": 0,
        "to3d": 1
      },
      "width": 140.0
    },
    "Convex Hull": {
      "bl_idname": "SvConvexHullNodeMK2",
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        123.68951416015625,
        779.032543182373
      ],
      "params": {},
      "width": 140.0
    },
    "Frame": {
      "bl_idname": "NodeFrame",
      "color": [
        0.1581861972808838,
        0.6079999804496765,
        0.1858440488576889
      ],
      "height": 1023.554931640625,
      "hide": false,
      "label": "INPUTS",
      "location": [
        -20.88473892211914,
        228.81857299804688
      ],
      "params": {},
      "use_custom_color": true,
      "width": 499.0
    },
    "Frame.001": {
      "bl_idname": "NodeFrame",
      "color": [
        0.6079999804496765,
        0.29834824800491333,
        0.17616866528987885
      ],
      "height": 635.719482421875,
      "hide": false,
      "label": "GENETIC ALGORITHM PROCESS",
      "location": [
        -40.918941497802734,
        8.438382148742676
      ],
      "params": {},
      "use_custom_color": true,
      "width": 641.4055786132812
    },
    "Frame.002": {
      "bl_idname": "NodeFrame",
      "color": [
        0.15239807963371277,
        0.4163794219493866,
        0.6079999804496765
      ],
      "height": 600.9264526367188,
      "hide": false,
      "label": "OUTPUT",
      "location": [
        -22.27130126953125,
        -44.47954177856445
      ],
      "params": {},
      "use_custom_color": true,
      "width": 853.5438842773438
    },
    "Frame.003": {
      "bl_idname": "NodeFrame",
      "color": [
        0.6079999804496765,
        0.6079999804496765,
        0.6079999804496765
      ],
      "height": 295.25677490234375,
      "hide": false,
      "label": "check Volume",
      "location": [
        -22.27130126953125,
        -44.47954177856445
      ],
      "params": {},
      "use_custom_color": true,
      "width": 561.0046997070312
    },
    "Frame.004": {
      "bl_idname": "NodeFrame",
      "color": [
        0.6079999804496765,
        0.5722179412841797,
        0.5722179412841797
      ],
      "height": 340.719482421875,
      "hide": false,
      "label": "Path of honor",
      "location": [
        -42.478782653808594,
        -29.040255546569824
      ],
      "params": {},
      "use_custom_color": true,
      "width": 392.009521484375
    },
    "IcoSphere": {
      "bl_idname": "SvIcosphereNode",
      "color": [
        0.9200000166893005,
        0.9200000166893005,
        0.9200000166893005
      ],
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -1107.3847389221191,
        1039.5549011230469
      ],
      "params": {
        "radius": 2.0,
        "subdivisions": 0
      },
      "use_custom_color": true,
      "width": 140.0
    },
    "List Join": {
      "bl_idname": "ListJoinNode",
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        575.8462524414062,
        762.6065788269043
      ],
      "params": {},
      "width": 140.0
    },
    "Move": {
      "bl_idname": "SvMoveNodeMk3",
      "custom_socket_props": {
        "1": {
          "expanded": true
        }
      },
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -808.3847389221191,
        900.1359558105469
      ],
      "params": {},
      "width": 133.2548828125
    },
    "Move.001": {
      "bl_idname": "SvMoveNodeMk3",
      "custom_socket_props": {
        "1": {
          "expanded": true
        }
      },
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -808.3847389221191,
        1039.5549011230469
      ],
      "params": {},
      "width": 140.0
    },
    "Note": {
      "bl_idname": "NoteNode",
      "color": [
        1.0,
        0.8993440270423889,
        0.9742509722709656
      ],
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -1147.5604248046875,
        1210.0062255859375
      ],
      "params": {
        "text": "Nikitron 2020 - genetic algorithm attempt. Moving data set points to fit pattern. turn off processing and use ctrl+F5 to run once. Threshold inside SNL till 0.995, not more"
      },
      "use_custom_color": true,
      "width": 509.6258544921875
    },
    "Random Vector MK2": {
      "bl_idname": "RandomVectorNodeMK2",
      "color": [
        0.9200000166893005,
        0.9200000166893005,
        0.9200000166893005
      ],
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -1107.3847389221191,
        728.231689453125
      ],
      "params": {
        "count_inner": 12,
        "scale": 2.0,
        "seed": 0
      },
      "use_custom_color": true,
      "width": 140.0
    },
    "Scripted Node Lite": {
      "bl_idname": "SvScriptNodeLite",
      "color": [
        0.0,
        0.800000011920929,
        0.949999988079071
      ],
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -551.2872276306152,
        750.9560213088989
      ],
      "params": {
        "float_list": [
          0.0,
          0.0,
          0.0,
          0.0,
          0.699999988079071,
          0.05000000074505806,
          0.07999999821186066,
          0.0,
          0.10000000149011612,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0,
          0.0
        ],
        "halt_updates": 0,
        "inject_params": 0,
        "injected_state": 0,
        "int_list": [
          0,
          0,
          20,
          1000,
          0,
          0,
          0,
          1,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0
        ],
        "script_name": "GA_lists_match.py",
        "script_str": "# taken from https://github.com/nortikin/simple-ga\n# making comparement between vertices and choose best match\n\nimport random\nfrom functools import reduce\nfrom statistics import mean, variance\n\n\n\"\"\"\nin  pattern v   d=[] n=0\nin  data    v   d=[] n=0\nin  population s d=20 n=2\nin  generations s d=10000 n=2\nin  threshold s d=0.9 n=2\nin  mutator s d=0.1 n=2\nin  selector s d=0.2 n=2\nin  all_apart s d=0 n=2\nout vers_final  v\nout vers_descr  v\n\"\"\"\n\n\nclass Agent:\n\n    def __init__(self, length):\n\n        self.string = [random.choice(data[0]) for _ in range(length)]\n        # self.string = ''.join(random.choice(data[0]) for _ in xrange(length))\n        self.fitness = -1\n\n    def __str__(self):\n\n        return 'String: ' + str(self.string) + ' Fitness: ' + str(self.fitness)\n\n\n\ndef compare_two_lists(agent_list,pattern):\n    \"\"\" fitness decision module \"\"\"\n    lenpat = len(pattern)\n    Ratio = []\n    for i in range(len(agent_list)):\n        j = i%lenpat\n        subpat = pattern[j]           \n        subagl = agent_list[i]\n        # main decision part here, so we assign \n        # coef to all or to separate and summ\n        if all_apart == 0:\n            # full match\n            coef = [1 if x in subpat else 0 for x in subagl]\n        elif all_apart == 1:\n            # closest\n            mainfunc = lambda y, x: (all_dif-abs(y-x))/all_dif\n            coef = list(map(mainfunc, subagl, subpat))\n        else:\n            coef = [1 if x in subpat else 0 for x in subagl]\n        Ratio.append(mean(coef))\n    Ratio = mean(Ratio)\n    #print (Ratio)\n    return Ratio\n\n\ndef ga():\n\n    agents = init_agents(population, in_str_len)\n    stepper = 0.1\n\n    for generation in range(generations):\n\n        #print ('Generation: ' + str(generation))\n\n        agents = fitness(agents)\n        agents = selection(agents)\n        agents = crossover(agents)\n        agents = mutation(agents)\n\n        if any(agent.fitness >= stepper for agent in agents):\n            combo.append(sorted(agents, key=lambda agent: agent.fitness, reverse=True)[0].string)\n            stepper += 0.1\n        if any(agent.fitness >= threshold for agent in agents):\n\n            print (f'Last generation #{str(generation)}')\n            agent = sorted(agents, key=lambda agent: agent.fitness, reverse=True)[0]\n            print (f'GA ended with {type(agent.string)} {len(agent.string)}, \\\n                     \\n{agent.string[:3]}... \\\n                     \\nFitness: {agent.fitness}')\n            return agent.string\n    return [None]\n    \n\n\ndef init_agents(population, length):\n\n    return [Agent(length) for _ in range(population)]\n\n\ndef fitness(agents):\n\n    for agent in agents:\n        agent.fitness = compare_two_lists(agent.string, in_str)\n\n    return agents\n\n\ndef selection(agents):\n\n    agents = sorted(agents, key=lambda agent: agent.fitness, reverse=True)\n    #print ('\\n'.join(map(str, agents)))\n    agents = agents[:int(selector * len(agents))]\n\n    return agents\n\n\ndef crossover(agents):\n\n    offspring = []\n\n    for _ in range((population - len(agents)) // 2):\n\n        parent1 = random.choice(agents)\n        parent2 = random.choice(agents)\n        child1 = Agent(in_str_len)\n        child2 = Agent(in_str_len)\n        split = random.randint(0, in_str_len)\n        child1.string = parent1.string[0:split] + parent2.string[split:in_str_len]\n        child2.string = parent2.string[0:split] + parent1.string[split:in_str_len]\n\n        offspring.append(child1)\n        offspring.append(child2)\n\n    agents.extend(offspring)\n\n    return agents\n\n\ndef mutation(agents):\n\n    for agent in agents:\n        for idx, param in enumerate(agent.string):\n            if random.uniform(0.0, 1.0) <= mutator:\n                if all_apart == 0:\n                    agent.string = agent.string[0:idx] + \\\n                                [(random.choice(data[0]))] + \\\n                                agent.string[idx+1:in_str_len]\n                elif all_apart == 1:\n                    agent.string = agent.string[0:idx] + \\\n                                [[random.uniform(-mutator,mutator)+d for d in param]] + \\\n                                agent.string[idx+1:in_str_len]\n                else:\n                    agent.string = agent.string[0:idx] + \\\n                                [(random.choice(data[0]))] + \\\n                                agent.string[idx+1:in_str_len]\n\n    return agents\n\nif data and pattern:\n    in_str = pattern[0]\n    emax = lambda a,b: a if (a > b) else b\n    emin = lambda a,b: a if (a < b) else b\n    all_max = reduce(emax,[reduce(emax, x) for x in in_str])\n    all_min = reduce(emin,[reduce(emin, x) for x in in_str])\n    all_dif = all_max-all_min\n    print(f'GA initialised with {type(in_str)} {len(in_str)} \\\n            \\n{in_str[:3]}...')\n    in_str_len = len(in_str)\n    combo = []\n    vers_final = [ga()]\n    vers_descr = combo\n"
      },
      "snlite_ui": [],
      "use_custom_color": true,
      "width": 140.0
    },
    "Stethoscope MK2.002": {
      "bl_idname": "SvStethoscopeNodeMK2",
      "color": [
        1.0,
        0.8993440270423889,
        0.9742509722709656
      ],
      "height": 100.0,
      "hide": false,
      "label": "\u0431\u044b\u043b\u043e/\u0441\u0442\u0430\u043b\u043e",
      "location": [
        747.2333984375,
        758.956371307373
      ],
      "params": {
        "num_elements": 2,
        "text_color": [
          0.949999988079071,
          0.949999988079071,
          0.949999988079071
        ]
      },
      "use_custom_color": true,
      "width": 140.0
    },
    "UV Connection": {
      "bl_idname": "LineConnectNodeMK2",
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -331.89119720458984,
        1013.7838411331177
      ],
      "params": {
        "cicl_check_U": 0,
        "cicl_check_V": 0,
        "dir_check": "V_dir",
        "polygons": "Edges",
        "slice_check": 0
      },
      "width": 140.0
    },
    "Vector in": {
      "bl_idname": "GenVectorsNode",
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -1107.3847389221191,
        878.1359558105469
      ],
      "params": {
        "x_": 3.0,
        "y_": 3.0,
        "z_": 3.0
      },
      "width": 100.0
    },
    "Viewer Draw Mk3": {
      "bl_idname": "SvViewerDrawMk4",
      "color": [
        0.6284880042076111,
        0.931007981300354,
        1.0
      ],
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        363.2350158691406,
        1041.9264640808105
      ],
      "params": {
        "activate": 1,
        "display_edges": 1,
        "display_faces": 0,
        "point_size": 8.0,
        "selected_draw_mode": "facet",
        "vector_color": [
          0.5,
          1.0,
          0.5,
          1.0
        ]
      },
      "use_custom_color": true,
      "width": 140.0
    },
    "Viewer Draw Mk3.001": {
      "bl_idname": "SvViewerDrawMk4",
      "color": [
        0.6284880042076111,
        0.931007981300354,
        1.0
      ],
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -809.4932594299316,
        759.5796813964844
      ],
      "params": {
        "activate": 1,
        "display_faces": 0,
        "edge_color": [
          1.0,
          0.19698314368724823,
          0.11354930698871613,
          1.0
        ],
        "use_dashed": 1,
        "vector_color": [
          1.0,
          0.19698314368724823,
          0.11354930698871613,
          1.0
        ]
      },
      "use_custom_color": true,
      "width": 140.0
    },
    "Viewer Draw Mk3.002": {
      "bl_idname": "SvViewerDrawMk4",
      "color": [
        0.6284880042076111,
        0.931007981300354,
        1.0
      ],
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -549.4794273376465,
        1017.5534334182739
      ],
      "params": {
        "activate": 1,
        "display_edges": 0,
        "display_faces": 0,
        "point_size": 6.0,
        "vector_color": [
          0.5324395298957825,
          0.5324395298957825,
          0.5324395298957825,
          1.0
        ]
      },
      "use_custom_color": true,
      "width": 140.0
    },
    "Viewer Draw Mk3.004": {
      "bl_idname": "SvViewerDrawMk4",
      "color": [
        0.6284880042076111,
        0.931007981300354,
        1.0
      ],
      "height": 100.0,
      "hide": false,
      "label": "",
      "location": [
        -139.88166046142578,
        1014.7195100784302
      ],
      "params": {
        "activate": 1,
        "display_faces": 0,
        "display_verts": 1,
        "edge_color": [
          0.4749784767627716,
          0.4749784767627716,
          0.4749784767627716,
          1.0
        ],
        "point_size": 3.0,
        "vector_color": [
          0.6358873844146729,
          0.6358873844146729,
          0.6358873844146729,
          1.0
        ]
      },
      "use_custom_color": true,
      "width": 140.0
    },
    "Volume": {
      "bl_idname": "SvVolumeNode",
      "height": 100.0,
      "hide": false,
      "label": "\u043e\u0431\u044a\u0451\u043c \u0431\u044b\u043b",
      "location": [
        386.22869873046875,
        766.2567863464355
      ],
      "params": {},
      "width": 140.0
    },
    "Volume.001": {
      "bl_idname": "SvVolumeNode",
      "height": 100.0,
      "hide": false,
      "label": "\u043e\u0431\u044a\u0451\u043c \u0441\u0442\u0430\u043b",
      "location": [
        386.22869873046875,
        638.8378410339355
      ],
      "params": {},
      "width": 140.0
    }
  },
  "update_lists": [
    [
      "Random Vector MK2",
      0,
      "Move",
      0
    ],
    [
      "Vector in",
      0,
      "Move",
      1
    ],
    [
      "IcoSphere",
      0,
      "Move.001",
      0
    ],
    [
      "Vector in",
      0,
      "Move.001",
      1
    ],
    [
      "Move.001",
      0,
      "Scripted Node Lite",
      0
    ],
    [
      "Move",
      0,
      "Scripted Node Lite",
      1
    ],
    [
      "A Number",
      0,
      "Scripted Node Lite",
      2
    ],
    [
      "A Number.001",
      0,
      "Scripted Node Lite",
      3
    ],
    [
      "A Number.003",
      0,
      "Scripted Node Lite",
      4
    ],
    [
      "A Number.002",
      0,
      "Scripted Node Lite",
      5
    ],
    [
      "A Number.005",
      0,
      "Scripted Node Lite",
      6
    ],
    [
      "A Number.004",
      0,
      "Scripted Node Lite",
      7
    ],
    [
      "Move",
      0,
      "UV Connection",
      0
    ],
    [
      "Scripted Node Lite",
      1,
      "UV Connection",
      1
    ],
    [
      "Scripted Node Lite",
      0,
      "UV Connection",
      2
    ],
    [
      "UV Connection",
      0,
      "Viewer Draw Mk3.004",
      0
    ],
    [
      "UV Connection",
      1,
      "Viewer Draw Mk3.004",
      1
    ],
    [
      "Move.001",
      0,
      "Volume",
      0
    ],
    [
      "IcoSphere",
      2,
      "Volume",
      1
    ],
    [
      "Scripted Node Lite",
      0,
      "Convex Hull",
      0
    ],
    [
      "Convex Hull",
      0,
      "Volume.001",
      0
    ],
    [
      "Convex Hull",
      1,
      "Volume.001",
      1
    ],
    [
      "Volume",
      0,
      "List Join",
      0
    ],
    [
      "Volume.001",
      0,
      "List Join",
      1
    ],
    [
      "List Join",
      0,
      "Stethoscope MK2.002",
      0
    ],
    [
      "Convex Hull",
      0,
      "Viewer Draw Mk3",
      0
    ],
    [
      "Convex Hull",
      1,
      "Viewer Draw Mk3",
      2
    ],
    [
      "Move",
      0,
      "Viewer Draw Mk3.002",
      0
    ],
    [
      "Move.001",
      0,
      "Viewer Draw Mk3.001",
      0
    ],
    [
      "IcoSphere",
      1,
      "Viewer Draw Mk3.001",
      1
    ]
  ]
}
