README.md

raml

Travis-CI Build Status Code Coverage License

The raml package provides an elementary algebraic modeling language (AML) in the R ecosystem.

Installation

You can install raml from github with:

# install.packages("devtools")
devtools::install_github("jlepird/raml")

Hello, World Example

This example shows you how to solve the basic linear optimization problem:

max x + 2y
Subject to:
  x + y <= 5
x, y Nonnegative and Real.
library(raml)

m <- Model()

m$var(x >= 0)
m$var(y >= 0)

m$objective(x + 2*y)

m$constraint(x + y <= 5)

m$sense <- "max"

m$solve()
## Output:
## Optimal solution found.
## The objective value is: 10

value(x) # 0
value(y) # 5

dual(m, x + y <= 5) # 2.0, the shadow cost of the constraint x + y <= 5.

More Examples



jlepird/raml documentation built on May 19, 2019, 12:46 p.m.