R/state.R

Defines functions state state.character state.double state.default

Documented in state

#' Creates a state representation for arbitrary objects
#'
#' Converts object of any class to a reinforcement learning state of type character.
#'
#' @param x An object of any class.
#' @param ... Additional parameters passed to function.
#' @return Character value defining the state representation of the given object.
#'
#' @export
state <- function(x, ...) {
  UseMethod("state", x)
}

#' @export
state.character <- function(x, ...) {
  name <- toString(x)
  return(name)
}

#' @export
state.double <- function(x, ...) {
  name <- toString(x)
  return(name)
}

#' @export
state.default <- function(x, storeObject = FALSE, ...) {
  name <- toString(x)
  return(name)
}
nproellochs/ReinforcementLearning documentation built on March 3, 2020, 12:22 a.m.