Learn R Programming

rgp (version 0.4-1)

integerToLogicals: Tools for manipulating boolean functions

Description

integerToBoolean converts a scalar positive integer (or zero) to its binary representation as list of logicals. booleanFunctionVector returns the boolean vector of result values of f, given a boolean function f. numberOfDifferentBits given two lists of booleans of equal length, returns the number of differing bits. makeBooleanFitnessFunction given a boolean target function, returns a fitness function that returns the number of different places in the output of a given boolean function and the target function.

Usage

integerToLogicals(i, width = floor(log(base = 2, i) + 1))
booleanFunctionAsList(f)
numberOfDifferentBits(a, b)
makeBooleanFitnessFunction(targetFunction)

Arguments

i
A scalar positive integer.
width
The with of the logical vector to return.
f
A boolean function.
a
A list of booleans.
b
A list of booleans.
targetFunction
A boolean function.

Value

The function result as described above.