Learn R Programming

sybil (version 1.0.2)

changeObjFunc: Sets/changes the Objective Function

Description

The function changeObjFunc changes or sets the objective function for a specified model.

Usage

changeObjFunc(lpmodel, react, obj_coef, checkIds = TRUE)

Arguments

lpmodel
A model. An object of class modelorg, or a problem object of a lp solver.
react
Charater vector containing reaction id's, or a numerical vector containing indices of reaction id's.
obj_coef
A numerical vector with the same length as react containing the objective coefficients. If missing, a vector of the same length as react with all ones (1) is produced.
checkIds
Boolean: check react if ok (default: TRUE)

Value

  • Returns the given model (an object of the same class as the argument lpmodel) containing the new objective function.

encoding

utf8

Details

The argument react will be evaluated by the function checkReactId. The return value is used to change the objective function.

See Also

checkReactId

Examples

Run this code
## sets the objective function to the ATP maintenance reaction:
  data(Ec_core)
  Ec_new <- changeObjFunc(Ec_core, "ATPM")

Run the code above in your browser using DataLab