chooseRule: Selects a production rule index at random from a vector of...

View source: R/derivationTrees.R

chooseRuleR Documentation

Selects a production rule index at random from a vector of production rules.

Description

chooseRule() selects a production rule index from the vector of production rule indices in the g$PT$LHS for a non-terminal symbol.

Usage

chooseRule(riv)

Arguments

riv

Vector of production rules indices for a non-terminal symbol.

Value

Integer. Index of the production rule.

See Also

Other Random Choice: chooseNode()

Examples

chooseRule(c(7, 8, 9))
chooseRule(as.vector(1))

xegaDerivationTrees documentation built on April 16, 2025, 5:11 p.m.