Robust Physical Computation
Table of Contents
- meta
- topics
- pondering
- open source hard ware
- synapse darpa project
- remote board reset – rescue from blink code
- color/video e-paper – would be good w/IXM
- communication system
Net
- profiling information
- memristor
- track buffer status – am I overflowing?
- mobile software agents
- display
- distributed problem sets
- distributed computation (scheme-splits)
- anything that's arduino-ready we can talk to
- wii remote
- task [44/44]
- persistence/future of RPC/IXM
- tell sam about Euclidean TSP algorithm
- do some writing
- something up with the boards?
- simplified polynomials
- begin experimentation
- share IXM git repositories on the mailing list
- guile on IXM
- write up an actual textual abstract
- select functions
- GA of a CA
- read paper
- experimental setup/schedule
- last week for code tweaks, tangling for boards
- outline, abstract, title
- SFBNet sketch
- reverse representation strings on reporting
- mutation is length sensitive
- less converging
- parameter tuning w/Ackley
- instrument population for collecting uniqueness statistics
- stochastic tests for operators [3/3]
- ensure y works
- get it to work
- ping Dave about notes up on the class site
- READ: Gerald Jay Sussman is awesome
- grid testing paper
- unit tests for evolution stuff
- outline
- read robustness paper
- denser sampling
- parse experimental log files resulting from experimenter.clj
- start some real experiments
- live display of variable fitness landscapes
- fitness-landscape scaling
- graph partition
- clojure-interface – simulation and visualization
- collector release
- add profiling to evolution
- overlapping fitness[3/3]
- clojure interface wrapper – batch and repl
- fix collector
- find a paper
- reading on HP stuff
- find a GP conference
- find a paper for next week
- read paper which should have received
- email out this paper
- experimental results
meta
- class web page http://cs.unm.edu/~ackley/691/
- IXM wiki http://robust.cs.unm.edu/doku.php
- IXM API http://livingcomputation.com/s/doc/
- Office Hours: Tuesday/Thursday: 4-5, Wednesday: 1-3
topics
pondering
Over the course of listening to the research plan's of my lab-mates, I've got some general IXM thoughts
-
George Bezerra is working with networks on chip. Many of the XIM
issues (e.g. communication between a grid of processing elements,
distributed memory, etc…) have direct counterparts in the research
of these new large chips
- schemas for communicating between boards/processors (e.g. "Dimension-Order Routing)
- cache coherence (both "snooping" and "directory")
- a variety of scheduling algorithms for coordinating computation distributed in both time (dependencies) and space (across separate processors)
- In terms of slightly different hardware for the IXM, I wonder what the smallest feasible unit of IXM could be – meaning smallest board, least amount of functionality, cheapest processor, s.t. boards could still connect and collaborate, (e.g. microcontrollers, Digital Signal Processor with some generalizable functionality)
open source hard ware
synapse darpa project
remote board reset – rescue from blink code
SET_REFLEX_FLAGS(RF_OKAY_NEW_GUY); // but this in setup(), blink 10 times then reboot SET_REFLEX_FLAGS(RF_KARMIC_REBIRTH); // if recovering from a blink code, burn from a neighbor
color/video e-paper – would be good w/IXM
they have DIY netbook transition kits
communication system Net
-
name could possibly be
Net
- FGR = functional gradient routing
-
build upon existing reflexes –
Net.broadcast
could make one of your reflexes available to anyone inside of your gradient - virtual faces that hyper-jump to other boards
profiling information
- there's a profiling example in AdvancedExamples
- looks pretty easy to use
-
recall
Profile.begin()
after reporting if you don't want cumulative stats
track buffer status – am I overflowing?
SFBSerial.h
has some new measures
- [input/output]Buffer[used/free]
- brokenPackets
mobile software agents
implement some simple virtual machine
- RPN
- bytecodes
processes carry around a little stack or something that they can unpack when they land on a new board
specialized processors – heterogeneous environment
with respect to mobile processes
- cell processor (play station)
- road runner super-computer has many different types of processors
- biological cells all start with same DNA then specialize – IXM w/same initial code, then specialize
display
sparkfun
- 3.3 volts
- 16x2 Character LCD
- serial display (much easier)
distributed problem sets
- evolve solutions to the four coloring problem distributed over the boards
-
more general – any graph problem (e.g. Hamiltonian path) could be
distributed over the boards – which themselves form a graph, or
more appropriately the edges in a hypergraph which shares vertices
with the graph of the problem
- would need a way of mapping vertices to IXMs and edges through IXM connections…
- could dynamically change the number of IXMs devoted to subgraphs as needed by the problem
distributed computation (scheme-splits)
- referential parsimony
- following your tail up through the call stack, caching, make space requirements reasonable
anything that's arduino-ready we can talk to
wii remote
johnny lee, has done some wii remote stuff
task [44/44]
DONE persistence/future of RPC/IXM
2: A discussion topic for Monday:
How can RPC/IXMish have a long life
and avoid the fate of the vanishing
'Jelly Bean Machine'?
I'm looking for any and everything
from brainstorming and out of the box
ideas to practical and near term
actions.
Samples:
- Expectation management
- Delay confronting incumbent
- Steady science and engineering
- Multiple thrusts/funding sources
- New hardware generations
- Demos, videos, theme comic book,
product placements, endorsements..
DONE tell sam about Euclidean TSP algorithm
- divide space up into grids, finding a crossing across grids
- due to Aurora
- portals or border crossings – the more of them you make, the better the approximation
DONE something up with the boards?
sfbpush Ln Wed Apr 28 23:54:01 2010 [Running in server mode] Ln Wed Apr 28 23:54:01 2010 [Loaded EMS:PEC/20100429-55350 Size=73240 CS=13319D7-D38392F Copyright=GPL V3] Ln Wed Apr 28 23:54:02 2010 [North baud rate set to 115200] Ln Wed Apr 28 23:54:10 2010 [North baud rate set to 9600] Ln Wed Apr 28 23:54:10 2010 [North baud rate set to 115200] Ln Wed Apr 28 23:54:11 2010 [North seeking arch 2 code, responding] Ln 8.261 Best offer so far: EMS:PEC/20100429-55350 (size 73236) from North 1L6JUGI/SFBPRG c (1,0) 0.00 0.00 7120 471.65 736.25 10.00 10.00 -1.00 55+xs*55+ys*+ +534084/-0+4x/6-*80y23y29x/y-96/+x-y*89+y3+/+4+y/ c (2,3) 0.00 0.00 7120 476.42 793.03 10.00 10.00 -1.00 55+xs*55+ys*+ 4*+15x2x1y/*74+/8840-y+5y9x/y-96/+x-*48+y3+/++y/ c (1,3) 0.00 0.00 7120 477.67 764.33 10.00 10.00 -1.00 55+xs*55+ys*+ 4+74/7y/39*5+80978y9x/y-77/+x-*469+y3+/++y/ Ln 9.758 About to burn: 0/0 bootCount=1222; burnCount=832 (+1); powerOnHours=843; flags=0 Ln Wed Apr 28 23:54:13 2010 [Sending checksum North for 0x10014+32748=DA6A566-CD16DB7B] Ln Wed Apr 28 23:54:18 2010 [Sending checksum North for 0x18000+32768=5A68A208-C62322E8] Ln Wed Apr 28 23:54:23 2010 [Sending checksum North for 0x20000+7700=B7496EA9-E9D7245E] Ln Wed Apr 28 23:54:26 2010 [North burned successfully!] Ln Wed Apr 28 23:54:29 2010 [North baud rate set to 9600]
DONE simplified polynomials
try something like… (x+1)^k(y+2)^l
DONE begin experimentation
follow through on the TODOs posted up there
-
Parameter lockdown:
0: Fix # sample points independent of range+dimensionality
1: Repro tournament==3
2: Mutation period==100ms 50ms?
3: Crossover period==500ms
4: Sharing period==10000ms
5: Geometry is line for 1D + grid for 2D
-
Functions:
1: Matching exactly-matchable functions
1a: Functions of order n for n=0,1,2,3,4,5
3x- xx3** 3333333+++++
1b: Test them.
Question: Discover exact match? How fast?
2: Approximating non-exactly-matchable functions
3: f(x,y) 2D inputs s
-
Crossed with:
All work on all range
All work on nonoverlapping patches
All work on overlapping patches
All work adaptively?
-
Anecdotal samples of varying geometry:
Line vs D
Grid vs D
DONE share IXM git repositories on the mailing list
push these to the public mailing list.
CANCELED guile on IXM
-
State "CANCELED" from "TODO"
impossible - see http://www.lonelycactus.com/guilebook/x246.html for good guile intro
- see ~/research/ixm/learn-guile/ for simple embedded guile
- see ~/guile-arm/ for guile compiled for arm
compiling guile with
./configure --without-threads --target=arm-linux-gcc --host=arm-linux --prefix=/home/eschulte/guile-arm/
resulting in guile-arm-compile.out
refer to – the cross compilation guide
Cross building Guile =====================================================
Guile can be cross-compiled for Windows using the i586-mingw32msvc
cross-compiler. To do this, you first need to cross-build Guile's
prerequisites - GNU MP and libtool/libltdl (as described above) - and
then cross-build Guile itself.
For each of these steps, configure using an invocation like this:
CPPFLAGS=-I/usr/local/i586-mingw32msvc/include \
LDFLAGS=-L/usr/local/i586-mingw32msvc/lib \
GUILE_FOR_BUILD=/usr/local/bin/guile \
./configure –prefix=/usr/local/i586-mingw32msvc –host=i586-mingw32msvc
Then run `make' - which should complete without any errors - and `sudo
make install'. (`make check' doesn't work when cross-compiling,
because the built DLLs and program cannot be run on GNU/Linux.)
The `GUILE_FOR_BUILD=…' setting is needed because some later steps
of the build process use Guile itself. In the non-cross-compiling
case this is the version of Guile that has just been built. When
cross-compiling, you have to set GUILE_FOR_BUILD to tell the build
where it can find a native version of Guile, to use for these steps.
Cross-compiling for other hosts may also work, using the following
instructions; but this has not been recently tested.
To configure Guile for cross building, for example for Cygwin:
./configure –host=i686-pc-cygwin –disable-shared
A C compiler for the build system is required. The default is
"PATH=/usr/bin:$PATH cc". If that doesn't suit it can be specified
with the CC_FOR_BUILD variable in the usual way, for instance
./configure –host=m68k-unknown-linux-gnu CC_FOR_BUILD=/my/local/gcc
Guile for the build system can be specified similarly with the
GUILE_FOR_BUILD variable, it defaults to just "guile".
CPPFLAGS=-I/home/eschulte/src/ixm/arm-2008q3/include \ LDFLAGS=-L/home/eschulte/src/ixm/arm-2008q3/lib \ GUILE_FOR_BUILD=/usr/local/bin/guile \ CC_FOR_BUILD=/home/eschulte/src/ixm/arm-2008q3/bin/arm-none-eabi-gcc \ ./configure --without-threads --prefix=/usr/local/arm --host=arm-linux --with-gmp=/usr/include/
the above works and successfully compiles an arm guile, however it fails on sketch compilation because it needs gmp, so according to here I may need to also cross-compile
gmp and libltdl
now to cross-compile gmp
configuring with
CPPFLAGS=-I/home/eschulte/src/ixm/arm-2008q3/include \ LDFLAGS=-L/home/eschulte/src/ixm/arm-2008q3/lib \ CC_FOR_BUILD=/home/eschulte/src/ixm/arm-2008q3/bin/arm-none-eabi-gcc \ ./configure --prefix=/usr/local/arm --host=arm-linux
results in
configure: error: Specified CC_FOR_BUILD doesn't seem to work
however removing
CC_FOR_BUILD=/home/eschulte/src/ixm/arm-2008q3/bin/arm-none-eabi-gcc
results in a successful configuration, but a failed build with
tmp-add_n.s: Assembler messages: tmp-add_n.s:58: Error: no such instruction: `stmfd r13!,{r8,r9,r14}' tmp-add_n.s:59: Warning: `r3' is not valid here (expected `(%esi)') tmp-add_n.s:59: Warning: `r3' is not valid here (expected `(%edi)') tmp-add_n.s:59: Error: too many memory references for `movs' tmp-add_n.s:60: Error: no such instruction: `bcc .Lskip1' tmp-add_n.s:61: Error: no such instruction: `ldr r12,[r1],' tmp-add_n.s:62: Error: no such instruction: `ldr r14,[r2],'
other scheme options
- chicken scheme – http://chicken.wiki.br/cross-compilation-on-open-moko
DONE write up an actual textual abstract
- actually write this up in text with sentences
- email back and forth with Ackley over this week
DONE select functions
(see notes, create a variety of polynomials of increasing degrees)
thank you wikipedia
GA of a CA
got code from Tyler, documentation is up at http://www.cs.unm.edu/~ltrush/cs523/assign2/documentation/
see data/ca/
DONE SFBNet sketch
write up an SFBNet sketch
Propagator for square root via the heron step.
not general, but does work.
DONE reverse representation strings on reporting
done, although apparently wrapping this up in a function is very difficult in C…
DONE mutation is length sensitive
- mutation should be dependent on the length, so that individuals can't grow as a defense against having their sensitive parts mutated.
DONE less converging
I suspect your population is horribly
converged, so the search is amounting to
an expensive stochastic hillclimb.
Some things to maybe try:
(A) Be less elitist:
(1) On each 'generation', generate
only one or a handful of new
genomes – perhaps up to 10 max
– based on parents selected by
tournament as you do now.
(2) Insert the offspring into
uniformly-randomly-chosen
population slots – with no
'death tournaments' –so there's
no elitism and no guarantee of
getting into the next generation.
Try just that first, keeping everything
else the same, and see if anything
changes. If things still suck, maybe
try:
(B) Extend mutation to encompass:
(1) Random change to existing spot
(what you have now)
(2) Random insertion of a single new
character at a random position.
(If result exceeds max length,
then truncate the last character)
(3) Random deletion of a single
character at a random position.
If the genome is then 0, then
insert one random character.
On a given mutation, perhaps do (1)
50% of the time, (2) 25% of the time,
and (3) 25% of the time.
DONE instrument population for collecting uniqueness statistics
should report the number of people who have the most popular score.
DONE initial
done with the naive implementation however this isn't sufficient, because the two individuals are actually the same if they have the same rpn string. for now as a quick fix, I'm just going to run this on the float scores, rather than the representations…
DONE READ: Gerald Jay Sussman is awesome
some really relevant and generally sweet looking papers by Mr. Sussman
- NIAI-2008.pdf – Engineered Robustness by Controlled hallucination
- MIT-CSAIL-TR-2009-002.pdf – The art of the Propagator
we should read both of these, they look awesome
The art of the Propagator
for modern output from the constraint community see this thesis work http://www.ps.uni-saarland.de/Papers/abstracts/tackDiss.html
- combines expression and constraint programming
- autonomous machine communicating through "cells"
- propagator network computational metaphor for exploring the consequences of allowing places to accept information from multiple sources
elements
- cell
- communication mechanisms
- propagator
- machines connected by cells
lots of scheme code implementing propagators…
- partial information
a nice examples where a cell contains the answer to a question "how tall is a building", and the cell is populated through different techniques, one of which supplies an upper bound, and one a lower bound. - multidimensional computation
DONE grid testing paper
- use untrusted heterogeneous grid of computers for testing applications
- unit tests are embarrassingly parallel (why embarrassing)
- built on top of the globus toolkit
-
what
Moreover, an adaptive scheduling scheme using swarm intelligence is employed to efficiently use the computational resources
- master/slave setup for executing tasks taken from a bag of tasks
ant colony optimization
- I don't think ant colonies actually are computational environments…
-
looks like it takes the ant metaphor very seriously
- scout – detect new grid services
- worker – match tasks with grid servers
- collector – retrieve partial testing results (seems like this guy should be merged with the worker)
- cleaner – helps to maintain available grid resource table
- queen – produces specialized ants
probability \(q_i\) of selecting a grid server $i$ for a testing task is
$$q_i = \frac{p_i}{\sum^{n}_{j=1}{P_j}}$$where \(P_i\) is the value of the grid server $i$, and n is the total number of available grid servers, so each server is selected with probability proportional to its pheromone level.
- when a server completes a task its pheromone level is increased
- bonus for the guy who completes the most tasks
- pheromone's evaporate
- remove servers with pheromone levels below threshold
dealing with untrustworthy nodes
- redundancy
- check pointing
- separate execution and result comparison
- verification code injection
DONE outline
now in the main file in ~/research/ixm/
DONE parse experimental log files resulting from experimenter.clj
(ns exp-parser (:require (clojure.contrib (duck-streams :as f) (command-line :as c) (math :as m))) (:import (java.io InputStreamReader OutputStreamWriter BufferedReader) (clojure.lang LineNumberingPushbackReader) java.util.Date java.text.SimpleDateFormat) (:use [clojure.main :only (repl)] clojure.contrib.seq-utils)) (defn read-log [in-path] "Read a log file parsing each line w/regex. Note this remove non-collector lines, like board chatter, and mutating too fast complaints." (remove #(not %) (map #(re-matches #"^(\d+)\s+\(([-\d]+),([-\d]+)\)\s+(.+):\s+(.*)$" %) (f/read-lines in-path)))) (defn by-board [log] "Split up the output of read-log into a hash keyed by board location." (reduce #(assoc %1 (format "(%s,%s)" (first %2) (second %2)) (map (fn [line] (assoc {} :wall (Integer/parseInt (nth line 1)) :type (nth line 4) :what (nth line 5))) (remove (fn [ln] (not (= %2 ))) log))) {} '(("-3" "0") ("-2" "0") ("-1" "0") ("0" "0") ("3" "0") ("2" "0") ("1" "0")))) (defn lines-to-hashes [log] (map (fn [line] (assoc {} :x (Integer/parseInt (nth line 2)) :y (Integer/parseInt (nth line 3)) :wall (Integer/parseInt (nth line 1)) :type (nth line 4) :what (nth line 5))) log)) (defn by-loop [col] "Compact a board's output lines into hash maps by which loop generated them." (map (fn [cols] (let [hmps (apply concat cols)] (reduce #(assoc %1 :wall (:wall %2) (keyword (:type %2)) (:what %2)) {} hmps))) (let [sec? (fn [line] (= (:type line) "seconds"))] (partition 2 (partition-by sec? (drop-while (complement sec?) col)))))) (c/with-command-line (rest *command-line-args*) "Parse output of experimenter.clj, pass paths to log files as arguments" [[board "print out results for a particular board, grouped by loop"] [key "print out the value of the given key whenever it appears"] others] (let [path (first others) log (read-log path)] ;; print out results for a particular board, grouped by loop (when board (let [boards (by-board log)] (println (pr-str (assoc {} board (by-loop (get board boards))))))) ;; print out the values of key whenever it appears in any board (when key (let [log (lines-to-hashes log)] (doseq [line log] (when (= (:type line) key) (println ;; convert wall time to hh:mm:ss (let [h (m/floor (/ (/ (:wall line) 1000) 3600)) m (m/floor (/ (- (/ (:wall line) 1000) (* h 3600)) 60)) s (m/round (- (- (/ (:wall line) 1000) (* h 3600)) (* m 60)))] (format "%02d:%02d:%02d\t%d,%d\t%s" h m s (:x line) (:y line) (:what line))))))))))
DONE start some real experiments
sectioned landscape vs. interleaved vs. overlap vs. not overlap vs. malleable
graph best in grid vs. wall-clock time
best fitness's
distributed
overlapping
annealing
interleaved
best individuals
- distributed
73*x11/+4/++51xxx13*y/++6y5*6/6-+xx+*
- overlapping
x67-*021y-8362734-+x0-211/563y++/63y++9-2*x*
- annealing
675332x9y/50+*-/*637*y6-76yy/2y-2yx**
- interleaved
+*493*x24yx95/*y*
-2 "72+1117/42597+/97+//414y0+/+843yy13/x+/+*4x+/" "((3 * (y + (y / ((1 / 3) + x)))) / (4 + x))" -1 "14/+3x8695/x3-95/x395/x32/+x**y*" "(((9 / 5) * ((x + (3 / 2)) * x)) * y)" 0 "+*493*x24yx95/*y*" "((x * (9 / 5)) * y)" 1 "//6072*x7*5/3623*84y9x+x+/yx*x*x*4/-y+" "(((y / ((9 + x) + x)) - ((((y * x) * x) * x) / 4)) + y)" 2 "2yx80656y*yx/1x00yx/1/15x-//x/x52-//x/x/y-" "((((((((y / x) / 1) / (1 / (5 - x))) / x) / (x / (5 - 2))) / x) / x) - y)" 3 "39y/8-/-1y-/x4y8x-/-/15-2y40y40+x-/4y*x/-" "((y / ((4 + 0) - x)) - ((4 * y) / x))"
live display of variable fitness landscapes
Write a simple script to scroll generate graphs of the best functions of each board on its changing range.
(require ((clojure.contrib (duck-streams :as f) (shell-out :as s)))) (defn ingest "Organize output from boards" [path] (let [boards (ref {})] (dosync (alter boards assoc ))))
DONE fitness-landscape scaling
at some interval my fitness is reset to the product of…
fitness_landscape_range = fitness_landscape_range mean_fitness/average(neighbor_mean_fitness)
see malleable
graph partition
Distribute a graph over a set of boards s.t. the number of nodes per board is as even as possible, and edges are stretched as little as possible.
this could look good with a clojure-interface
representation
how to represent the graph?
- should be possible to represent only the relevant subgraph onboard – i.e. the whole graph shouldn't need to exist on every board
- edges or nodes, either each board holds a list of its nodes, along with the nodes to which they are connected, or each board holds a list of the edges which have one end in themselves
moving a node
how to move a node between two boards – need to update all of the edges touching that node
CANCELED clojure-interface – simulation and visualization
-
State "CANCELED" from "HOLD"
not right now, don't simulate!
Since its naturally multi-threaded it could be a good way to simulate a collection of boards. If done well then the visualization for the simulated boards could also be used to visualize data collected from a real set of boards.
visualization takes data in collector form
started doing stuff in the gui
directory under research/ixm
DONE collector release
- clean it up
- push it up somewhere – maybe to repo.or.cz
add profiling to evolution
(see profiling-information)
DONE overlapping fitness[3/3]
- overlapping fitness
- free rides for new guys
- [X] got it running
- [X] need to implement free ride
- [X] analyze results – gnuplots with multiple graphs each over different domains
DONE clojure interface wrapper – batch and repl
done. (see http://repo.or.cz/w/ixm-repl.git)
wrap sfbprog in obj which can print to screen
so this actually works… async reading from a command
(defmacro while-let "Like while, but uses when-let instead of when." [test & body] `(loop [] (when-let ~test ~@body (recur)))) (defmacro in-cmd [cmd & body] `(let [proc# (.exec (Runtime/getRuntime) (into-array ~cmd))] (with-open [stdout# (BufferedReader. (InputStreamReader. (.getInputStream proc#))) proc-input# (OutputStreamWriter. (.getOutputStream proc#))] (def proc-in proc-input#) (binding [*in* stdout#] ~@body)))) (let [out *out*] (future (binding [*out* out] (in-cmd (list "guile") (while-let [line (read-line)] (println line)))))) (binding [*out* proc-in] (println "(+ 1 2 3 4)"))
expose all of this through a ref @tribe
(use 'clojure.contrib.except) (def tribe {:sfbprog-cmd "sfbprog" :usb-dev "/dev/ttyUSB0"}) (def repl-out *out*) (def tribe-in nil) (def reflexes {:L repl-print}) (defn repl-print [line] (binding [*out* repl-out] (println line))) (defn tribe-print [line] (when (nil? tribe-in) (throwf "not connected to tribe")) (binding [*out* tribe-in] (println line))) (defn dump [line]) (defn connect [] (future (let [proc (.exec (Runtime/getRuntime) (into-array (list (:sfbprog-cmd tribe) "-n" (:usb-dev tribe) "-S" "-" "-t" "0")))] (with-open [stdout (BufferedReader. (InputStreamReader. (.getInputStream proc))) proc-input (OutputStreamWriter. (.getOutputStream proc))] (def tribe-in proc-input) (binding [*in* stdout] (loop [] (when-let [line (read-line)] (react lines))))))))
seems to be working
(ns #^{:author "Eric Schulte", :license "GPLV3", :doc "interact with an IXM tribe through a Clojure repl"} ixm-repl (:import (java.io InputStreamReader OutputStreamWriter BufferedReader) (clojure.lang LineNumberingPushbackReader)) (:use [clojure.main :only (repl)] clojure.contrib.duck-streams clojure.contrib.command-line clojure.contrib.except clojure.contrib.repl-utils)) (def tribe {:sfbprog-cmd "sfbprog" :usb-dev "/dev/ttyUSB0"}) (def repl-out *out*) (def tribe-in nil) (defn repl-print [line] (binding [*out* repl-out] (println line))) (defn tribe-print [line] (when (nil? tribe-in) (throwf "not connected to tribe")) (binding [*out* tribe-in] (println line))) (defn dump [line]) (def reflexes {:L 'repl-print}) (defn react [line] (eval `(~(get reflexes (keyword (subs line 0 1)) 'repl-print) ~line))) (defn connect [] (future (let [proc (.exec (Runtime/getRuntime) (into-array ;; (list (:sfbprog-cmd tribe) ;; "-n" (:usb-dev tribe) "-S" "-" "-t" "0") (list "bash") ) )] (with-open [stdout (BufferedReader. (InputStreamReader. (.getInputStream proc))) proc-input (OutputStreamWriter. (.getOutputStream proc))] (def tribe-in proc-input) (binding [*in* stdout] (loop [] (when-let [line (read-line)] (react line) (recur))))))))
complex parsing of output
(ns experimenter (:require (clojure.contrib (duck-streams :as f) (command-line :as c))) (:import (java.io InputStreamReader OutputStreamWriter BufferedReader) (clojure.lang LineNumberingPushbackReader) java.util.Date java.text.SimpleDateFormat) (:use [clojure.main :only (repl)])) (defn message [fmt & args] (binding [*out* *err*] (println (apply format (cons fmt args))))) (defn reset-and-cycle-resets [since resets counter] (dosync (ref-set since (new Date))) (message "resetting------------------------------------------") (message "%s" (nth resets @counter)) (println (nth resets @counter)) (message "reset----------------------------------------------") (dosync (ref-set counter (mod (inc @counter) (.size resets))))) (defmacro while-let "Like while, but uses when-let instead of when." [test & body] `(loop [] (when-let ~test ~@body (recur)))) (defmacro in-cmd [cmd & body] `(let [proc# (.exec (Runtime/getRuntime) (into-array ~cmd))] (with-open [stdin# (OutputStreamWriter. (.getOutputStream proc#)) stdout# (BufferedReader. (InputStreamReader. (.getInputStream proc#)))] (binding [*in* stdout# *out* stdin#] ~@body)))) (c/with-command-line (rest *command-line-args*) "Programmable interaction with IXM grid through sfbprog." [[usb-dev "Path to usb device connected to IXM grid" "/dev/ttyUSB0"] [sfbprog-cmd "Command used to call sfbprog" "sfbprog"] [out-file "file to which results will be saved" "experimenter.log"] [repl? "run interactively in a repl -- not yet supported"] rest] (in-cmd ;; sfbprog -n /dev/ttyUSB0 -S - -t 0 (list sfbprog-cmd "-n" usb-dev "-S" "-" "-t" "0") (if repl? ;; interactive (message "repl mode is not currently supported") ;; batch (let [date-formatter (new SimpleDateFormat "dd:HH:mm:ss") since (ref (new Date)) counter (ref 0) resets (list "r B:0 y:100 x:700 Y:0 X:14" ;; interleaved "r B:0 y:100 x:100 Y:0 X:100" ;; sectioned "r B:0 y:100 x:120 Y:0 X:100" ;; sectioned overlap "r B:100000 y:100 x:100 Y:0 X:100" ;; sectioned malleable )] (doseq [n (range 10)] (message "%d %s" (- 10 n) (read-line)) (println (format "L test %d" n))) (reset-and-cycle-resets since resets counter) (while-let [line (read-line)] ;; normal logging ;; (message "%s %s" (.format date-formatter (new Date)) line) (message "%d %s" (- (.getTime (new Date)) (.getTime @since)) line) ;; check if its time for the next experiment (when (> (- (.getTime (new Date)) (.getTime @since)) 14400000) (reset-and-cycle-resets since resets counter)))))))
attempt at a ixm repl
(ns experimenter (:require (clojure.contrib (duck-streams :as f) (shell-out :as s) (command-line :as c))) (:import (java.io InputStreamReader OutputStreamWriter BufferedReader StringWriter) (clojure.lang LineNumberingPushbackReader) java.util.Date) (:use [clojure.main :only (repl)])) (defmacro while-let "Like while, but uses when-let instead of when." [test & body] `(loop [] (when-let ~test ~@body (recur)))) (defmacro in-cmd [cmd batch? & body] `(let [proc# (.exec (Runtime/getRuntime) (into-array ~cmd))] (with-open [stdin# (if ~batch? (OutputStreamWriter. (.getOutputStream proc#)) (StringWriter. 200)) stdout# (if ~batch? (BufferedReader. (InputStreamReader. (.getInputStream proc#))) (LineNumberingPushbackReader. (InputStreamReader. (.getInputStream proc#))))] (binding [*in* stdout# *out* stdin#] ~@body)))) (c/with-command-line (rest *command-line-args*) "Programmable interaction with IXM grid through sfbprog." [[usb-dev "Path to usb device connected to IXM grid" "/dev/ttyUSB0"] [sfbprog-cmd "Command used to call sfbprog" "sfbprog"] [out-file "file to which results will be saved" "experimenter.log"] [repl? "run interactively in a repl, or execute code in this file"] rest] (println (if repl? "interactive" "batch")) (in-cmd ;; sfbprog -n /dev/ttyUSB0 -S - -t 0 (list sfbprog-cmd "-n" usb-dev "-S" "-" "-t" "0") (not repl?) (if repl? ;; interactive (repl) ;; batch (while-let [line (read-line)] (f/spit out-file (apply str (.toString (new Date)) " " line))))))
possibly related clojure library
This could be useful – from the clojure mailing list
Hi all, some time ago I wrote a simple control library (called "Robust") for Lego Mindstorms NXT. Recently I wrote a Clojure wrapper to the Robust library so that it is possible to write simple control applications for standard Mindstorms' vehicles directly in Clojure. The Robust library together with Clojure interface (cljRobust) can be found at http://sourceforge.net/projects/robust/ enjoy, Konrad Kulakowski
DONE fix collector
- just print directly to another face
so it looks like the collector does prefix reporting strings so that they can make it back to the base, so I guess rather than just writing to the outermost face, we'll have to write to some collector-specific face.
Following the makePacketPrinter example from hallucination-example
sent question to Ackley, not sure how to rework this.
I think the virtual face printer is probably the way to go. If you can tolerate applying your prefix early -- right after the previous packet ships, then its not too hard -- just do the prefix as part of the println of the previous. Something like: u8 outputFace = NORTH; // underlying actual destination face u8 vFace; // virtual face const char * prefix = "Lfoo"; const char * suffix = "etc etc"; void myprint(u8 face, u8 byte) { facePrintf(outputFace,"%c",byte); } void myprintln(u8 face) { facePrintf(outputFace,"%s\n%s",suffix,prefix); } const FacePrinter myPrinter = { myprint, myprintln, 0, 0 }; void setup() { .. bool worked = faceFindFreeFace(vFace); API_ASSERT_TRUE(worked); faceSetPrinter(vFace,&myPrinter); facePrintf(vFace,"%s",prefix); // hack in first prefix .. } should work, for constant prefix/suffix anyway. More complicated approach could have a 'haveSentPrefix' bool that myprint would check and if clear it would send the prefix and set the bool, and myprintln would clear the bool. That would allow deferring prefix generation until the moment it is needed. The virtual face printer also avoids the need to burn RAM for another buffer.
done, pretty much as described above – printing through a virtual face
DONE reading on HP stuff
I can't seem to find a proper paper on this, but HP is working on an interesting and relevant project known as CeNSE (Central Nervous System for the Earth) that I thought would be worth discussing. Here's HP's propaganda on the project: http://www.hpl.hp.com/news/2009/oct-dec/cense.html And another article specifically discussing their proposed bridge sensor networks: http://spectrum.ieee.org/semiconductors/devices/new-sensors-a-step-toward-monitoring-bridges
- "deaf, blind, can’t taste, can’t smell and can’t feel" – Reminds me of Rodney Brooks
-
sensors
- quality through quantity of sensors, if many sensors report an abnormal result you are more likely to believe it
Steps
- deploy sensors
- collect and aggregate data
- process the data
- disseminate the results
the memristor is HP's hardware solution
working on an accelerometer for sensing problems in bridges.
CANCELED find a GP conference
-
State "CANCELED" from "STARTED"
looks like we'll just submit a journal article
here's a good-list of conferences
conference | paper deadline | notes |
---|---|---|
international conference on evolvable systems | ||
simulation of adaptive behavior | ||
simulated evolution and learning | ||
world conference on computational intelligence | final deadline |
too late
conference | deadline |
---|---|
unconventional computation | |
EuroGP |
look for a couple more…
DONE read paper which should have received
diffusion.ps from (here)
DONE email out this paper
experimental results
paper experiments
interleaved sin with static horizon
with
-
goal
g 2x*sy*
-
reset packet
r B:0 y:100 x:700 Y:0 X:14
-
start collecting with
L schulte
first long run save here sin-interleaved.log
explorative experiments
malleable fitness landscape
1030y0961x/72//07/3072023+81*8x943x*x*-1*+*y//
set isosample 40 set xrange [-4:4] set yrange [-2:2] set zrange [-2:2] splot sin(2*x)*y, (8 / ((x * (9 + ((4 - ((3 * x) * x)) * 1))) / y))
malleable.0.0.mean-fit-and-horiz
set yrange [0:200] plot data using 1:2 title 'mean fitness', data using 1:3 title 'horizon'
- holder
12.79 0.98 22.34 0.98 12.22 0.98 24.03 1.73 27.40 1.73 17.28 1.73 17.76 1.73 27.07 1.94 32.84 1.94 27.07 1.94 31.63 1.95 31.28 1.95 31.28 1.95 31.28 1.95 30.84 1.97 27.55 1.97 18.61 1.97 16.99 1.97 11.93 2.64 9.37 2.64 28.38 2.64 8.97 2.64 21.06 2.81 21.24 2.81 20.10 2.81 26.03 2.90 27.18 2.90 26.77 2.90 34.93 2.90 74.32 2.81 27.47 2.81 26.78 2.81 28.82 2.81 35.45 3.05 36.76 3.05 26.08 3.05 30.39 3.05 33.49 2.95 31.93 2.95 33.10 2.95 31.93 2.96 31.72 2.96 38.92 2.96 30.39 2.96 31.47 3.04 27.16 3.04 27.67 3.04 20.43 3.04 21.00 3.42 49.06 3.42 20.35 3.42 20.90 3.42 25.27 3.92 24.27 3.92 23.81 3.92 32.65 4.65 46.72 4.65 32.65 4.65 41.58 4.65 57.64 5.21 57.25 5.21 66.32 5.21 804.41 5.21 66.26 5.69 66.43 5.69 66.90 5.69 137.50 5.69 64.25 6.10 66.62 6.10 62.90 6.10 78.69 6.46 64.87 6.46 76.97 6.46 64.35 6.46 63.86 6.61 63.86 6.61 75.87 6.61 69.19 6.61 76.21 6.45 63.45 6.45 63.45 6.45 63.45 6.45 65.55 6.42 69.02 6.42 63.44 6.42 69.04 6.45 63.49 6.45 63.48 6.45 63.46 6.45 64.25 6.42 63.47 6.42 63.50 6.42 77.58 6.42 63.34 6.44 64.39 6.44 63.34 6.44 64.29 6.44 64.78 6.45 89.71 6.45 63.67 6.45 83.03 6.36 63.50 6.36 65.59 6.36 63.39 6.36 63.44 6.06 63.44 6.06 63.70 6.06 63.90 6.06 64.45 5.84 64.38 5.84 64.37 5.84 64.40 5.58 62.45 5.58 62.05 5.58 61.66 5.58 61.62 5.52 61.31 5.52 62.33 5.52 61.31 5.52 61.32 5.40 64.26 5.40 63.16 5.40 61.32 5.40 67.20 5.18 60.78 5.18 59.45 5.18 58.44 5.11 58.18 5.11 58.18 5.11 58.18 5.11 58.95 4.95 63.74 4.95 58.17 4.95 58.12 4.95 58.79 4.90 56.73 4.90 54.65 4.90 54.33 4.90 65.01 4.99 57.17 4.99 54.92 4.99 55.89 5.02 58.19 5.02 56.33 5.02 56.33 5.02 67.24 5.02 56.68 5.02 56.77 5.02 56.24 5.02 58.40 4.98 55.66 4.98 55.66 4.98 55.66 4.98 62.60 4.95 69.16 4.95 60.97 4.95 55.55 4.89 53.98 4.89 53.98 4.89 53.98 4.89 54.02 4.99 54.02 4.99 59.79 4.99 54.02 4.99 56.28 5.27 55.96 5.27 55.96 5.27 58.84 5.42 80.58 5.42 59.79 5.42 58.79 5.42 59.65 5.29 59.46 5.29 58.90 5.29 58.90 5.29 58.52 5.15 67.00 5.15 57.92 5.15 57.92 5.15 57.42 5.01 56.21 5.01 56.21 5.01 56.56 4.88 54.29 4.88 53.77 4.88 57.35 4.88 54.58 4.67 51.69 4.67 52.00 4.67 51.61 4.67 114.25 4.59 50.17 4.59 49.35 4.59 125.78 4.59 49.26 4.58 49.63 4.58 56.57 4.58 49.28 4.66 49.25 4.66 49.25 4.66 49.25 4.66 51.47 4.72 51.47 4.72 51.85 4.72 53.72 4.72 53.44 4.71 52.96 4.71 52.54 4.71 52.40 4.71 57.94 4.71 52.19 4.71 52.19 4.71 52.19 4.69 52.49 4.69 52.39 4.69 53.09 4.69 52.00 4.76 64.41 4.76 52.00 4.76 52.00 4.76 52.76 4.68 53.76 4.68 52.73 4.68 51.77 4.68 57.48 4.80 52.21 4.80 55.32 4.80 54.84 4.84 54.84 4.84 55.97 4.84 57.09 4.84 55.76 4.92 56.62 4.92 55.76 4.92 55.76 4.92 58.29 4.92 57.19 4.92 57.19 4.92 58.66 4.92 57.24 4.93 69.55 4.93 57.24 4.93 68.42 4.90 56.87 4.90 56.87 4.90 62.44 4.90 56.89 4.93 57.39 4.93 56.89 4.93 57.85 4.93 57.22 4.91 62.76 4.91 57.05 4.91 57.03 4.86 57.13 4.92 72.65 4.92 59.21 4.92 57.34 4.96 57.34 4.96 57.34 4.96 58.29 4.96 53.88 4.52 47.72 4.52 47.20 4.52 47.20 4.52 33.41 3.39 26.20 3.39 26.09 3.39 25.32 4.20 25.55 4.20 25.71 4.20 25.55 4.20 40.38 4.54 42.46 4.54 44.39 4.54 40.38 4.54 48.52 4.53 47.53 4.53 47.53 4.53 50.78 4.53 46.11 4.38 45.31 4.38 44.70 4.38 43.94 4.25 41.43 4.25 41.27 4.25 42.67 4.25 40.66 4.16 39.18 4.16 50.17 4.16 39.18 4.16 41.82 8.59 40.53 8.59 40.73 8.59 97.08 8.59 93.26 10.00 105.52 10.00 93.50 10.00 138.46 9.37 96.20 9.37 105.51 9.37 100.31 9.37 91.62 9.05 86.48 9.05 85.20 9.05 95.14 9.05 85.65 8.56 85.15 8.56 90.21 8.56 93.49 8.16 122.71 8.16 90.41 8.16 102.84 7.58 102.71 7.58 105.78 7.58 102.23 7.58 101.82 7.16 94.03 7.16 87.85 7.16 88.22 7.16 88.19 7.35 88.45 7.35 99.26 7.35 90.89 7.54 89.23 7.63 86.69 7.63 85.98 7.63 85.27 8.44 84.48 8.44 84.85 8.44 106.77 8.44 82.15 9.42 82.34 9.42 93.69 9.42 82.38 9.42 95.38 9.58 95.71 9.58 96.30 9.58 100.84 9.66 101.36 9.66 106.60 9.66 101.01 9.66 102.35 9.61 99.50 9.61 95.94 9.61 94.97 9.61 94.90 8.55 95.83 8.55 92.22 8.55 89.25 8.55 88.04 8.55 86.95 8.55 85.60 8.55 85.31 8.48 84.80 8.48 90.22 8.48 83.86 8.48 83.38 8.56 195.03 8.56 88.49 8.56 84.19 8.56 84.94 8.46 83.19 8.46 82.98 8.46 89.27 8.46 101.84 8.45 79.62 8.45 79.62 8.45 80.52 9.18 82.20 9.18 79.82 9.18 82.37 9.18 87.20 9.18 86.27 9.18 85.21 9.18 84.81 9.18 89.05 9.00 81.51 9.00 82.32 9.00 81.54 8.91 80.05 8.79 78.91 8.79 79.70 8.79 167.86 8.07 82.47 8.07 81.04 8.07 79.44 8.07 100.71 7.39 99.36 7.39 92.03 7.39 89.92 7.39 88.94 7.24 83.71 7.24 77.21 7.24 73.06 7.25 74.56 7.25 82.78 7.25 81.33 7.25 74.45 7.35 73.79 7.35 73.79 7.35 74.45 7.35 80.10 7.19 74.98 7.19 98.41 7.19 74.28 7.19 73.34 7.31 73.53 7.31 73.16 7.31 77.50 7.33 86.25 7.33 78.18 7.33 78.23 7.33 81.47 7.41 78.63 7.41 94.53 7.41 2144.07 7.41 81.26 7.16 74.27 7.16 73.74 7.16 73.48 7.16 71.85 7.13 80.49 7.13 66.69 7.13 69.19 8.21 69.19 8.21 70.29 8.21 80.49 8.21 150.93 6.63 76.84 6.63 73.65 6.63 68.82 6.63 69.33 7.13 66.33 7.13 65.30 7.13 64.54 7.13 65.73 7.70 65.65 7.70 67.02 7.70 117.46 6.73 75.54 6.73 65.92 6.73 74.28 6.73 65.13 7.18 64.45 7.18 65.01 7.18 64.26 7.18 72.59 7.40 68.55 7.40 69.36 7.40 84.69 7.04 71.93 7.04 63.29 7.04 63.30 7.04 64.43 6.73 75.18 6.73 83.95 6.73 62.37 6.73 65.76 6.65 63.20 6.65 58.51 6.65 56.25 6.65 55.89 6.72 54.28 6.72 53.60 6.72 53.59 6.76 53.03 6.76 52.55 6.76 52.50 6.76 51.94 6.61 48.41 6.61 46.15 6.61 45.06 6.61 47.04 8.04 1130.41 8.04 45.99 8.04 127.65 8.04 111.80 7.58 99.53 7.58 91.65 7.58 90.67 7.37 84.81 7.37 77.80 7.37 75.76 7.37 74.86 7.29 73.75 7.29 71.83 7.29 72.13 7.29 73.29 7.35 71.49 7.35 70.06 7.35 70.57 7.35 68.99 7.19 65.53 7.19 62.79 7.19 65.89 7.34 63.77 7.34 63.81 7.34 64.27 7.34 72.24 7.09 65.48 7.09 60.97 7.09 59.53 7.09 60.57 7.17 59.91 7.17 60.74 7.17 62.72 7.17 61.48 7.13 65.67 7.13 61.42 7.13 60.81 7.52 61.52 7.52 60.67 7.52 129.63 7.52 75.95 7.44 73.59 7.44 72.52 7.44 87.96 7.44 70.90 7.21 65.34 7.21 116.36 7.21 67.19 6.96 63.09 6.96 61.80 6.96 60.83 6.96 69.54 7.26 61.35 7.26 142.73 7.26 58.08 7.26 63.26 7.15 59.16 7.15 57.36 7.15 58.75 7.15 63.07 10.00 59.34 10.00 59.90 10.00 183.73 10.00 148.61 10.00 143.15 10.00 137.83 10.00 133.30 9.91 124.59 9.91 109.07 9.91 103.54 9.91 99.72 9.87 99.01 9.87 174.33 9.87 90.82 9.87 88.48 9.78 79.96 9.78 75.09 9.78 70.06 9.07 70.58 9.07 75.40 9.07 71.98 9.07 238.19 5.61 79.65 5.61 74.57 5.61 112.31 5.61 291.00 6.07 63.32 6.07 59.67 6.07 55.66 6.07 56.78 7.09 56.78 7.09 56.57 7.09 106.70 6.83 90.14 6.83 87.55 6.83 80.68 6.83 78.82 7.08 77.92 7.08 72.54 7.08 94.04 7.08 68.97 7.33 68.69 7.33 68.94 7.33 73.71 7.33 74.03 8.47 74.37 8.47 74.37 8.47 110.89 7.80 93.72 7.80 82.63 7.80 79.28 7.80 78.71 7.73 76.15 7.73 76.50 7.73 77.01 7.73 76.98 8.70 76.25 8.70 76.70 8.70 103.40 8.37 90.42 8.10 82.30 8.10 75.12 8.10 84.76 8.20 71.29 8.20 76.03 8.20 80.81 8.20 69.31 7.69 65.77 7.69 63.19 7.69 72.32 7.69 66.17 7.56 64.61 7.56 62.25 7.56 65.61 7.89 70.62 7.89 62.77 7.89 61.46 7.89 67.24 8.10 68.24 8.10 65.83 8.10 66.25 8.10 65.38 8.89 65.49 8.89 65.62 8.89 65.54 8.89 69.29 8.55 63.66 8.55 71.94 8.55 62.08 8.12 56.41 8.12 58.66 8.12 56.28 8.12 65.12 7.92 65.16 7.92 63.90 7.92 64.10 7.92 89.18 6.80 85.11 6.80 79.01 6.80 80.73 6.80 83.22 8.10 77.21 8.10 81.30 8.10 200.59 7.94 106.10 7.94 118.52 7.94 81.74 7.94 78.12 9.32 78.60 9.32 78.14 9.32 76.65 9.32 85.32 9.75 85.12 9.75 82.72 9.75 90.70 9.75 87.59 10.00 79.58 10.00 79.79 10.00 83.68 10.00 83.73 10.00 82.05 10.00 83.31 10.00 83.58 10.00 83.00 10.00 83.68 10.00 83.51 10.00 106.63 9.87 83.82 9.87 79.07 9.87 76.39 10.00 75.10 10.00 88.56 10.00 80.25 10.00 84.13 10.00 84.30 10.00 90.09 10.00 83.91 10.00 83.58 10.00 83.58 10.00 88.78 10.00 85.43 10.00 83.36 10.00 83.51 10.00 195.54 10.00 82.96 10.00 83.72 10.00 82.05 10.00 84.29 10.00 83.94 10.00 83.61 10.00 82.05 10.00 82.05 10.00 83.65 10.00 82.05 10.00 82.05 10.00 82.05 10.00 86.80 10.00 83.52 10.00 83.57 10.00 82.05 10.00 84.02 10.00 84.18 10.00 84.36 10.00 82.58 9.85 81.61 9.85 80.56 9.85 84.89 9.85 78.38 9.75 69.92 9.75 70.21 9.75 80.63 9.75 73.78 10.00 67.42 10.00 67.30 10.00 95.42 10.00 112.31 10.00 90.46 10.00 88.78 10.00 90.07 9.89 81.47 9.89 76.46 9.89 77.17 9.89 72.02 10.00 74.01 10.00 73.54 10.00 85.90 10.00 84.62 10.00 83.08 10.00 90.88 10.00 85.52 9.99 82.56 9.99 86.10 9.99 95.17 9.99 83.49 10.00 95.30 10.00 83.13 10.00 86.85 10.00 80.22 9.87 75.55 9.87 72.26 9.87 72.80 10.00 72.17 10.00 72.54 10.00 71.51 10.00 86.11 9.76 159.73 9.76 109.28 9.76 85.35 9.76 69.05 9.98 75.66 9.98 160.56 9.98 71.03 9.98 79.06 9.72 75.60 9.72 222.91 9.72 72.33 10.00 72.07 10.00 72.84 10.00 72.02 10.00 83.61 10.00 84.64 10.00 83.08 10.00 85.06 10.00 84.18 10.00 85.67 10.00 84.71 10.00 568.85 10.00 79.96 9.85 74.15 9.85 70.56 9.85 71.17 10.00 69.63 10.00 71.83 10.00 71.12 10.00 82.24 9.84 77.36 9.84 71.93 9.84 69.34 9.84 73.19 10.00 71.86 10.00 80.88 10.00 86.79 10.00 81.20 9.67 76.63 9.67 71.17 9.67 70.59 9.71 81.39 9.71 81.99 9.71 78.69 9.71 78.33 9.88 68.27 9.88 66.52 9.88 66.52 9.88 78.00 9.27 75.31 9.27 67.78 9.27 84.79 9.27 59.97 9.45 59.39 9.45 58.48 9.45 52.23 10.00 53.38 10.00 57.27 10.00 54.74 10.00 148.79 10.00 115.87 10.00 107.64 10.00 100.44 10.00 91.95 10.00 86.64 10.00 84.70 10.00 83.08 10.00 231.73 10.00 83.08 10.00 86.24 10.00 84.75 10.00 84.69 10.00 96.74 10.00 83.08 10.00 81.59 9.88 75.41 9.88 81.43 9.88 71.05 9.88 71.50 10.00 76.72 10.00 72.97 10.00 85.13 9.82 78.72 9.82 71.45 9.82 71.10 9.82 73.55 10.00 69.65 10.00 94.45 10.00 72.61 10.00 81.00 9.81 77.35 9.81 74.13 9.81 69.43 9.81 69.71 10.00 72.23 10.00 71.15 10.00 84.26 9.47 79.58 9.47 72.14 9.47 77.44 9.47 65.08 9.65 61.33 9.65 86.35 9.65 59.18 9.65 72.42 10.00 64.07 10.00 68.07 10.00 100.60 10.00 95.04 8.79 90.80 8.79 77.38 8.79 71.98 8.89 61.72 8.89 56.99 8.89 56.70 8.89 56.85 9.26 56.63 9.26 56.85 9.26 54.80 9.26 65.82 9.55 117.32 9.55 65.96 9.55 69.07 9.59 59.64 9.59 56.03 9.59 54.84 9.59 59.47 10.00 56.82 10.00 54.28 10.00 54.20 10.00 101.76 8.59 100.70 8.59 128.54 8.59 86.15 8.59 72.82 5.93 65.29 5.93 63.39 5.93 55.80 6.21 56.41 6.75 56.88 6.75 57.77 6.75 91.05 6.66 73.68 6.66 66.24 6.66 60.38 6.66 60.77 7.33 60.77 7.33 60.75 7.33 60.64 7.33 100.72 7.20 93.75 7.20 146.01 7.20 78.80 7.55 68.43 7.55 73.54 7.55 65.25 7.55 69.20 8.81 69.20 8.81 94.65 8.81 69.13 8.81 89.21 9.14 83.58 9.14 75.86 9.14 70.01 9.14 67.77 9.44 62.37 9.44 53.33 9.44 54.72 10.00 53.15 10.00 53.17 10.00 55.67 10.00 192.74 9.36 74.34 9.36 60.46 9.36 58.04 9.36 51.71 10.00 53.60 10.00 53.84 10.00 104.38 10.00 89.51 9.23 285.73 9.23 295.77 9.23 55.38 10.00 56.38 10.00 58.22 10.00 60.08 10.00 103.93 7.27 101.32 7.27 95.52 7.27 90.81 7.27 87.39 7.12 99.42 7.12 76.44 7.12 106.28 7.12 65.70 6.72 58.54 6.72 52.38 6.72 51.12 7.41 50.59 7.41 51.31 7.41 50.59 7.41 79.13 7.17 74.50 7.17 69.10 7.17 68.30 7.17 73.63 7.85 69.35 7.85 68.86 7.85 96.04 7.48 141.05 7.48 83.92 7.48 200.91 7.48 80.84 7.83 79.52 7.83 79.92 7.83 78.26 7.83 75.84 8.25 67.86 8.25 50.66 8.25 47.20 8.25 48.92 8.85 57.71 8.85 71.82 8.85 75.58 9.55 74.77 9.55 74.79 9.55 72.74 9.55 count = 0 table.map{|vars| count += 1; puts "|#{count} | #{vars[0]} | #{vars[1]} |" }
malleable easy task
overlapping 2D distributed fitness landscape
- y * sin(2*x)
- with |-| config
with axxx x xxx
configuration
91+06*x3+y3/5598y+x8600yyy3/557/0+x56/x/*+x-**
- detailed log saved in overlapping-sin2x-y.log
-
log form the next day in data/overlapping-sin2x-y.the-next-day.log
/3x0+79-3-y11x-6y*6xxx+x+2+-80-9/-+7/*
the next day
position rpn alg (0,0) "+0+91-/2+4y450++2822x9//x65*x+*/1//-x82x*/+/y*" (((8 - (2 / (((2 / (x / 9)) / (x * ((6 * 5) + x))) / 1))) / (x + (8 / (2 * x)))) * y) (1,1) "91+06*x3+y3/5598y+x8600yyy3/557/0+x56/x/*+x-**" ((y / 3) * (5 * ((((5 / 7) + 0) + (x * ((5 / 6) / x))) - x))) (1,0) "9++6*x*+y3/559/0+y8+0*2yy3/557/0+x56/x/*+x-*" ((y / 3) * (5 * ((((5 / 7) + 0) + (x * ((5 / 6) / x))) - x))) (1,-1) "09x860x*2y31870/077*/103+y//557/0+x56/x/*+x-**" ((1 / ((0 + 3) / y)) * (5 * ((((5 / 7) + 0) + (x * ((5 / 6) / x))) - x))) (-1,1) "14/770y028x9/1x65*x-*/1//-x82x*/+//+/2*" ((y / (0 + (2 / ((8 - ((x / 9) / ((1 / (x * ((6 * 5) - x))) / 1))) / (x + (8 / (2 * x))))))) * 2) (-1,0) "44x7x+y028x9/1x65*x-*/1//-x82x*/+//+/2*" ((y / (0 + (2 / ((8 - ((x / 9) / ((1 / (x * ((6 * 5) - x))) / 1))) / (x + (8 / (2 * x))))))) * 2) (-1,-1) "4/x74-y028-y028x9/1x65*x-*/1//-x82x*/+//+/2*" ((y / (0 + (2 / ((8 - ((x / 9) / ((1 / (x * ((6 * 5) - x))) / 1))) / (x + (8 / (2 * x))))))) * 2) set isosample 40 set xrange [-2:2] set yrange [-2:2] set zrange [-2:2] f(x,y) = ((x < -1) ? ((y / (0 + (2 / ((8 - ((x / 9) / ((1 / (x * ((6 * 5) - x))) / 1))) / (x + (8 / (2 * x))))))) * 2) : (x > 1) ? ((y / 3) * (5 * ((((5 / 7) + 0) + (x * ((5 / 6) / x))) - x))) : (((8 - (2 / (((2 / (x / 9)) / (x * ((6 * 5) + x))) / 1))) / (x + (8 / (2 * x)))) * y) ) splot y*sin(2*x), f(x,y)
- with line config
1x*y71x*x60417+x*1y8-yx35/4x-3*2--2*//
set isosample 40 set xrange [-3:4.33] set yrange [-1:1] set zrange [-2:2] f(x,y) = (((x > 3) && (x < 4.33)) ? (y / (x / (((3 / 5) - (((6 - x) * 3) - 8)) * 2))) : {0,1}) g(x,y) = (((x > 2) && (x < 3.33)) ? ((2 - ((9 / 6) / (4 - x))) / (2 / ((((y / ((x - 2) * ((2 / 9) - 1))) - y) / 6) - y))) : {0,1}) h(x,y) = (((x > 1) && (x < 2.33)) ? ((((8 - (5 * x)) - (2 / 8)) * y) / 3) : {0,1}) i(x,y) = (((x > 0) && (x < 1.33)) ? ((((x * 4) + 3) / 7) / ((x / y) / x)) : {0,1}) j(x,y) = (((x > -1) && (x < 0.33)) ? ((((x + 3) - 7) + 4) * y) : {0,1}) k(x,y) = (((x > -2) && (x < -0.67)) ? ((y / 1) / ((x - 7) / ((((3 + x) + x) / 1) * 7))) : {0,1}) l(x,y) = (((x > -3) && (x < -1.67)) ? (y * ((4 + x) / 2)) : {0,1}) splot f(x,y), g(x,y), h(x,y), i(x,y), j(x,y), k(x,y), l(x,y)
some pretty plots
then some time after the run had started… overlapping-sin2x-y-in-line.log
set isosample 40 set xrange [-3:4.33] set yrange [-1:1] set zrange [-2:2] f(x,y) = (((x > 3) && (x < 4.33)) ? (y / (x / (((3 / 5) - (((4 - x) * 3) - 2)) * 2))) : {0,1}) g(x,y) = (((x > 2) && (x < 3.33)) ? ((2 - ((9 / 6) / (4 - x))) / (2 / ((((y / ((x - 2) / ((2 / 8) - 1))) - y) / 4) - y))) : {0,1}) h(x,y) = (((x > 1) && (x < 2.33)) ? ((((8 - (5 * x)) - (2 / 8)) * y) / 3) : {0,1}) i(x,y) = (((x > 0) && (x < 1.33)) ? ((3 + 2) / ((((5 * x) / (5 / ((5 - 1) + (0 + (7 / (x * 5)))))) / y) / x)) : {0,1}) j(x,y) = (((x > -1) && (x < 0.33)) ? ((((8 + (1 + x)) - 7) * x) * y) : {0,1}) k(x,y) = (((x > -2) && (x < -0.67)) ? (7 / ((7 - x) / ((y / 1) * ((x - 3) - (((x + x) + x) / 1))))) : {0,1}) l(x,y) = (((x > -3) && (x < -1.67)) ? (y * ((6 + x) / 5)) : {0,1}) splot f(x,y), g(x,y), h(x,y), i(x,y), j(x,y), k(x,y), l(x,y)
- with line config – no overlap in plots
1x*y71x*x60417+x*1y8-yx35/4x-3*2--2*//
set isosample 40 set xrange [-3:4] set yrange [-1:1] set zrange [-2:2] f(x,y) = ((x > 3) ? (y / (x / (((3 / 5) - (((6 - x) * 3) - 8)) * 2))) : {0,1}) g(x,y) = (((x > 2) && (x < 3)) ? ((2 - ((9 / 6) / (4 - x))) / (2 / ((((y / ((x - 2) * ((2 / 9) - 1))) - y) / 6) - y))) : {0,1}) h(x,y) = (((x > 1) && (x < 2)) ? ((((8 - (5 * x)) - (2 / 8)) * y) / 3) : {0,1}) i(x,y) = (((x > 0) && (x < 1)) ? ((((x * 4) + 3) / 7) / ((x / y) / x)) : {0,1}) j(x,y) = (((x > -1) && (x < 0)) ? ((((x + 3) - 7) + 4) * y) : {0,1}) k(x,y) = (((x > -2) && (x < -1)) ? ((y / 1) / ((x - 7) / ((((3 + x) + x) / 1) * 7))) : {0,1}) l(x,y) = (((x > -3) && (x < -2)) ? (y * ((4 + x) / 2)) : {0,1}) splot f(x,y), g(x,y), h(x,y), i(x,y), j(x,y), k(x,y), l(x,y)
some pretty plots
then some time after the run had started… overlapping-sin2x-y-in-line.log
set isosample 40 set xrange [-3:4] set yrange [-1:1] set zrange [-2:2] f(x,y) = (((x > 3) && (x < 4)) ? (y / (x / (((3 / 5) - (((4 - x) * 3) - 2)) * 2))) : {0,1}) g(x,y) = (((x > 2) && (x < 3)) ? ((2 - ((9 / 6) / (4 - x))) / (2 / ((((y / ((x - 2) / ((2 / 8) - 1))) - y) / 4) - y))) : {0,1}) h(x,y) = (((x > 1) && (x < 2)) ? ((((8 - (5 * x)) - (2 / 8)) * y) / 3) : {0,1}) i(x,y) = (((x > 0) && (x < 1)) ? ((3 + 2) / ((((5 * x) / (5 / ((5 - 1) + (0 + (7 / (x * 5)))))) / y) / x)) : {0,1}) j(x,y) = (((x > -1) && (x < 0)) ? ((((8 + (1 + x)) - 7) * x) * y) : {0,1}) k(x,y) = (((x > -2) && (x < -1)) ? (7 / ((7 - x) / ((y / 1) * ((x - 3) - (((x + x) + x) / 1))))) : {0,1}) l(x,y) = (((x > -3) && (x < -2)) ? (y * ((6 + x) / 5)) : {0,1}) splot f(x,y), g(x,y), h(x,y), i(x,y), j(x,y), k(x,y), l(x,y)
- with |-| config
2d distributed fitness landscape
- with |-| config
with axxx x xxx
configuration
- x+y
pretty quickly got*22+725/2615517yy67/x*+5+9/**/xy-7138*/*y1yx+*
which is a perfect match
- x^2 + y^2
getting the following individual as the best against the goal of x^2 *position rpn alg (0,0) "903+*4/22xx*923y8*9249yy*2xx2/**+" ((y * y) + (2 * (x * (x / 2)))) (1,1) "99/y4060x048*94y2yy*2xx2/**+" ((y * y) + (2 * (x * (x / 2)))) (1,0) "99653x09484*094y24*0x048*94y2yy*2xx2/**+" ((y * y) + (2 * (x * (x / 2)))) (1,-1) "9//y2+x0+1-8**9y0yy*2xx2/**+" ((y * y) + (2 * (x * (x / 2)))) (-1,1) "4/++*x432+7*9+348*91y2yy*2xx2/**+" ((y * y) + (2 * (x * (x / 2)))) (-1,0) "9/++*4-325x*0x348*94y2yy*2xx2/**+" ((y * y) + (2 * (x * (x / 2)))) (-1,-1) "91++*46325x*0x348*94y2yy*2xx2/**+" ((y * y) + (2 * (x * (x / 2)))) set isosample 40 set xrange [-2:2] set yrange [-2:2] set zrange [-8:8] splot (x**2)+(y**2), ((y * y) + (2 * (x * (x / 2))))
- y * sin(2*x)
detailed log saved in 2d-y-sin-2x.loggetting the following individual after ~20 minutes
position rpn alg (0,0) "9920826+2379+2+5*8y5x+x+x+x+/83+*x*" (((y / ((((5 + x) + x) + x) + x)) * (8 + 3)) * x)… (1,1) "yy4x-806357180y653-523x-/++x45+/x*6*5*-5y//" ((((5 - 3) + (5 + (2 / (3 - x)))) - ((((x / (4 + 5)) * x) * 6) * 5)) / (5 / y))… (1,0) "x350x*532523x+/++x55+/x*6*5*-5y//" (((2 + (5 + (2 / (3 + x)))) - ((((x / (5 + 5)) * x) * 6) * 5)) / (5 / y))… (1,-1) "x68–19+357150x*532523x+/++x55+/x*6*5*-5y//" (((2 + (5 + (2 / (3 + x)))) - ((((x / (5 + 5)) * x) * 6) * 5)) / (5 / y))… (-1,1) "yxxy587-2xx3/x58782xx3/6+5///5-/y*" ((8 / ((2 / (x / (((x / 3) + 6) / 5))) - 5)) * y)… (-1,0) "+38*2y5258+7–9-8306-4382x30/6+5///5-/y*" ((8 / ((2 / (x / (((3 / 0) + 6) / 5))) - 5)) * y)… (-1,-1) "-518919427661-3/++x25/282xy3/6+5///5-/y*" ((8 / ((2 / (x / (((y / 3) + 6) / 5))) - 5)) * y)… now after ~80 minutes
position rpn alg (0,0) "588y0+/302y-5*457+117y5x*1+1+3+/48+*x*" (((y / ((((5 * x) + 1) + 1) + 3)) * (4 + 8)) * x) (1,1) "477-*1x/x/665/2/-/7+2+7-3x+/7+657+/x*6*x*-5y//" ((((((((((1 / x) / x) / (6 - ((6 / 5) / 2))) + 7) + 2) - 7) / (3 + x)) + 7) - ((((6 / (5 + 7)) * x) * 6) * x)) / (5 / y)) (1,0) "476-*1x/x/665/2/-/7+2+7-3x+/7+657+/x*6*x*-5y//" ((((((((((1 / x) / x) / (6 - ((6 / 5) / 2))) + 7) + 2) - 7) / (3 + x)) + 7) - ((((6 / (5 + 7)) * x) * 6) * x)) / (5 / y)) (1,-1) "497-*1x/x/665/2/-/7+2+7-3x+/7+657+/x*6*x*-5y//" ((((((((((1 / x) / x) / (6 - ((6 / 5) / 2))) + 7) + 2) - 7) / (3 + x)) + 7) - ((((6 / (5 + 7)) * x) * 6) * x)) / (5 / y)) (-1,1) "18x*/01089/3281-96+x73x*+2x62+0+7///2-/y*" (((7 + (3 * x)) / ((2 / (x / (((6 + 2) + 0) / 7))) - 2)) * y) (-1,0) "19x*/21089/3291x+69x73x*+2x62+0+7///2-/y*" (((7 + (3 * x)) / ((2 / (x / (((6 + 2) + 0) / 7))) - 2)) * y) (-1,-1) "19x*/21089/32995+69x73x*+2x62+0+7///2-/y*" (((7 + (3 * x)) / ((2 / (x / (((6 + 2) + 0) / 7))) - 2)) * y) set isosample 40 set xrange [-2:2] set yrange [-2:2] set zrange [-2:2] splot y*sin(2*x), ((((5 - 3) + (5 + (2 / (3 - x)))) - ((((x / (4 + 5)) * x) * 6) * 5)) / (5 / y))
- x+y
- with line config
after letting it run in a line for an hour or so1-1x98+46y3/307889+//3y87y*0-9+69x2+y+4/xyy*+*
: ((((x + 2) + y) / 4) * (x + (y * y)))
tools
rpn-to-alg
mainly for clojure practice, lets re-write the above
(def binary-operators '(\+ \- \* \/)) (def unary-operators '(\s)) (defn rpn-to-alg [chars stack] (if (> (.size chars) 0) (let [el (first chars)] (if (some #{el} binary-operators) (rpn-to-alg (rest chars) (cons (apply str "(" (or (second stack) 1) " " el " " (or (first stack) 1) ")") (rest (rest stack)))) (if (some #{el} unary-operators) (rpn-to-alg (rest chars) (cons (apply str "(" el " " (or (first stack) 1) ")") (rest (rest stack)))) (rpn-to-alg (rest chars) (cons el stack))))) (first stack))) (println (apply str (rpn-to-alg (seq alg) '())))