sss.nbd: Shotgun Stochastic Search Neighborhood Generator

Description Usage Arguments Value Examples

Description

Create the 3 neighborhoods from a shotgun stochastic search algorithm (see Hans, et al. (2007))

Usage

1
sss.nbd(p0, token)

Arguments

p0

Binary string of 0s and 1s

token

A character which is either '+', '-', or 'o', depending on which neighborhood is to be generated

Value

Returns a list containing all chromosomes making up the given neighborhood requested using token. Let k denote the number of 1s in p0, and k' denote the number of 0s. If token == '+', nbd returns the set of length k' in which each chromosome is sequentially p0 augmented by one of its 0s switched to a 1; if token == '-', nbd returns the set of length k in which each chromsome is sequentially p0 decreased by one of its 1s switched to a 0; if token == 'o', returns the set of length k*k' in which each chromosome is simultaneously p0 decreased by one of its 1s switched to a 0 while each of its 0s is switched to a 1.

Examples

1
2
3
4
5
6
7
8
9
p0 <- '00101'
nbd(p0, '+')
[1] "10101" "01101" "00111"
nbd(p0, '-')
[1] "00001" "00100"
nbd(p0, 'o')
[1] "10001" "01001" "00011" "10100" "01100" "00110"
nbd(p0, 'z')
Error: (token == "+") || (token == "-") || (token == "o") is not TRUE 

tjmassaro/ssga documentation built on May 6, 2019, 7:33 a.m.