encodepop {adana} | R Documentation |
Binary encoding of real number matrix
Description
The encodepop function generates a population encoded with binary representation from a real-valued population given as a matrix.
Usage
encodepop(x, lb, ub, eps, ...)
Arguments
x |
A vector containing real numbers |
lb |
A vector containing lower bounds for variables |
ub |
A vector containing upper bounds for variables |
eps |
Sensitivity vector containing desired sensitivity values for each variable |
... |
Further arguments passed to or from other methods. |
Value
binmat |
A binary coded matrix as counterpart of real-valued input matrix |
m |
A vector containing bit length of each variable |
Author(s)
Zeynel Cebeci & Erkut Tekeli
See Also
Examples
lb = c(2.5, -2, 0)
ub = c(4.3, 2, 1.5)
eps = c(0.1, 1, 0.01)
#d = nchar(sub('^+','',sub("\.",'',eps)))-1
d = grep('.', strsplit(as.character(eps), '')[[1]])-1
x = round(runif(5, lb[1],ub[1]),d[1])
y = round(runif(5, lb[2],ub[2]),d[2])
w = round(runif(5, lb[3],ub[3]),d[3])
pop = cbind(x, y, w)
pop
encpop = encodepop(pop, lb, ub, eps)
head(encpop$binmat[,1:10])
m = encpop$m
m
[Package adana version 1.1.0 Index]