From e6ab4a8ed100d5d5b7611c74cf3ccd556f1f1d71 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 19:04:34 +0100 Subject: Initial commit --- plugins/CppnExplorer/CppnExplorer.sublime-project | 41 + .../CppnExplorer/CppnExplorer.sublime-workspace | 1199 ++++++++++++++++++++ plugins/CppnExplorer/Makefile | 19 + plugins/CppnExplorer/include/CppnExplorer.hpp | 129 +++ plugins/CppnExplorer/lib/.keep | 0 plugins/CppnExplorer/obj/.keep | 0 plugins/CppnExplorer/src/CppnExplorer.cpp | 549 +++++++++ plugins/CppnExplorer/todolist.txt | 21 + 8 files changed, 1958 insertions(+) create mode 100644 plugins/CppnExplorer/CppnExplorer.sublime-project create mode 100644 plugins/CppnExplorer/CppnExplorer.sublime-workspace create mode 100644 plugins/CppnExplorer/Makefile create mode 100644 plugins/CppnExplorer/include/CppnExplorer.hpp create mode 100644 plugins/CppnExplorer/lib/.keep create mode 100644 plugins/CppnExplorer/obj/.keep create mode 100644 plugins/CppnExplorer/src/CppnExplorer.cpp create mode 100644 plugins/CppnExplorer/todolist.txt (limited to 'plugins') diff --git a/plugins/CppnExplorer/CppnExplorer.sublime-project b/plugins/CppnExplorer/CppnExplorer.sublime-project new file mode 100644 index 0000000..dee3d7f --- /dev/null +++ b/plugins/CppnExplorer/CppnExplorer.sublime-project @@ -0,0 +1,41 @@ +{ + "build_systems": + [ + { + "cmd": + [ + "make", + "-C", + "${project_path}" + ], + "name": "Build" + }, + { + "cmd": + [ + "make", + "clean", + "-C", + "${project_path}" + ], + "name": "Clean" + } + ], + "folders": + [ + { + "file_exclude_patterns": + [ + "*.sublime-project", + "*.sublime-workspace" + ], + "folder_exclude_patterns": + [ + "obj", + "lib", + "Algorithm Documentation" + ], + "path": "." + } + ] +} diff --git a/plugins/CppnExplorer/CppnExplorer.sublime-workspace b/plugins/CppnExplorer/CppnExplorer.sublime-workspace new file mode 100644 index 0000000..cf691cc --- /dev/null +++ b/plugins/CppnExplorer/CppnExplorer.sublime-workspace @@ -0,0 +1,1199 @@ +{ + "auto_complete": + { + "selected_items": + [ + [ + "fiel", + "fieldGenerator" + ], + [ + "_ne", + "_neuralNetReady" + ], + [ + "_neu", + "_neuralNetReady" + ], + [ + "_neur", + "_neuralNet" + ], + [ + "setOu", + "setOutlineColor" + ], + [ + "PIX", + "PIXEL_SIZE" + ], + [ + "Neu", + "Neuron" + ], + [ + "IN", + "INPUT" + ], + [ + "setO", + "setOrigin" + ], + [ + "Uin", + "Uint8" + ], + [ + "PI", + "PIXEL_SIZE" + ], + [ + "Neur", + "Neuron" + ], + [ + "Bl", + "BlendAdd" + ], + [ + "_wi", + "_withNeuralNet" + ], + [ + "neura", + "neuralNetGenerator" + ], + [ + "neural", + "_neuralNetGenerator" + ], + [ + "_win", + "_windowOpen" + ], + [ + "eve", + "event" + ], + [ + "joi", + "joinable" + ], + [ + "win", + "_windowThread" + ], + [ + "grid", + "gridSpacing" + ], + [ + "Rende", + "RenderTarget" + ], + [ + "Render", + "RenderWindow" + ], + [ + "sr", + "srcNeuron" + ], + [ + "colo", + "colorMult" + ], + [ + "setOutl", + "setOutlineThickness" + ], + [ + "gri", + "gridClr" + ], + [ + "_sh", + "_showGrid" + ], + [ + "res", + "resolution" + ], + [ + "fie", + "field" + ], + [ + "fi", + "_field" + ], + [ + "out", + "outputAt" + ], + [ + "cpp", + "_cppn" + ], + [ + "_bia", + "_biasTexture" + ], + [ + "in", + "inputAt" + ], + [ + "INV", + "INV_WEIGHTS" + ], + [ + "col", + "colorInt" + ], + [ + "C", + "CircleShape" + ], + [ + "Neural", + "NeuralNet" + ], + [ + "_cur", + "_cursorPos" + ], + [ + "_cu", + "_cursorPos" + ], + [ + "prin", + "printWeights" + ], + [ + "Key", + "Keyboard" + ], + [ + "Cpp", + "CppnExplorer" + ], + [ + "co", + "Color" + ], + [ + "_is", + "_isLocked" + ], + [ + "Ne", + "Neuron" + ], + [ + "_re", + "_recentReplacement" + ], + [ + "re", + "relateIO" + ], + [ + "_in", + "_inputMap" + ], + [ + "en", + "endl" + ], + [ + "_ou", + "_output" + ], + [ + "_", + "_position" + ], + [ + "_out", + "_outputMap" + ], + [ + "pu", + "previousNeurons" + ], + [ + "tem", + "tempNeurons" + ], + [ + "def", + "default" + ], + [ + "gene", + "generateNeuralNet" + ], + [ + "c", + "const" + ], + [ + "ato", + "atomic_size_t" + ], + [ + "db", + "dbgFileName" + ], + [ + "dbg", + "dbgFileName" + ], + [ + "th", + "threadID" + ], + [ + "Pop", + "PopulationDefaults" + ], + [ + "Vec", + "Vector2D" + ], + [ + "wor", + "worldFile" + ], + [ + "ste", + "onStep" + ], + [ + "pr", + "print" + ], + [ + "str", + "struct struct" + ], + [ + "SE", + "SELECT_LOAD" + ], + [ + "SELE", + "SELECT_NEW" + ], + [ + "pri", + "printCommand" + ], + [ + "com", + "command" + ], + [ + "arg", + "argv" + ], + [ + "org", + "organismIdx" + ], + [ + "spe", + "specieSize" + ], + [ + "nod", + "nodeType" + ], + [ + "loa", + "loadGenome" + ], + [ + "load", + "loadPopulationPrms" + ], + [ + "getCHa", + "getChampionIdx" + ], + [ + "cham", + "champIdx" + ], + [ + "size", + "size_t" + ], + [ + "file", + "fileName" + ], + [ + "fil", + "fileName" + ], + [ + "Po", + "Population" + ], + [ + "File", + "FileStream" + ], + [ + "Fil", + "FileStream" + ], + [ + "Inp", + "InputFile" + ], + [ + "pop", + "population" + ], + [ + "isO", + "isOrganismBeingGenerated" + ], + [ + "isA", + "isAnyOrganismBeingGenerated" + ], + [ + "organ", + "organismIsBeingGenerated" + ], + [ + "_orga", + "_organismsBeingGenerated" + ], + [ + "is", + "isBeingGenerated" + ], + [ + "_or", + "_organismsBeingGenerated" + ], + [ + "_org", + "_organismIsLocked" + ], + [ + "_isL", + "_isLocked" + ], + [ + "organi", + "_organismsBeingGenerated" + ], + [ + "_lock", + "_lockedOrganisms" + ], + [ + "isL", + "isLockedByReplacement" + ], + [ + "si", + "size_t" + ], + [ + "_pop", + "_populationLock" + ], + [ + "leve", + "levelToSegment" + ], + [ + "inc", + "include" + ], + [ + "beg", + "begin" + ], + [ + "dis", + "distance" + ], + [ + "emp", + "emplace_back" + ], + [ + "mu", + "mutex" + ], + [ + "incl", + "inclIter" + ], + [ + "siz", + "size_t" + ], + [ + "cr", + "crntInclusions" + ], + [ + "sour", + "sourceNeuron" + ], + [ + "neuro", + "_neurons" + ], + [ + "syn", + "synTot" + ], + [ + "thre", + "threadVec" + ], + [ + "_organi", + "_allOrganisms" + ], + [ + "poo", + "poorOrganism" + ], + [ + "fta", + "fatherIdx" + ], + [ + "fath", + "fatherIdx" + ], + [ + "fat", + "fatherIdx" + ], + [ + "orga", + "organismReplaced" + ], + [ + "repla", + "replaceOrganism" + ], + [ + "ran", + "randWeight" + ], + [ + "_cpp", + "_cppnInputs" + ], + [ + "_i", + "_innovationNo" + ], + [ + "gen", + "geneIdx" + ], + [ + "ra", + "randSeed" + ], + [ + "_o", + "_output" + ] + ] + }, + "buffers": + [ + { + "file": "todolist.txt", + "settings": + { + "buffer_size": 1115, + "line_ending": "Windows" + } + }, + { + "file": "include/CppnExplorer.hpp", + "settings": + { + "buffer_size": 4318, + "line_ending": "Windows" + } + }, + { + "file": "src/CppnExplorer.cpp", + "settings": + { + "buffer_size": 17141, + "line_ending": "Windows" + } + } + ], + "build_system": "Build", + "command_palette": + { + "height": 375.0, + "selected_items": + [ + [ + "tas", + "Tasks: New document" + ], + [ + "TAS", + "Tasks: New document" + ], + [ + "", + "Build: Build" + ], + [ + "ops", + "View: Toggle Open Files in Side Bar" + ] + ], + "width": 378.0 + }, + "console": + { + "height": 118.0, + "history": + [ + ] + }, + "distraction_free": + { + "menu_visible": true, + "show_minimap": false, + "show_open_files": false, + "show_tabs": false, + "side_bar_visible": false, + "status_bar_visible": false + }, + "expanded_folders": + [ + "/C/Projects/Libraries/HyperNeat/plugins/CppnExplorer" + ], + "file_history": + [ + "/C/Projects/Applications/NeuroRacers/bin/current.population", + "/C/Projects/Libraries/HyperNeat/plugins/CppnExplorer/Makefile", + "/C/Users/Paul/Downloads/ID/Adobe Indesign CS6/DLL FILE/IMPORTANT.txt", + "/C/Users/Paul/Downloads/ID/Adobe Indesign CS6/INSTALLING INSTRUCTIONS.txt", + "/C/Projects/Libraries/HyperNeat/plugins/CppnExplorer/CppnExplorer.sublime-project", + "/C/Projects/Libraries/HyperNeat/plugins/CppnExplorer/src/CppnExplorer.cpp", + "/C/Projects/Libraries/HyperNeat/plugins/CppnExplorer/include/CppnExplorer.hpp", + "/C/TBB/include/tbb/atomic.h", + "/C/Program Files (x86)/Orbiter/Modules/D3D11Shaders/Planet_Clouds.fx", + "/C/Program Files (x86)/Orbiter/Modules/D3D11Shaders/Planet.fx", + "/C/Program Files (x86)/Orbiter/Config/NGPlanetConfig/Earth_ng.cfg", + "/C/Program Files (x86)/Orbiter/Config/Jupiter.cfg", + "/C/Program Files (x86)/Orbiter/Config/NGPlanetConfig/Titan_ng.cfg", + "/C/Program Files (x86)/Orbiter/D3D11Client.cfg", + "/C/Projects/.git", + "/C/Projects/New Text Document.txt", + "/C/Users/Paul/Downloads/orbiter100830/Config/Mars.cfg", + "/C/Projects/Libraries/HyperNeat/plugins/CppnExplorer/todo", + "/C/Users/Paul/Downloads/orbiter100830/Config/Earth.cfg", + "/C/Users/Paul/Downloads/asmi-ovp-1f2ee85a8579/asmi-ovp-1f2ee85a8579/D3D11CLIENT README.txt", + "/C/Users/Paul/Downloads/orbiter100830/readme.txt", + "/C/Users/Paul/Downloads/orbiter100830/patch.txt", + "/C/Sublime Text 3/Data/Packages/User/Preferences.sublime-settings", + "/C/Users/Paul/Documents/Trabajo/Will Bourdreau/Laurieta Rose/NextStepsBoat.txt", + "/C/Projects/Libraries/HyperNeat/plugins/cppn.explorer/src/CppnExplorer.cpp", + "/C/Projects/Libraries/HyperNeat/plugins/cppn.explorer/Makefile", + "/C/Projects/Libraries/HyperNeat/plugins/cppn.explorer/include/CppnExplorer.hpp", + "/C/Projects/Libraries/HyperNeat/plugins/cppn.explorer/cppn.explorer.sublime-project", + "/C/Projects/Libraries/HyperNeat/HyperNeat.sublime-project", + "/C/Projects/Libraries/HyperNeat/src/Organism.cpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Population.hpp", + "/C/Projects/Libraries/HyperNeat/src/Population.cpp", + "/C/Projects/Libraries/HyperNeat/src/NeuralNet.cpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/NeuralNet.hpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Organism.hpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Utils/Atomic.hpp", + "/C/Projects/Libraries/HyperNeat/Makefile", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Utils/Future.hpp", + "/C/Projects/Libraries/HyperNeat/todo", + "/C/Users/Paul/Downloads/tbb42_20130725oss_win/tbb42_20130725oss/include/tbb/tbb.h", + "/C/Users/Paul/Downloads/tbb41_20130516oss_src/tbb41_20130516oss_src/tbb41_20130516oss/README.txt", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Utils/Vector.hpp", + "/C/Projects/Libraries/HyperNeat/src/Utils/Point.cpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Utils/Point.hpp", + "/C/Projects/Libraries/HyperNeat/src/QuadTree.cpp", + "/C/Projects/Libraries/HyperNeat/src/Utils/LoadFile.cpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Utils/Atom.hpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Utils/Vector2D.hpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Debugger.hpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Utils/Thread.hpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Utils/Mutex.hpp", + "/C/Projects/Libraries/HyperNeat/src/Cppn.cpp", + "/C/Projects/Libraries/HyperNeat/src/Cppn.s", + "/C/Users/Paul/Downloads/FitVids.js-master/FitVids.js-master/tests.html", + "/C/Users/Paul/Downloads/FitVids.js-master/FitVids.js-master/CONTRIBUTING.md", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/StackMacros.hpp", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/PopulationPrms.hpp", + "/C/Users/Paul/Downloads/Ida Pro v6.1/READ ME !!.txt", + "/C/Projects/Libraries/HyperNeat/src/QueryPlanePrms.cpp", + "/C/Projects/Libraries/HyperNeat/src/Utils/SaveFile.cpp", + "/C/SFML/build-debug/CMakeCache.txt", + "/C/Box2D/build-debug/CMakeCache.txt", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Genome.hpp", + "/C/Projects/Applications/NeuroRacers/bin/population", + "/C/Projects/Libraries/HyperNeat/include/HyperNeat/Cppn.hpp", + "/C/SFML/build-dynamic/CMakeCache.txt", + "/C/Box2D/build-dynamic/CMakeCache.txt", + "/C/Projects/Libraries/HyperNeat/src/Utils/TEMP_Vector.cpp", + "/C/Projects/Applications/HyperGuppies/Makefile", + "/C/Projects/Applications/Guppies SFML/SimBase_Execute.cpp", + "/C/Projects/Applications/HyperGuppies/include/Utils/String.hpp", + "/C/Projects/Applications/HyperGuppies/todo", + "/C/Programming/Applications/HyperGuppies/include/Utils/RLUtils.hpp", + "/C/Programming/Applications/HyperGuppies/include/WorldParams.hpp", + "/C/Users/Paul/Downloads/pdc25_vc_w32/README", + "/C/Programming/Applications/HyperGuppies/bin/worlds/default.world", + "/C/Programming/Applications/HyperGuppies/include/Utils/File.hpp", + "/C/Programming/Applications/HyperGuppies/Makefile", + "/C/Programming/Applications/HyperGuppies/HyperGuppies.sublime-project", + "/C/Programming/Applications/Guppies SFML/Params.hpp", + "/C/Users/Paul/Downloads/SFML/SFML-master/CMakeLists.txt", + "/C/Programming/Applications/HyperGuppies/include/Utils/Function.hpp", + "/C/Users/Paul/Downloads/RBTray-4_3/readme.txt", + "/C/Programming/Applications/HyperGuppies/src/Main.cpp", + "/C/Programming/Applications/HyperGuppies/todo", + "/C/RLUtil/RLUtil.hpp", + "/C/Users/Paul/Downloads/PlainTasks-master/PlainTasks-master/Readme.md", + "/C/Programming/Applications/HyperGuppies/include/App.hpp", + "/C/Programming/Applications/HyperGuppies/src/App.cpp", + "/C/Users/Paul/Downloads/rlutil-master/rlutil-master/rlutil.hpp", + "/C/Users/Paul/Downloads/rlutil-master/rlutil-master/example.c", + "/C/Users/Paul/Downloads/rlutil-master/rlutil-master/test.cpp", + "/C/Users/Paul/Downloads/rlutil-master/rlutil-master/rlutil.h", + "/C/Box2D/include/Common/b2Settings.h", + "/C/Users/Paul/Desktop/Box2D/Box2D/Common/b2Settings.h", + "/C/Users/Paul/Desktop/Box2D/CMakeLists.txt", + "/C/Users/Paul/Desktop/Box2D/Box2D/CMakeLists.txt", + "/C/Programming/Libraries/HyperNeat/Makefile", + "/C/Users/Paul/Downloads/neuro.3.0.3/neuro/style.css", + "/C/Users/Paul/Downloads/tapio-rlutil-c49f5ae/tapio-rlutil-c49f5ae/rlutil.h", + "/C/Programming/Libraries/HyperNeat/src/Utils/LoadFile.cpp", + "/C/Programming/Applications/NeuroRacers/bin/population", + "/C/Programming/Libraries/HyperNeat/todo", + "/C/Programming/Libraries/HyperNeat/include/Population.hpp", + "/C/Programming/Libraries/HyperNeat/include/Utils/LoadFile.hpp", + "/C/Programming/Libraries/HyperNeat/src/Utils/SaveFile.cpp", + "/C/Programming/Libraries/HyperNeat/include/Utils/SaveFile.hpp", + "/C/Programming/Libraries/HyperNeat/include/Organism.hpp", + "/C/Users/Paul/Desktop/Box2D_v2.2.1/Box2D/Common/b2Settings.h", + "/C/Users/Paul/Desktop/Box2D_v2.2.1/Building.txt", + "/C/Users/Paul/Desktop/Box2D_v2.2.1/Box2D/Box2D.h", + "/C/Users/Paul/Desktop/Box2D_v2.2.1/Readme.txt", + "/C/Programming/Libraries/HyperNeat/src/Genome.cpp", + "/C/Programming/Libraries/HyperNeat/include/Genome.hpp", + "/C/Programming/Libraries/HyperNeat/src/Cppn.cpp", + "/C/Programming/Libraries/HyperNeat/include/Cppn.hpp", + "/C/Programming/Libraries/HyperNeat/src/Organism.cpp", + "/C/Programming/Libraries/HyperNeat/src/Population.cpp", + "/C/Box2D/src/Dynamics/b2World.cpp", + "/C/Box2D/src/Dynamics/b2World.h", + "/C/Box2D/src/Dynamics/b2WorldCallbacks.h", + "/C/Programming/Libraries/HyperNeat/include/Utils/NodeTypes.hpp", + "/C/Programming/Libraries/HyperNeat/include/Utils/String.hpp", + "/C/Programming/Libraries/HyperNeat/src/LoadSaveSystem.cpp", + "/C/Programming/Libraries/HyperNeat/include/LoadSaveSystem.hpp", + "/C/Programming/Libraries/HyperNeat/include/Saver.hpp", + "/C/Programming/Libraries/HyperNeat/src/Utils/File.cpp", + "/C/Programming/Libraries/HyperNeat/include/Utils/File.hpp" + ], + "find": + { + "height": 36.0 + }, + "find_in_files": + { + "height": 92.0, + "where_history": + [ + "" + ] + }, + "find_state": + { + "case_sensitive": true, + "find_history": + [ + "BlendMode", + "fieldGenerator", + "value", + "_grid", + "223", + "refNeuron", + "0", + "PIXEL_SIZE", + "cout", + "_windowOpen", + "64", + "bias", + "pos", + "bias", + "PIXEL", + "CPPN_EX_WIDTH", + "_withNeuralNet", + "600", + "512", + "_window", + "System", + "Graphics", + "RenderWindow", + "WIN", + "sf::", + "gridClr", + "64", + "sf::", + " = nullptr", + "16", + "128", + "=", + "_resolution", + "SunDir", + "16", + "128", + "32", + "sf::Uint8", + "Alpha", + "sf::Color::White", + "{ 0, 0, 0, 0 }", + "sf::Color::Black", + "Add", + "2", + "1.0f", + "Thickness", + "setOrigin", + "0", + "_uiColor", + "0.0", + "resolution", + "Neurons", + "\\", + "{ 0, 0, 0 }", + "_uiColor", + "6", + "8", + "10", + "3", + "_uiColor", + "{ 0, 0, 0 }", + ", 128", + "PIXEL * 1.0f", + "6", + "4", + "0", + "_cppn.outputAt(0)", + "_valueImage.", + "bias", + "mage", + "val", + "*", + "{ 0, 0, 0, 128 }", + "_uiColor", + "4.", + "3.0", + "2", + "1.5", + "colorInt / 2", + "radius", + "_body", + "64", + "0", + "20", + "128", + "20.0", + "16", + "10.0", + "0.025f", + "2", + "4", + "x1", + "1", + "x", + "_weight", + "64", + "PIXEL", + "0.008f", + "0", + "_body", + "128", + "0.1", + "Scale", + "H", + ", 2, sf::Lines", + ")", + "sf::Vertex(", + "sf::Vector2f", + "Color", + "cursor", + "cVal", + "weight", + "_cppn", + "weight", + "_cppn", + "cVal", + " - cBias", + "abs(", + "cVal", + "val", + "static_cast(", + "0", + "int", + "int(255)", + "sf::Uint8", + "float", + "x", + "cppn" + ], + "highlight": true, + "in_selection": false, + "preserve_case": false, + "regex": true, + "replace_history": + [ + "_" + ], + "reverse": false, + "show_context": true, + "use_buffer2": true, + "whole_word": false, + "wrap": true + }, + "groups": + [ + { + "selected": 2, + "sheets": + [ + { + "buffer": 0, + "file": "todolist.txt", + "semi_transient": false, + "settings": + { + "buffer_size": 1115, + "regions": + { + }, + "selection": + [ + [ + 363, + 363 + ] + ], + "settings": + { + "BracketHighlighterBusy": false, + "bh_regions": + [ + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close" + ], + "syntax": "Packages/PlainTasks/PlainTasks.tmLanguage", + "tab_size": 2, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 2, + "type": "text" + }, + { + "buffer": 1, + "file": "include/CppnExplorer.hpp", + "semi_transient": false, + "settings": + { + "buffer_size": 4318, + "regions": + { + }, + "selection": + [ + [ + 391, + 391 + ] + ], + "settings": + { + "BracketHighlighterBusy": false, + "bh_regions": + [ + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close" + ], + "syntax": "Packages/C++ Starting Kit/CCpp.tmLanguage", + "tab_size": 4, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 1, + "type": "text" + }, + { + "buffer": 2, + "file": "src/CppnExplorer.cpp", + "semi_transient": false, + "settings": + { + "buffer_size": 17141, + "regions": + { + }, + "selection": + [ + [ + 1778, + 1778 + ] + ], + "settings": + { + "BracketHighlighterBusy": false, + "bh_regions": + [ + "bh_single_quote", + "bh_single_quote_center", + "bh_single_quote_open", + "bh_single_quote_close", + "bh_unmatched", + "bh_unmatched_center", + "bh_unmatched_open", + "bh_unmatched_close", + "bh_round", + "bh_round_center", + "bh_round_open", + "bh_round_close", + "bh_default", + "bh_default_center", + "bh_default_open", + "bh_default_close", + "bh_square", + "bh_square_center", + "bh_square_open", + "bh_square_close", + "bh_regex", + "bh_regex_center", + "bh_regex_open", + "bh_regex_close", + "bh_curly", + "bh_curly_center", + "bh_curly_open", + "bh_curly_close", + "bh_angle", + "bh_angle_center", + "bh_angle_open", + "bh_angle_close", + "bh_tag", + "bh_tag_center", + "bh_tag_open", + "bh_tag_close", + "bh_double_quote", + "bh_double_quote_center", + "bh_double_quote_open", + "bh_double_quote_close" + ], + "syntax": "Packages/C++ Starting Kit/CCpp.tmLanguage", + "tab_size": 4, + "translate_tabs_to_spaces": true + }, + "translation.x": 0.0, + "translation.y": 828.0, + "zoom_level": 1.0 + }, + "stack_index": 0, + "type": "text" + } + ] + } + ], + "incremental_find": + { + "height": 0.0 + }, + "input": + { + "height": 30.0 + }, + "layout": + { + "cells": + [ + [ + 0, + 0, + 1, + 1 + ] + ], + "cols": + [ + 0.0, + 1.0 + ], + "rows": + [ + 0.0, + 1.0 + ] + }, + "menu_visible": false, + "output.exec": + { + "height": 96.0 + }, + "output.find_results": + { + "height": 0.0 + }, + "project": "CppnExplorer.sublime-project", + "replace": + { + "height": 64.0 + }, + "save_all_on_build": true, + "select_file": + { + "height": 0.0, + "selected_items": + [ + ], + "width": 0.0 + }, + "select_project": + { + "height": 500.0, + "selected_items": + [ + [ + "", + "C:\\Projects\\Libraries\\HyperNeat\\HyperNeat.sublime-project" + ] + ], + "width": 805.0 + }, + "select_symbol": + { + "height": 0.0, + "selected_items": + [ + ], + "width": 0.0 + }, + "settings": + { + }, + "show_minimap": true, + "show_open_files": false, + "show_tabs": true, + "side_bar_visible": true, + "side_bar_width": 160.0, + "status_bar_visible": true, + "template_settings": + { + } +} diff --git a/plugins/CppnExplorer/Makefile b/plugins/CppnExplorer/Makefile new file mode 100644 index 0000000..0d31499 --- /dev/null +++ b/plugins/CppnExplorer/Makefile @@ -0,0 +1,19 @@ +LIBRARY := lib/libCppnExplorer.a +SOURCES := $(wildcard src/*.cpp) +OBJECTS := $(patsubst src/%.cpp,obj/%.o,$(SOURCES)) +DEPS := $(patsubst %.o,%.d,$(OBJECTS)) +CFLAGS := -c -O3 -Wall -std=c++11 -MMD -Iinclude -I../../include -IC:/SFML/include +LFLAGS := rvs + +all: $(OBJECTS) + ar $(LFLAGS) $(LIBRARY) $(OBJECTS) + +-include $(DEPS) + +$(OBJECTS): $(patsubst obj/%.o,src/%.cpp,$@) + g++ $(CFLAGS) $(patsubst obj/%.o,src/%.cpp,$@) -o $@ + +clean: + del lib\*.a + del obj\*.o + del obj\*.d diff --git a/plugins/CppnExplorer/include/CppnExplorer.hpp b/plugins/CppnExplorer/include/CppnExplorer.hpp new file mode 100644 index 0000000..5ca20c5 --- /dev/null +++ b/plugins/CppnExplorer/include/CppnExplorer.hpp @@ -0,0 +1,129 @@ +#ifndef __CPPN_EXPLORER_HPP__ +#define __CPPN_EXPLORER_HPP__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace hyperneat +{ + class CppnExplorer + { + public: + CppnExplorer(); + ~CppnExplorer(); + + void run(const Genome& genome, const NeuralNetPrms* nnPrms = nullptr, sf::RenderTarget* target = nullptr); + void shutdown(); + void draw(); + + // void run(const Genome& genome, const NeuralNetPrms& nnPrms); + // void shutdown(); + + private: + void windowHandler(); + void eventHandler(); + void neuralNetGenerator(); + void fieldGenerator(); + + class Neuron + { + public: + Neuron(const NeuralNet::Neuron& refNeuron); + + sf::VertexArray _synapses = sf::VertexArray(sf::Lines); + sf::CircleShape _nucleus = sf::CircleShape(4.0f * PIXEL_SIZE, 12); + }; + + Cppn _cppn; + Genome _genome; + NeuralNetPrms _nnPrms; + Vector _neurons; + NeuralNet _neuralNet; + bool _withNeuralNet = false; + Atomic _neuralNetReady = {false}; + + sf::RenderWindow _window; + Atomic _windowOpen = {false}; + sf::RenderTarget* _target = nullptr; + const sf::Color _uiColor = {255, 255, 255, 8}; + + sf::Image _fieldImage; + sf::RectangleShape _fieldSprite; + sf::Texture _fieldTexture; + size_t _currentField = 0; + Atomic _fieldReady = {false}; + + Thread _windowHandler; + Thread _fieldGenerator; + Thread _neuralNetGenerator; + + static constexpr unsigned RESOLUTION = 512; + static constexpr float PIXEL_SIZE = 1.0f / static_cast(RESOLUTION); + + // class Neuron + // { + // public: + // enum class Type { + // INPUT, + // HIDDEN, + // OUTPUT + // }; + + // Type _type; + // sf::CircleShape _body = sf::CircleShape(0.0f, 30); + // sf::CircleShape _nucleus = sf::CircleShape(0.0f, 30); + // sf::VertexArray _synapses = sf::VertexArray(sf::Lines); + // }; + + // void print(const sf::Color* field); + // void placeCursorAt(const sf::Vector2f& newPos); + // void createNeuron(Neuron& repNeuron, const NeuralNet::Neuron& srcNeuron); + + // Cppn _cppn; + // Genome _genome; + // NeuralNet _neuralNet; + // NeuralNetPrms _nnPrms; + + // const unsigned RESOLUTION = 512; + // sf::RenderWindow _window; + // Atomic _running; + // Thread _executor; + + // const sf::Color WEIGHTS = { 128, 0, 255 }; + // const sf::Color INV_WEIGHTS = { 255, 0, 128 }; + // const sf::Color BIAS = { 0, 255, 255 }; + // const sf::Color* _field = &WEIGHTS; + + // sf::Image _valueImage; + // sf::Texture _valueTexture; + // sf::RectangleShape _valueSprite; + // sf::Image _biasImage; + // sf::Texture _biasTexture; + // sf::RectangleShape _biasSprite; + // bool _showBias = false; + + // const sf::Color _uiColor = { 64, 64, 64 }; + // const float PIXEL = 1.0f / static_cast(RESOLUTION); + + // sf::Vector2f _cursorPos = { 0.0f, 0.0f }; + // sf::RectangleShape _cursorH = sf::RectangleShape(sf::Vector2f(0.2f, PIXEL * 3.0f)); + // sf::RectangleShape _cursorV = sf::RectangleShape(sf::Vector2f(PIXEL * 3.0f, 0.2f)); + // sf::VertexArray _grid = sf::VertexArray(sf::Lines); + + // bool _showField = true; + // bool _showNeurons = true; + // bool _showGrid = true; + // Vector _neurons; + }; +} + +#endif diff --git a/plugins/CppnExplorer/lib/.keep b/plugins/CppnExplorer/lib/.keep new file mode 100644 index 0000000..e69de29 diff --git a/plugins/CppnExplorer/obj/.keep b/plugins/CppnExplorer/obj/.keep new file mode 100644 index 0000000..e69de29 diff --git a/plugins/CppnExplorer/src/CppnExplorer.cpp b/plugins/CppnExplorer/src/CppnExplorer.cpp new file mode 100644 index 0000000..555922a --- /dev/null +++ b/plugins/CppnExplorer/src/CppnExplorer.cpp @@ -0,0 +1,549 @@ +#include +#include +#include + +using namespace sf; +using namespace hyperneat; + +CppnExplorer::CppnExplorer() +{ + _fieldSprite.setOrigin(1.0f, 1.0f); + _fieldSprite.setPosition(0.0f, 0.0f); + _fieldSprite.setTexture(&_fieldTexture); + _fieldSprite.setSize(Vector2f(2.0f, 2.0f)); + _fieldImage.create(RESOLUTION, RESOLUTION); +} + +CppnExplorer::~CppnExplorer() +{ + shutdown(); +} + +void +CppnExplorer::run(const Genome& genome, const NeuralNetPrms* nnPrms, RenderTarget* target) +{ + shutdown(); + _target = target; + _genome = genome; + + _cppn.clear(); + _cppn.create(_genome); + + if (nnPrms) { + _withNeuralNet = true; + _nnPrms = *nnPrms; + _neuralNetGenerator = Thread(&CppnExplorer::neuralNetGenerator, this); + } + + if (!_target) { + _windowOpen = true; + _target = &_window; + _windowHandler = Thread(&CppnExplorer::windowHandler, this); + } + + _fieldGenerator = Thread(&CppnExplorer::fieldGenerator, this); +} + +void +CppnExplorer::shutdown() +{ + if (_neuralNetGenerator.joinable()) { + _neuralNetGenerator.join(); + } + + if (_windowHandler.joinable()) { + _windowOpen = false; + _windowHandler.join(); + } + + _neurons.clear(); + _withNeuralNet = false; + _neuralNetReady = false; + _windowOpen = false; + _target = nullptr; +} + +void +CppnExplorer::draw() +{ + _target->clear({8, 8, 16}); + + if (_neuralNetReady) { + for (auto& i : _neurons) { + _target->draw(i._synapses, BlendAdd); + } + + for (auto& i : _neurons) { + _target->draw(i._nucleus, BlendAdd); + } + } + + if (_windowOpen) { + _window.display(); + } +} + +void +CppnExplorer::windowHandler() +{ + ContextSettings settings(0, 0, 8); + String title("Cppn Explorer"); + View view({-1.0f, -1.0f, 2.0f, 2.0f}); + VideoMode videoMode(RESOLUTION, RESOLUTION); + Uint32 style(Style::Titlebar | Style::Close); + + _window.create(videoMode, title, style, settings); + _window.setVerticalSyncEnabled(true); + _window.setView(view); + + while (_windowOpen) { + eventHandler(); + draw(); + } +} + +void +CppnExplorer::eventHandler() +{ + Event event; + + while (_window.pollEvent(event)) { + switch (event.type) { + case Event::Closed: + _windowOpen = false; + break; + + default:; + } + } +} + +void +CppnExplorer::neuralNetGenerator() +{ + _neuralNet.clear(); + _neuralNet.create(_cppn, _nnPrms); + + _neurons.reserve(_neuralNet.getNeurons().size()); + + for (auto& i : _neuralNet.getNeurons()) { + _neurons.emplace_back(i); + } + + _neuralNetReady = true; +} + +void +CppnExplorer::fieldGenerator() +{ + +} + +CppnExplorer::Neuron::Neuron(const NeuralNet::Neuron& refNeuron) +{ + _nucleus.setPosition(refNeuron._position._x, refNeuron._position._y); + _nucleus.setOrigin(_nucleus.getRadius(), _nucleus.getRadius()); + + Color nColor = (refNeuron._bias > 0.0 ? Color::White : Color::Red); + nColor.a = static_cast(fabs((refNeuron._bias / 3.0) * 112.0) + 16.0); + _nucleus.setFillColor(nColor); + + switch (refNeuron._type) { + case NeuralNet::Neuron::Type::INPUT: + _nucleus.setOutlineThickness(4.0f * PIXEL_SIZE); + _nucleus.setOutlineColor({255, 255, 255, nColor.a}); + break; + + case NeuralNet::Neuron::Type::OUTPUT: + _nucleus.setOutlineThickness(4.0f * PIXEL_SIZE); + _nucleus.setOutlineColor({255, 0, 0, nColor.a}); + break; + + default:; + } + + for (auto& i : refNeuron._synapses) { + auto iNeuron = *i._neuron; + Color sColor = (i._weight > 0.0 ? Color::White : Color::Red); + sColor.a = static_cast(fabs((i._weight / 3.0) * 112.0) + 16.0); + Vector2f iPos = {static_cast(iNeuron._position._x), static_cast(iNeuron._position._y)}; + Vector2f tPos = {static_cast(refNeuron._position._x), static_cast(refNeuron._position._y)}; + + _synapses.append({iPos, sColor}); + _synapses.append({tPos, sColor}); + } +} + +// void +// CppnExplorer::run(const Genome& genome, const NeuralNetPrms& nnPrms) +// { +// shutdown(); + +// _genome = genome; +// _nnPrms = nnPrms; + +// _cppn.create(_genome); +// _neuralNet.create(_cppn, _nnPrms); + +// { +// float gridStep = 2.0f / 16.0f; +// Color gridClr = _uiColor; +// gridClr.a = 64; + +// for (float i = -1.0f; i <= 1.0f; i += gridStep) { +// _grid.append({{ -1.0f, i }, gridClr }); +// _grid.append({{ 1.0f, i }, gridClr }); +// _grid.append({{ i, -1.0f }, gridClr }); +// _grid.append({{ i, 1.0f }, gridClr }); +// } +// } + +// _executor = Thread([&]() { +// _running = true; + +// { +// VideoMode videoMode(RESOLUTION, RESOLUTION); +// String title("Cppn Explorer"); +// Uint32 style(Style::Titlebar | Style::Close); +// ContextSettings settings(0, 0, 8); +// View view(FloatRect(-1.0f, -1.0f, 2.0f, 2.0f)); + +// _window.create(videoMode, title, style, settings); +// _window.setVerticalSyncEnabled(true); +// _window.setView(view); +// } + +// _cppn.inputAt(5) = 1.0; + +// _valueImage.create(RESOLUTION, RESOLUTION); +// _biasImage.create(RESOLUTION, RESOLUTION); +// print(&WEIGHTS); +// print(&BIAS); + +// _valueSprite.setTexture(&_valueTexture); +// _valueSprite.setSize(Vector2f(2.0f, 2.0f)); +// _valueSprite.setOrigin(1.0f, 1.0f); +// _valueSprite.setPosition(0.0f, 0.0f); + +// _biasSprite.setTexture(&_biasTexture); +// _biasSprite.setSize(Vector2f(2.0f, 2.0f)); +// _biasSprite.setOrigin(1.0f, 1.0f); +// _biasSprite.setPosition(0.0f, 0.0f); + +// _cursorH.setFillColor(_uiColor); +// _cursorV.setFillColor(_uiColor); +// _cursorH.setOrigin(_cursorH.getSize() / 2.0f); +// _cursorV.setOrigin(_cursorV.getSize() / 2.0f); +// _cursorH.setOutlineThickness(PIXEL); +// _cursorV.setOutlineThickness(PIXEL); +// _cursorH.setOutlineColor({ 128, 128, 128 }); +// _cursorV.setOutlineColor({ 128, 128, 128 }); + +// _neurons.reserve(_neuralNet.getNeuronsCount()); + +// for (auto& i : _neuralNet.getNeurons()) { +// _neurons.emplace_back(); +// createNeuron(_neurons.back(), i); +// } + +// while (_running) { +// Event event; + +// while (_window.pollEvent(event)) { +// switch (event.type) { +// case Event::KeyPressed: +// switch (event.key.code) { +// case Keyboard::B: +// _showBias = !_showBias; +// break; + +// case Keyboard::C: +// placeCursorAt({ 0.0f, 0.0f }); +// print(_field); +// break; + +// case Keyboard::F: +// _field == &WEIGHTS ? ++_field : --_field; +// print(_field); +// break; + +// case Keyboard::V: +// _showField = !_showField; +// break; + +// case Keyboard::N: +// _showNeurons = !_showNeurons; +// break; + +// case Keyboard::G: +// _showGrid = !_showGrid; +// break; + +// default:; +// } + +// break; + +// case Event::MouseButtonPressed: +// if (event.mouseButton.button == Mouse::Left) { +// placeCursorAt(_window.mapPixelToCoords(Mouse::getPosition(_window))); +// print(_field); +// } + +// break; + +// case Event::Closed: +// _running = false; +// break; + +// default:; +// } +// } + +// _window.clear({ 8, 8, 16 }); + +// if (_showField) { +// if (_showBias) { +// _window.draw(_biasSprite); +// } else { +// _window.draw(_valueSprite); +// } +// } + +// if (_showGrid) { +// _window.draw(_grid, { BlendMode::BlendAdd }); +// } + +// if (_showNeurons) { +// for (auto& i : _neurons) { +// _window.draw(i._synapses); +// } + +// for (auto& i : _neurons) { +// if (i._type != Neuron::Type::HIDDEN) { +// continue; +// } + +// _window.draw(i._body); +// _window.draw(i._nucleus); +// } + +// for (auto& i : _neurons) { +// if (i._type == Neuron::Type::HIDDEN) { +// continue; +// } + +// _window.draw(i._body); +// _window.draw(i._nucleus); +// } +// } + +// _window.draw(_cursorH); +// _window.draw(_cursorV); + +// _window.display(); +// } +// }); +// } + +// void +// CppnExplorer::shutdown() +// { +// if (_executor.joinable()) { +// _running = false; +// _executor.join(); +// } + +// this->~CppnExplorer(); +// new (this) CppnExplorer(); +// } + +// void +// CppnExplorer::print(const Color* field) +// { +// size_t out = 0; +// double* x1 = nullptr; +// double* y1 = nullptr; +// double* x2 = nullptr; +// double* y2 = nullptr; +// Image* image = nullptr; +// Texture* texture = nullptr; + +// if (field == &WEIGHTS) { +// x1 = &_cppn.inputAt(0); +// y1 = &_cppn.inputAt(1); +// x2 = &_cppn.inputAt(2); +// y2 = &_cppn.inputAt(3); +// } else { +// x1 = &_cppn.inputAt(2); +// y1 = &_cppn.inputAt(3); +// x2 = &_cppn.inputAt(0); +// y2 = &_cppn.inputAt(1); +// } + +// *x1 = _cursorPos.x; +// *y1 = _cursorPos.y; + +// if (field == &BIAS) { +// out = 1; +// image = &_biasImage; +// texture = &_biasTexture; +// } else { +// image = &_valueImage; +// texture = &_valueTexture; +// } + +// double half = static_cast(RESOLUTION / 2); + +// for (unsigned y = 0; y < RESOLUTION; ++y) { +// for (unsigned x = 0; x < RESOLUTION; ++x) { +// *x2 = (static_cast(x) - half) / half; +// *y2 = (static_cast(y) - half) / half; +// _cppn.inputAt(4) = Point(*x1, *y1).distance(Point(*x2, *y2)); +// _cppn.cycle(); + +// auto multColor = [](const Color& base, double factor) { +// Color result; + +// result.r = static_cast(static_cast(base.r) * factor); +// result.g = static_cast(static_cast(base.g) * factor); +// result.b = static_cast(static_cast(base.b) * factor); + +// return result; +// }; + +// if (_cppn.outputAt(out) > 0) { +// image->setPixel(x, y, multColor(Color::White, _cppn.outputAt(out))); +// } else { +// image->setPixel(x, y, multColor(*field, fabs(_cppn.outputAt(out)))); +// } +// } +// } + +// texture->loadFromImage(*image); +// } + +// void +// CppnExplorer::placeCursorAt(const Vector2f& newPos) +// { +// _cursorPos = newPos; +// _cursorH.setPosition(_cursorPos); +// _cursorV.setPosition(_cursorPos); +// } + +// void +// CppnExplorer::createNeuron(Neuron& repNeuron, const NeuralNet::Neuron& srcNeuron) +// { +// repNeuron._body.setOutlineThickness(PIXEL * 2.0f); +// repNeuron._nucleus.setOutlineThickness(PIXEL * 2.0f); + +// float radius = 0.0f; +// Color inputColor = BIAS; +// Color hiddenColor = INV_WEIGHTS; +// Color outputColor = WEIGHTS; + +// inputColor.a = 128; +// hiddenColor.a = 128; +// outputColor.a = 128; + +// switch (srcNeuron._type) { +// case NeuralNet::Neuron::Type::INPUT: +// repNeuron._type = Neuron::Type::INPUT; +// repNeuron._body.setOutlineColor(inputColor); +// repNeuron._body.setFillColor({ 0, 0, 0, 200 }); +// radius = PIXEL * 24.0f; +// break; + +// case NeuralNet::Neuron::Type::HIDDEN: +// repNeuron._type = Neuron::Type::HIDDEN; +// repNeuron._body.setOutlineColor(hiddenColor); +// repNeuron._body.setFillColor({ 0, 0, 0, 200 }); + +// { +// float level = 1.0f; +// for (; srcNeuron._position._x * level != floor(srcNeuron._position._x * level); level *= 2.0f); +// radius = 1.0f / (level * 4.0f); + +// if (radius > PIXEL * 16.0f) { +// radius = PIXEL * 16.0f; +// } +// } + +// break; + +// case NeuralNet::Neuron::Type::OUTPUT: +// repNeuron._type = Neuron::Type::OUTPUT; +// repNeuron._body.setOutlineColor(outputColor); +// repNeuron._body.setFillColor({ 0, 0, 0, 200 }); +// radius = PIXEL * 24.0f; +// break; +// } + +// repNeuron._body.setRadius(radius); +// repNeuron._body.setOrigin(radius, radius); +// repNeuron._body.setPosition(srcNeuron._position._x, srcNeuron._position._y); + +// repNeuron._nucleus.setRadius(radius / 2.0f); +// repNeuron._nucleus.setOrigin(radius / 2.0f, radius / 2.0f); +// repNeuron._nucleus.setPosition(srcNeuron._position._x, srcNeuron._position._y); +// repNeuron._nucleus.setOutlineColor(repNeuron._body.getOutlineColor()); + +// double multInt = static_cast(fabs(srcNeuron._bias / 3.0) * 255.0); +// Color colorMult(multInt, multInt, multInt, 128); + +// if (srcNeuron._bias > 0) { +// repNeuron._nucleus.setFillColor(Color::White * colorMult); +// } else { +// repNeuron._nucleus.setFillColor(BIAS * colorMult); +// } + +// Color synColor = WEIGHTS; + +// for (auto& i : srcNeuron._synapses) { +// for (auto& j : _neuralNet.getNeurons()) { +// if (&j._output == i._input) { +// Uint8 weight = static_cast(i._weight * 20.0); +// Vector2f srcPos(j._position._x, j._position._y); + +// if (i._input == &srcNeuron._output) { +// Color selfSynColor; + +// if (i._weight > 0.0) { +// selfSynColor = Color(255, 255, 255, 20 + weight); +// } else { +// selfSynColor = synColor; +// } + +// float rad2 = repNeuron._body.getRadius() * 2.0f; +// Vector2f p1 = repNeuron._body.getPosition() + Vector2f(-rad2, -rad2); +// Vector2f p2 = repNeuron._body.getPosition() + Vector2f(-rad2, rad2); +// Vector2f p3 = repNeuron._body.getPosition() + Vector2f( rad2, rad2); +// Vector2f p4 = repNeuron._body.getPosition() + Vector2f( rad2, -rad2); + +// repNeuron._synapses.append({ p1, selfSynColor }); +// repNeuron._synapses.append({ p2, selfSynColor }); + +// repNeuron._synapses.append({ p2, selfSynColor }); +// repNeuron._synapses.append({ p3, selfSynColor }); + +// repNeuron._synapses.append({ p3, selfSynColor }); +// repNeuron._synapses.append({ p4, selfSynColor }); + +// repNeuron._synapses.append({ p4, selfSynColor }); +// repNeuron._synapses.append({ p1, selfSynColor }); +// } else { +// repNeuron._synapses.append({ repNeuron._body.getPosition(), Color::Black }); + +// if (i._weight > 0.0) { +// repNeuron._synapses.append({{ srcPos }, Color(255, 255, 255, 20 + weight) }); +// } else { +// synColor.a = 20 + weight; +// repNeuron._synapses.append({{ srcPos }, synColor }); +// } +// } + +// break; +// } +// } +// } +// } diff --git a/plugins/CppnExplorer/todolist.txt b/plugins/CppnExplorer/todolist.txt new file mode 100644 index 0000000..5677680 --- /dev/null +++ b/plugins/CppnExplorer/todolist.txt @@ -0,0 +1,21 @@ +Cppn Explorer: + ☐ Render to any sf::RenderTarget + ☐ Calculate field on separate thread (keep 2 textures) + ☐ Render Neurons as crossmarks + ☐ (When Rendering to Window) Cycle fields with F key + ☐ (When Rendering to Window) Cycle between Neurons and Synapses using arrow keys + ☐ Display text data + ☐ (When Rendering to Window) Embed icon + ☐ Show Cppn Network + + +___________________ +Archive: + ✔ Display connection to same neuron as square around neuron @done (13-12-10 00:29) @project(Cppn Explorer) + ✔ Use better color and blending for neurons @done (13-11-25 00:24) @project(Cppn Explorer) + ✔ Display Synapses as blended lines with Transparency representing Weights @done (13-11-25 00:24) @project(Cppn Explorer) + ✔ Display cursor beatifully @done (13-11-23 20:31) @project(Cppn Explorer) + ✔ Display grid @done (13-11-23 01:58) @project(Cppn Explorer) + ✔ Fix cursor @done (13-11-21 02:18) @project(Cppn Explorer) + ✔ Print and switch between fields @done (13-11-06 04:35) @project(Cppn Explorer) + ✔ Display Neurons beautifully (with bias represented as a nucleus) @done (13-11-04 20:52) @project(Cppn Explorer) -- cgit v1.2.1