R6 class representing an action (choice) edge.
Andrew J. Sims andrew.sims@newcastle.ac.uk
rdecision::Edge
-> rdecision::Arrow
-> Action
new()
Create an object of type Action
. Optionally, a cost and a benefit
may
be associated with traversing the edge. A pay-off (benefit minus
cost) is sometimes used in edges of decision trees; the parametrization
used here is more general.
Action$new(source, target, label, cost = 0, benefit = 0)
source
Decision node from which the arrow leaves.
target
Node to which the arrow points.
label
Character string containing the arrow label. This must be defined for an action because the label is used in tabulation of strategies. It is recommended to choose labels that are brief and not punctuated with spaces, dots or underscores.
cost
Cost associated with traversal of this edge.
benefit
Benefit associated with traversal of the edge.
A new Action
object.
modvars()
Find all the model variables of type ModVar
that have been
specified
as values associated with this Action
. Includes operands of these
ModVar
s, if they are expressions.
Action$modvars()
A list of ModVar
s.
p()
Return the current value of the edge probability, i.e. the conditional probability of traversing the edge.
Action$p()
Numeric value equal to 1.
cost()
Return the cost associated with traversing the edge.
Action$cost()
Cost.
benefit()
Return the benefit associated with traversing the edge.
Action$benefit()
Benefit.
clone()
The objects of this class are cloneable with this method.
Action$clone(deep = FALSE)
deep
Whether to make a deep clone.
A specialism of class Arrow
which is used in a decision tree
to represent an edge whose source node is a DecisionNode
.