-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b77e6f
commit 1a6995d
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#' Helper function which constructs a generator, i. e., a function which generates | ||
#' an initial population. | ||
# | ||
#' @param generator [\code{function}]\cr | ||
#' Actual generator function. Should expect the size of the population \code{size} | ||
#' as a first and a ecr control object \code{control} as the second argument. | ||
#' @param name [\code{character(1)}]\cr | ||
#' Name of the generator. | ||
#' @param description [\code{character(1)}]\cr | ||
#' Short description of how the generator works. | ||
#' @param supported [\code{character}]\cr | ||
#' Vector of strings/names of supported parameter representations, i.e., | ||
#' 'permutation', 'float', 'binary' or 'custom'. | ||
#' @return [\code{ecr_generator}] | ||
#' Generator object. | ||
#' @export | ||
makeGenerator = function(generator, name, description, | ||
supported = getAvailableRepresentations()) { | ||
assertFunction(generator, args = c("size", "control"), ordered = TRUE) | ||
generator = makeOperator(generator, name, description, supported) | ||
generator = addClasses(generator, c("ecr_generator")) | ||
return(generator) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
% Generated by roxygen2 (4.1.0): do not edit by hand | ||
% Please edit documentation in R/makeGenerator.R | ||
\name{makeGenerator} | ||
\alias{makeGenerator} | ||
\title{Helper function which constructs a generator, i. e., a function which generates | ||
an initial population.} | ||
\usage{ | ||
makeGenerator(generator, name, description, | ||
supported = getAvailableRepresentations()) | ||
} | ||
\arguments{ | ||
\item{generator}{[\code{function}]\cr | ||
Actual generator function. Should expect the size of the population \code{size} | ||
as a first and a ecr control object \code{control} as the second argument.} | ||
|
||
\item{name}{[\code{character(1)}]\cr | ||
Name of the generator.} | ||
|
||
\item{description}{[\code{character(1)}]\cr | ||
Short description of how the generator works.} | ||
|
||
\item{supported}{[\code{character}]\cr | ||
Vector of strings/names of supported parameter representations, i.e., | ||
'permutation', 'float', 'binary' or 'custom'.} | ||
} | ||
\value{ | ||
[\code{ecr_generator}] | ||
Generator object. | ||
} | ||
\description{ | ||
Helper function which constructs a generator, i. e., a function which generates | ||
an initial population. | ||
} | ||
|