Skip to contents

A quantity of the model (with unit, value) such as a Parameter or an Amount

Super classes

rSharp::NetObject -> DotNetWrapper -> ObjectBase -> Entity -> Quantity

Active bindings

value

The value of the quantity in unit

unit

The base unit in which the quantity value is defined (Read-Only)

displayUnit

The unit in which the quantity value is usually displayed (Read-Only)

dimension

The dimension in which the quantity is defined (Read-Only)

allUnits

the list of all supported units (Read-Only)

quantityType

The type of the quantity (Read-Only)

formula

An instance of a Formula object used by this quantity (Read-Only)

isTable

Returns TRUE if the formula used by this quantity is a table formula otherwise FALSE

isConstant

Returns TRUE if the formula used by this quantity is a constant formula otherwise FALSE

isFormula

Returns TRUE if the formula used by this quantity is an explicit formula (e.g an equation) otherwise FALSE

isDistributed

Returns TRUE if the quantity represents a quantity with an underlying distribution otherwise FALSE

formulaString

Returns the equation of the formula for a quantity using an explicit formula (e.g. isFormula == TRUE) or NULL for a quantity that does not use an explicit formula.

isFixedValue

Returns TRUE if the formula was overridden by a constant value, otherwise FALSE

valueOrigin

The value origin of the quantity (Read-Only)

Methods

Inherited methods


Quantity$new()

Initialize a new instance of the class

Usage

Quantity$new(netObject)

Arguments

netObject

A NetObject object with the pointer to the .NET Quantity

Returns

A new Quantity object.


Quantity$print()

Print the object to the console

Usage

Quantity$print(...)

Arguments

...

Rest arguments.


Quantity$printValue()

Print the name of the quantity and its value

Usage

Quantity$printValue()


Quantity$printQuantityValue()

Print the value (in scientific notation with 2 digits when needed) and unit of the quantity

Usage

Quantity$printQuantityValue(caption)

Arguments

caption

Text to prepend to the value


Quantity$getPrintValue()

Return a string for printing the value (in scientific notation with 2 digits when needed) and unit of the quantity

Usage

Quantity$getPrintValue()

Returns

A string for printing the quantity in one line


Quantity$setValue()

Convert value from unit to the base unit and sets the value in base unit.

Usage

Quantity$setValue(value, unit = NULL)

Arguments

value

Value to set. If unit is null, we assume that the value is in base unit

unit

Optional unit in which the value is given.


Quantity$hasUnit()

Returns TRUE if the quantity supports the given unit otherwise FALSE. For the list of supported units, use allUnits

Usage

Quantity$hasUnit(unit)

Arguments

unit

Unit to check


Quantity$reset()

Ensures that the quantity uses the value computed by its formula. It is a shortcut for self$isFixedValue <- false.

Usage

Quantity$reset()