Posts tagged with “programming”

test #2

run length:41
0123456789101112131415161718192021222324252627282930313233343536373839
avg0.019271730.023595340.028119770.037081930.042555820.041575180.043942670.044588750.043186430.04282280.040523640.046585830.043472680.045829170.043740650.041004960.048895150.045406720.050065920.045644750.04278790.049295920.048593760.053390970.05071970.048250980.05105250.054134770.052137270.051517640.047491170.049650090.057840120.054049920.052371180.05252840.047839490.053760310.048474970.04896856
max0.079644610.086273020.056244810.054029470.084772160.083754640.075541590.056235430.0565370.051585230.050634920.060581570.050976740.089652580.065699020.082901690.085129750.083311950.059620690.055119650.055204270.055496940.063591670.064545560.058825150.087509840.087585850.089015810.087129240.086047760.087361210.087347160.088583840.089583110.086878140.08944150.087341880.088577640.08733660.07351736

testing...

run length:20
01234567891011121314151617181920
avg2.4117332.7581163.256973.4838853.3429783.4016043.5419053.5825293.6572233.5312413.5543533.7051533.6521753.6664753.8132213.8064893.9016933.7422333.6974153.964206
max5.0114924.0360424.1523244.1338074.1501674.1269544.0978534.1080994.2330714.108654.038894.0408234.0203714.0430884.1254454.0989484.0674544.0363764.1240115.39157
UnityEngine.Debug:Log(Object)
Chart:chart(Array) (at Assets/Scripts/Brain/Chart.js:18)
Chart:exportChart(Array) (at Assets/Scripts/Brain/Chart.js:5)
TrainingController:InputHandler() (at Assets/Scripts/Brain/TrainingController.js:185)
TrainingController:Update() (at Assets/Scripts/Brain/TrainingController.js:74)

I'm a geek: hello, world in lua in ruby

> require "rubygems"
> require "rufus/lua"
> s = Rufus::Lua::State.new
> s.eval("print('Hello LUA')")
Hello LUA
 => nil 

ruby GP performance pt.2

And with ruby 1.9.2p0

sammael:rubyGP greay$ time ruby tinyGP.rb 

real    0m12.546s
user    0m11.819s
sys 0m0.631s

MacRuby definitely seems to be the winner here...


ruby GP

I recently started reading A Field Guide to Genetic Programming ... Barely in to it at all yet, but I've decided to rewrite the sample code (TinyGP) in Ruby. Because I like Ruby better than Java.

It's very short. And the (very rough) ruby implementation w/o much anything special done to it is quite a bit shorter – down from 12KB to 8, and I really didn't take anything out. That's just the extra cruft that Java requires. For all I know the ruby implementation is orders of magnitude slower, though, I don't know. Hell, I've barely tested it so I don't even know it works.

The code's @ github.