Icon representing a recipe

Recipe: Rav3n_pl Total FuzeR v2.0.1

created by Rav3n_pl

Profile


Name
Rav3n_pl Total FuzeR v2.0.1
ID
41095
Shared with
Public
Parent
None
Children
Created on
April 28, 2012 at 15:17 PM UTC
Updated on
April 28, 2012 at 15:17 PM UTC
Description

Uses random Fuse algo to find points. Fixed loading best state at end.

Best for


Code


-- Converted from v1 lua by Rav3n_pl v1 to v2 converter --[[ Total FuzeR v2 a ranadomized fuze it does: shake on random CI wiggle all on random CI Shake and wiggle all on CI=1 min and max CI to randomize set at end of script. ]]-- -- options minSci=0.05 --minimum shake CI maxSci=0.35 --maximim shake CI minWci=0.1 --minimum wiglle CI maxWci=0.7 --maximum wiggle CI loops=250 --how many tries reboot=4 --reset to recent best every x times no improvement maxCI=1 --maximum CI that script can use -- end of options segCnt=structure.GetCount() p=print function CI(c) if c>maxCI then c=maxCI end behavior.SetClashImportance(c) end function Score() local s=0 if normal==true then s=current.GetEnergyScore() else s=current.GetScore() end return s end function round(x)--cut all afer 3-rd place return x-x%0.001 end seed=math.abs(Score()) seed=seed%0.001 seed=1/seed while seed<10000000 do seed=seed*10 end seed=seed-seed%1 math.randomseed(seed) p("Seed is: "..seed) function ShowBest() if #gainTable>2 then p("Best scoring settings:") for i=1,#gainTable do p("Sci: "..gainTable[i][2].." Wci: "..gainTable[i][3].." Gain:"..gainTable[i][1]) end end end gainTable={} function Gained(sci,wci,gain) gainTable[#gainTable+1]={round(gain),round(sci),round(wci)} if #gainTable>1 then for a=1,#gainTable-1 do for b=a+1,#gainTable do if gainTable[a][1]<gainTable[b][1] then gainTable[a],gainTable[b]=gainTable[b],gainTable[a] end end end end if #gainTable>5 then gainTable[#gainTable]=nil end ShowBest() end bestScore=Score() function SaveBest(sci,wci) local g=Score()-bestScore if g>0 then bestScore=Score() p("Gained another "..round(g).." pts. Current score: "..round(bestScore)) save.Quicksave(3) Gained(sci,wci,g) end end function Fuze(sci,wci) CI(sci) structure.ShakeSidechainsSelected(1) CI(wci) structure.WiggleAll(2) CI(1) structure.ShakeSidechainsSelected(1) structure.WiggleAll(2) SaveBest(sci,wci) end function FuzeR() save.Quicksave(3) local ss=Score() p("Starting Total FuzeR. "..loops.." loops. Score="..round(ss)) selection.SelectAll() --recentbest.Save() rebootCount=0 sdiff=maxSci-minSci wdiff=maxWci-minWci for i=1,loops do s=Score() sci=round(math.random()*sdiff)+minSci wci=round(math.random()*wdiff)+minWci p("Fuze "..i.." of "..loops..". Shake CI= "..sci.." Wiggle CI="..wci) Fuze(sci,wci) if Score()-s <0 then rebootCount=rebootCount+1 end if rebootCount>=reboot then save.Quickload(3) --recentbest.Restore() p("Rebooting to best.") rebootCount=0 end end save.Quickload(3) p("FuzeR completed, gain: "..round(Score()-ss)) ShowBest() end --main call FuzeR()

Comments


Rav3n_pl Lv 1

You just need edit script in line

maxCI=1

Change it to

maxCI=0.5

or any CI you are using at the moment.