Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 475 Bytes

model_spec.md

File metadata and controls

26 lines (18 loc) · 475 Bytes

Create a Model Specification

Import the following optimization packages:

import optimus.optimization._
import optimus.optimization.enums.SolverLib
import optimus.optimization.model.MPFloatVar

Extend your object or class using ModelSpec:

object Problem extends ModelSpec(SolverLib.oJSolver) with App {

  val x = MPFloatVar(100, 200)
  val y = MPFloatVar(80, 170)

  maximize(-2 * x + 5 * y)
  add(y >:= -x + 200)

  start()

  release()
}