bbo-methods: bbo-methods

Description Usage Arguments Details Note Author(s) References See Also Examples

Description

Methods for bbo objects.

Usage

1
2
3
4
## S3 method for class 'bbo'
summary(object, ...)
## S3 method for class 'bbo'
plot(x, plot.type = c("itersAvg", "itersBestValue"), ...) 

Arguments

object

an object of class bbo; usually, a result of a call to bbo.

x

an object of class bbo; usually, a result of a call to bbo.

plot.type

should we plot the best member at each iteration, the best value at each iteration or the intermediate populations?

...

any additional arguments to be passed to plot function

Details

Members of the class bbo have a plot method that accepts the argument plot.type. plot.type = "itersAvg" results in a plot of the parameter values that represent the lowest value of the objective function at each generation. plot.type = "itersBestValue" plots the best value of the objective function each generation.

A summary method also exists and returns the best parameter vector (habitat), the best value of the objective function, average cost of all habitats in the population at each iteration, best habitat at each iteration and the cost of the best habitats.

Note

Further details and examples of the R package bbo can be found look at the package's vignette by typing vignette("bbo").

Please cite the package in publications. Use citation("bbo").

Author(s)

For package bbo: Sarvesh Nikumbh<snikumbh@mpi-inf.mpg.de> Maintainer: Sarvesh Nikumbh<snikumbh@mpi-inf.mpg.de>

For BBO method: Prof. D. Simon, Cleveland State University, Ohio.

References

D. Simon, "Biogeography-Based Optimization", IEEE Transactions on Evolutionary Computation, vol. 12, no. 6, pp. 702-713, December 2008.

See Also

bbo and bbo.control.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
        ## --------------------
        ## Rosenbrock function:
        ## --------------------
        ## It has a global minimum f(x) = 0 at (1,1).  
        ## Kindly note that the first parameter passed to the 
        ## objective function should be the vector of parameters
        ## to be optimized.
        Rosenbrock <- function(x){
          x1 <- x[1]
          x2 <- x[2]
          return(  100 * (x2 - x1 * x1)^2 + (1 - x1)^2 )
        }

        sample.output.of.bbo <- bbo(Rosenbrock, -5, 5, 
					DisplayFlag = FALSE, 
					control = bbo.control(pMutate = 0.4, 
								numVar = 2, 
								popSize = 50, 
								KEEP = 5, 
								maxGen = 20))

	## print the output information
	bbo:::summary.bbo(sample.output.of.bbo)

	## plot
	bbo:::plot.bbo(sample.output.of.bbo, plot.type = "itersBestValue")

Example output

Now loading:
  bbo: R Implementation of Biogeography-Based Optimization
  Author: Sarvesh Nikumbh
Based on:
  D. Simon, "Biogeography-Based Optimization," IEEE Transactions on Evolutionary Computation, vol. 12, no. 6, pp. 702-713, December 2008
 ::summary of BBO run:: 
-----------
Properties:
-----------
numVar:  2 
popSize:  50 
maxGen:  20 
Keep:  5 
pMutate:  0.4 
pModify:  1 
orderDep:  TRUE 

--------------
Best Solution:
--------------
Best habitat:
[1] 0.96599 0.94780
Best value/minimum cost:
[1] 0.02267

------------
Generations:
------------
Average population value for each generation:
 [1] 10244.5478  5631.8814  4665.9603  3914.2312   809.4086  1770.4297
 [7]  2485.6381  2827.9908   446.9989  1757.8825  3963.9131   462.9922
[13]   839.6272  1242.1674  3894.2899  1807.0631  1205.5320  1453.5850
[19]   772.4621  4814.8399
Best habitat for each generation:
          [,1]    [,2]
 [1,] -1.53185 2.49723
 [2,]  0.96599 0.95134
 [3,]  0.96599 0.95134
 [4,]  0.96599 0.95134
 [5,]  0.96599 0.95134
 [6,]  0.96599 0.95134
 [7,]  0.96599 0.95134
 [8,]  0.96599 0.95134
 [9,]  0.96599 0.95134
[10,]  0.96599 0.95134
[11,]  0.96599 0.95134
[12,]  0.96599 0.95134
[13,]  0.96599 0.95134
[14,]  0.96599 0.95134
[15,]  0.96599 0.94780
[16,]  0.96599 0.94780
[17,]  0.96599 0.94780
[18,]  0.96599 0.94780
[19,]  0.96599 0.94780
[20,]  0.96599 0.94780
Best(minimum) function cost for each generation:
 [1] 8.68060 0.03430 0.03430 0.03430 0.03430 0.03430 0.03430 0.03430 0.03430
[10] 0.03430 0.03430 0.03430 0.03430 0.03430 0.02267 0.02267 0.02267 0.02267
[19] 0.02267 0.02267

bbo documentation built on May 1, 2019, 10:53 p.m.