| Action | R Documentation |
R6 class representing an action (choice) edge.
A specialism of class Arrow which is used in a decision tree
to represent an edge whose source node is a DecisionNode.
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_node, target_node, label, cost = 0, benefit = 0)
source_nodeDecision node from which the arrow leaves.
target_nodeNode to which the arrow points.
labelCharacter 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.
costCost associated with traversal of this edge (numeric or
ModVar), not NA.
benefitBenefit associated with traversal of the edge, (numeric or
ModVar), not NA.
A new Action object.
grob()Creates a grid::grob for an action edge.
Action$grob(xs, ys, xt, yt, fs = 0.2)
xsx coordinate of source of edge, grid::unit object.
ysy coordinate of source of edge, grid::unit object.
xtx coordinate of target of edge, grid::unit object.
yty coordinate of target of edge, grid::unit object.
fsFraction of the edge which slopes.
A grid::grob containing the symbol and label.
modvars()Find all the model variables of type ModVar that have
been specified as values associated with this Action. Includes
operands of these ModVars, if they are expressions.
Action$modvars()
A list of ModVars.
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.
set_cost()Set the cost associated with the action edge.
Action$set_cost(c = 0)
cCost associated with traversing the action edge. Of type numeric
or ModVar, not NA.
Updated Action object.
cost()Return the cost associated with traversing the edge.
Action$cost()
Cost.
set_benefit()Set the benefit associated with the action edge.
Action$set_benefit(b = 0)
bBenefit associated with traversing the action edge. Of type
numeric or ModVar.
Updated Action object.
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)
deepWhether to make a deep clone.
Andrew J. Sims andrew.sims@newcastle.ac.uk
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.