# NOT RUN {
f<- PlainFunction$new(f0.rosenbrock2)
f$Parameter(name="x1",min=-100,max=100)
f$Parameter(name="x2",min=-100,max=100)
extremize("saa", f)
# }
# NOT RUN {
# }
# NOT RUN {
## A Repast defined function
f<- RepastFunction$new("/usr/models/BactoSim(HaldaneEngine-1.0)","ds::Output",300)
## or a plain function
f1<- function(x1,x2,x3,x4) {
10 * (x1 - 1)^2 + 20 * (x2 - 2)^2 + 30 * (x3 - 3)^2 + 40 * (x4 - 4)^2
}
f<- PlainFunction$new(f1)
f$addFactor(name="cyclePoint",min=0,max=90)
f$addFactor(name="conjugationCost",min=0,max=100)
f$addFactor(name="pilusExpressionCost",min=0,max=100)
f$addFactor(name="gamma0",min=1,max=10)
abm.saa(f, 100, 1, 100, 0.75)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab