Deterministic Equivalent Problem of Two-Stage SP

Share:

Description

This function creates an object of class "CDEPD", by which the deterministic equivalent problem is defined.

Usage

1
DEP(MP, q, W, h, Tech, SubDir = NULL, prob = NULL)

Arguments

MP

CLPD: The master (first-stage) problem, ordinarily created by a call to LPD().

q

vector or matrix: The objective(s) in the second-stage (per row for each scenario).

W

matrix: The recourse-matrix.

h

vector or matrix: The absolute values of the rhs-constraints (per row for each scenario).

Tech

matrix or list: The technology matrices combined in a list object, or simply a matrix if fixed for all scenarios.

SubDir

character: The relational operators to be used in the second stage. Allowed are "<=", "==" or ">=".

prob

vector: The probability for each scenario. If left NULL, all scenarios obtain the same probability.

Details

The master and the sub-problems must be specified as LP to be minimized.

Value

An object of S4-class "CDEPD".

Author(s)

Bernhard Pfaff

References

Birge, J. R. and Louveaux, F., Introduction to Stochastic Programming, Springer Series in Operations Research and Financial Engineering, Second Edition, 2004, New York: Springer.

See Also

CDEPD

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
##
## Birge & Louveaux
## Chapter 1, Section 1, The farmer's problem
##
## Formulating as two-stage problem
##
mpobj <- c(150, 230, 260)
names(mpobj) <- c("x1", "x2", "x3")
## Constraints in master problem
mpA <- matrix(c(1, 1, 1),
              nrow = 1, ncol = 3, byrow = TRUE)
colnames(mpA) <- names(mpobj)
rownames(mpA) <- "R1"
## direction in master problem
mpdir <- "<="
## rhs in master problem
mprhs <- c(500)
## Formulating first-stage problem
MP <- LPD(mpobj, mpA, mpdir, mprhs)
## Formulation of second stage problems
## objective is the same for the three scenarios
q <- c(170, -238, 150, -210, 36, 10)
q <- -1.0 * q
names(q) <- c("w1", "y1", "w2", "y2", "w3", "w4")
## recourse matrix
W <- matrix(c(-1, 1, 0, 0, 0, 0,
              0, 0, -1, 1, 0, 0,
              0, 0, 0, 0, 1, 1,
              0, 0, 0, 0, 1, 0),
            nrow = 4, ncol = 6, byrow = TRUE)
colnames(W) <- names(q)
rownames(W) <- paste("SSR", 1:4, sep = "")
## technology matrixes for the three scenarios
## reflecting the bad, average and good crop yields
## Scenario 1
T1 <- matrix(c(3, 0, 0,
               0, 3.6, 0,
               0, 0, -24,
               0, 0, 0),
             nrow = 4, ncol = 3, byrow = TRUE)
colnames(T1) <- names(mpobj)
rownames(T1) <- rownames(W)
## Scenario 2
T2 <- matrix(c(2.5, 0, 0,
               0, 3, 0,
               0, 0, -20,
               0, 0, 0),
             nrow = 4, ncol = 3, byrow = TRUE)
colnames(T2) <- names(mpobj)
rownames(T2) <- rownames(W)
## Scenario 3
T3 <- matrix(c(2, 0, 0,
               0, 2.4, 0,
               0, 0, -16,
               0, 0, 0),
             nrow = 4, ncol = 3, byrow = TRUE)
colnames(T3) <- names(mpobj)
rownames(T3) <- rownames(W)
Tech <- list(T1, T2, T3)
## affine terms on rhs, same in the three scenarios
h <- c(200, 240, 0, 6000)
names(h) <- rownames(W)
ssdir <- c(">=", ">=", "<=", "<=")
## Defining DEP
DEP <- DEP(MP, q, W, h, Tech, SubDir = ssdir)
DEP

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.