productLinearProblem: Linear production programming problems

Description Usage Arguments Value Author(s) Examples

Description

Given a linear production programming problem A %*% x <= b, the productLinearProblem solves the problem by making use of lpSolveAPI.

Usage

1
productLinearProblem(c, A, b, plot = FALSE, show.data = FALSE)

Arguments

c

vector of benefits.

A

production matrix.

b

vector of resources.

plot

logical value indicating if the function displays graphical solution (TRUE) or not (FALSE). Note that this option only makes sense when we have a two-dimension problem.

show.data

logical value indicating if the function displays the console output (TRUE) or not (FALSE). By default the value is TRUE.

Value

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.

Author(s)

D. Prieto

Examples

 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
# ------------------------------------------------------------------------
  

coopProductGame documentation built on May 1, 2019, 10:32 p.m.