MarkovState {rdecision} | R Documentation |
A state in a Markov model
Description
An R6 class representing a state in a Markov model.
Details
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
.
Value
Updated MarkovState
object.
Annual cost; numeric.
Updated MarkovState
object.
Utility; numeric.
Super class
rdecision::Node
-> MarkovState
Methods
Public methods
Inherited methods
Method new()
Create an object of type MarkovState
.
Usage
MarkovState$new(name, cost = 0, utility = 1)
Arguments
name
The name of the state (character string).
cost
The annual cost of state occupancy (numeric or
ModVar
). Default 0.0.utility
The utility associated with being in the state (numeric or
ModVar
).
Details
Utility must be in the range [-Inf,1]
. If it is of type
numeric, the range is checked on object creation.
Returns
An object of type MarkovState
.
Method name()
Accessor function to retrieve the state name.
Usage
MarkovState$name()
Returns
State name.
Method set_cost()
Set the annual occupancy cost.
Usage
MarkovState$set_cost(cost)
Arguments
cost
The annual cost of state occupancy
Method cost()
Gets the annual cost of state occupancy.
Usage
MarkovState$cost()
Method set_utility()
Set the utility of the state.
Usage
MarkovState$set_utility(utility)
Arguments
utility
The utility associated with being in the state (numeric or
ModVar
).
Method utility()
Gets the utility associated with the state.
Usage
MarkovState$utility()
Method modvars()
Find all the model variables.
Usage
MarkovState$modvars()
Details
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.
Returns
A list of ModVar
s.
Method clone()
The objects of this class are cloneable with this method.
Usage
MarkovState$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Author(s)
Andrew J. Sims andrew.sims@newcastle.ac.uk