A helper function that extracts the value of a variable.

value(x)

# S4 method for ramlAlgObject
value(x)

Arguments

x

The object.

Examples

m <- Model() m$var(x >= 0) m$objective(x)
#> Error in e2 * e1: invalid object (non-function) used as method
m$constraint(x >= 0.1)
#> Error in e2 * e1: invalid object (non-function) used as method
value(x) # NA
#> [1] NA
m$solve()
#> Error in dimnames(x) <- dn: length of 'dimnames' [1] not equal to array extent
value(x) # 0.1
#> [1] NA