TargetMethod-class: Target setting method class

TargetMethod-classR Documentation

Target setting method class

Description

This class is used to represent methods for setting targets. Only experts should use the fields and methods for this class directly.

Public fields

name

character value with name of method.

type

character value denoting the target type.

fun

function for calculating targets.

args

list containing arguments.

frame

defused 'call for generating error messages.

Methods

Public methods


Method new()

Initialize new object.

Usage
TargetMethod$new(name, type, fun, args, frame)
Arguments
name

character value with name of method.

type

character value denoting the target type. Available options include "relative" and "absolute".

fun

function for calculating targets.

args

list containing arguments.

frame

defused 'call for generating error messages.

Returns

A new Method object.


Method print()

Print the object.

Usage
TargetMethod$print(...)
Arguments
...

not used.

Returns

Invisible TRUE.


Method calculate_targets()

Calculate targets expressed in the type of units defined for the method (per ⁠$type⁠).

Usage
TargetMethod$calculate_targets(x, features, call = NULL)
Arguments
x

problem() object.

features

integer feature indices.

call

NULL or calling environment.

Returns

A numeric vector with target values.


Method calculate_targets_km2()

Calculate targets as km2.

Usage
TargetMethod$calculate_targets_km2(x, features, call = NULL)
Arguments
x

problem() object.

features

integer feature indices.

call

NULL or calling environment.

Returns

A numeric vector with target values expressed in km2.


Method calculate_relative_targets()

Calculate targets as km2.

Usage
TargetMethod$calculate_relative_targets(x, features, call = NULL)
Arguments
x

problem() object.

features

integer feature indices.

call

NULL or calling environment.

Returns

A numeric vector with target values expressed as relative units.


Method calculate_absolute_targets()

Calculate targets expressed as absolute units.

Usage
TargetMethod$calculate_absolute_targets(x, features, call = NULL)
Arguments
x

problem() object.

features

integer feature indices.

call

NULL or calling environment.

Returns

A numeric vector with target values expressed as absolute units.


Method clone()

The objects of this class are cloneable with this method.

Usage
TargetMethod$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other classes: ConservationModifier-class, ConservationProblem-class, Constraint-class, Decision-class, Objective-class, OptimizationProblem-class, Penalty-class, Portfolio-class, Solver-class, Target-class, Weight-class


prioritizr documentation built on Nov. 10, 2025, 5:07 p.m.