R/RcppExports.R

Defines functions fitnessCPP predictor_lookup

Documented in fitnessCPP

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

predictor_lookup <- function(x) {
    .Call(`_datafsm_predictor_lookup`, x)
}

#' Fitness Function in C++
#'
#' A generated action vector and state matrix are input and this function
#' returns a numeric vector of the same length as the \code{outcome}.
#' \code{evolve_model} then computes a fitness score for that potential
#' solution FSM by comparing it to the provided \code{outcome}. This is
#' repeated for every FSM in the population and then the probability of
#' selection for the next generation is set to be proportional to the fitness
#' scores. This function is also used in the predict method for the resulting
#' final model that is returned. The function aborts if the user aborts in R,
#' checking every 1000 iterations.
#'
#' @param action_vec Integer Vector.
#' @param state_mat Integer Matrix.
#' @param covariates Integer Matrix.
#' @param period Integer Vector.
#'
#' @export
#' @useDynLib datafsm, .registration = TRUE
#' @importFrom Rcpp sourceCpp
fitnessCPP <- function(action_vec, state_mat, covariates, period) {
    .Call(`_datafsm_fitnessCPP`, action_vec, state_mat, covariates, period)
}
JohnNay/datafsm documentation built on June 9, 2021, 10:32 p.m.