An R6 class representing a state in a Markov model.
Updated MarkovState
object
Andrew J. Sims andrew.sims@newcastle.ac.uk
rdecision::Node
-> MarkovState
Inherited methods
new()
Create an object of type MarkovState
.
MarkovState$new(name, cost = 0, utility = 1)
name
The name of the state (character string).
cost
The annual cost of state occupancy (numeric or
ModVar
). Default 0.
utility
The utility associated with being in the state (numeric
or ModVar
).
Utility must be in the range [-Inf,1]
. If it is of type
numeric, the range is checked on object creation.
An object of type MarkovState
.
name()
Accessor function to retrieve the state name.
MarkovState$name()
State name.
set_cost()
Set the annual occupancy cost
MarkovState$set_cost(cost)
cost
The annual cost of state occupancy
cost()
Gets the annual cost of state occupancy.
MarkovState$cost()
Annual cost; numeric.
utility()
Gets the utility associated with the state.
MarkovState$utility()
Utility; numeric.
modvars()
Find all the model variables.
MarkovState$modvars()
Find variables of type ModVar
that have been
specified as values associated with this MarkovState
.
Includes operands of these ModVar
s, if they are expressions.
A list of ModVar
s.
clone()
The objects of this class are cloneable with this method.
MarkovState$clone(deep = FALSE)
deep
Whether to make a deep clone.
Represents a single state in a Markov model. A Markov model is
a digraph in which states are nodes and transitions are arrows. Inherits
from class Node
.