Description Usage Arguments Value Author(s) Examples
Given a linear production programming problem A %*% x <= b
, the
productLinearProblem
solves the problem by making use of
lpSolveAPI
.
1 | productLinearProblem(c, A, b, plot = FALSE, show.data = FALSE)
|
c |
vector of benefits. |
A |
production matrix. |
b |
vector of resources. |
plot |
logical value indicating if the function displays graphical
solution ( |
show.data |
logical value indicating if the function displays the
console output ( |
productLinearProblem
returns and prints a list with the
following components:
ObjetiveValue
Value of the objetive function from a successfully solved
linear production programming problem.
OptimalSolution
Values of the variables from a successfully solved linear
production programming problem.
D. Prieto
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Vector of benefits
c <- c(68,52)
# Production matrix
A <- matrix(c(4,5,6,2),ncol=2, byrow = TRUE)
# Matrix of resources. Each row is the vector of resources of each player
b <- c(4,33)
# Solution of the associated linear production game
productLinearProblem(c,A,b, show.data = TRUE)
# ------------------------------------------------------------------------
# Objetive value:
# ------------------------------------------------------------------------
# [1] "Z = 68"
#
# ------------------------------------------------------------------------
# Optimal solution:
# ------------------------------------------------------------------------
# [1] 1 0
# ------------------------------------------------------------------------
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.