Skip to content
forked from bjrne/elea

Invent new EAs and GA or show your students how they work. This fork is available through Github Pages

Notifications You must be signed in to change notification settings

TimoKoetzing/elea

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elea

This is a little tool designed to prototype evolutionary algorithms, get an intuition for runtimes or for teaching EAs to students.

Run

  • Use go run webserver.go
  • If you don't have go installed on your system or prefer to use docker, run: docker build . -t elea followed by docker run -p 8080:8080 elea

Write new blocks

Steps:

  1. Think of all the connections you need and build your block in the block factory:
  2. Copy the json definition into the newblocks.js or similar JS file and include it
  3. Also copy the JS code stub from the factory into this JS file.
  4. Add the block to the toolbox in any category via its name (roughly in lines 5-150 in index.html). You should now be able to see it in the toolbox and use it.
  5. In order to actually do something, you need to replace the generated code with actual code. I essence, you need to return valid JS code in a string (ES5). Since debugging parsing errors is rather hard in this environment I suggest to try atomic expressions you want to use in this live demo. Anything that does not work there will not work in blockly either. Goodbye arrow-functions and other syntactic sugar of ES6!
  6. You should now have a working block 🎉

Additional things to consider: Variables and functions could collide with user defined objects. Blockly can handle this for you, if you let it. You need to ask for valid names etc. In its current state, the documentation is barely understandable and does not prominently mention all necessary functions, I find the predefined open source blocks much more helpful: https://github.com/google/blockly/blob/master/generators/javascript/math.js

About

Invent new EAs and GA or show your students how they work. This fork is available through Github Pages

Topics

Resources

Stars

Watchers

Forks

Languages

  • JavaScript 98.4%
  • HTML 1.4%
  • Other 0.2%