number_of_actions: Number of actions

number_of_actionsR Documentation

Number of actions

Description

Extract the number of actions in an object.

Usage

number_of_actions(x)

## S4 method for signature 'ProjectProblem'
number_of_actions(x)

## S4 method for signature 'OptimizationProblem'
number_of_actions(x)

Arguments

x

ProjectProblem or OptimizationProblem object.

Value

integer number of actions.

Examples

# load data
data(sim_projects, sim_features, sim_actions)

# build problem with default solver
p <- problem(sim_projects, sim_actions, sim_features,
             "name", "success", "name", "cost", "name") %>%
     add_max_richness_objective(budget = 200) %>%
     add_binary_decisions() %>%
     add_default_solver()

# print problem
print(p)

# print number of actions
number_of_actions(p)

prioritizr/ppr documentation built on Sept. 10, 2022, 1:18 p.m.