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)
}

Try the ReinforcementLearning package in your browser

Any scripts or data that you put into this service are public.

ReinforcementLearning documentation built on March 26, 2020, 7:38 p.m.