Extending algebraic modelling languages for Stochastic Programming

1 downloads 0 Views 639KB Size Report
In (Entriken 2001), two additional syntactical items for modelling languages are presented, namely a random construct for the definition of random parameters, ...
!

"

#$

%

&'

() $* ! && + & + & ) & & &+ '' & & ' & , ' & . + + & ++ & ! & , ' & ,,& & , & & / / ' &(& * ' , + ' % , , ' 0 & & '+ & , ! + ' % + + & & , ' ' & & + ' ! & & & + + & & , ) $ ! & ! & ) '' ,

&

'

' & & '

+ ,! ' % $

!

!

"

# $

" !

"

"

%

'

&

'

(

"

)

*

!

"

)

%

+

"

,

""

'

!

! '

!

'

!!

-

#

'"

/* * %

''

!!

+

0

'-

-

. 1

!

*

!

! #

-

*

% *

+ "

2

"

. )

-

+

-"

0

"' &

"-

1

1

+

& & &+ '' ' ! && + & + & , + ' + & & , & & + , ' + , ' ' (2 ' 3445* ' ,& ! & + ' ("++ 34546$ & 34476" & 34446 + 8993* ! ' + ( 345:6 8998* ' , & & + '' ' + , ' &' ' , + & , # & &+ '' ' + & & & ' , ' + ' + + ' & ! & & & , ' ++

, & + '

; , & &+ '' + ' ! + ! ' , & ' ! ' ,+ &' , ' & % & ' ,' ' % '+ ' , & ' ' & + '' ' '+ ,' & ! & + + '& ' & , ' + % + & + , ' < & ,! ' & +' ,, ' &' ! & , ++ & ! &' ! , & , & + '' ! () $* ! & + + ! , , ' , ,' & % , + ' ' ( & + ' & =& &* , ! & ' & ) $( 344>* ) ( & 3445* )# ( & + , 3444* $( ' ,! 8998* ' ' & '' ) $ , ++ , ' ,$ ' ($ * # ' ( #* ? & ' (? * & $ ' ( $* &+ , ' & ' & , ' & &+ ' , , ,

, ' &' ,

% #

, &

8 ! >!

'' + ' , , & &

'

& & + & , & & ! , &' ' ! + &, + ' + ++ + & & ' # + + ! + & ++ & , , ! & ++ . & ) $ ' ' , '+ , ) $

! &

&

+ + ,

,

!0

&

,' , + ' ' & ' & # & & ' ! & ! , , ' + ' ! ' & &+ '' + '! & , & & & + ' # & @ ! ' - ' , & &+ '' + ' & ++ & &' . , ! & & , ) $ ) $ , ' ' # & : ! & + & & '+ ' , & &+ '' 6 + & ! ,& , &' ' ! & ' . & & & A! ' , ' , & &

2

!

!

# %

! , & & 3444 5:* # & &' , ! & ,& , & &+ 344A* . ' ' , & , + '

.

&

,

' ++ & , ( ) ,1+ ! & ,' ,' ! & ! ! , + ' ' & ' & . '' + ' & ( ' # & "+ & ' ! ' ! 3

&

+

''

+

'0

= min cx

Z

subject to Ax = b

(3*

x≥0 A ∈ R m×n ; c, x ∈ R n ; b ∈ R m

where



$

;

(A

ω

( ,

,

)

&

B &'

ω

$

"+ & + &

ω 0

$

(8* + 3

, + &

,

%

ω∈Ω

+ &!

&

ω %

! , !

,

&

,

&

!

% !

*+

or ξ (ω )

, bω , c ω = ξ ω

.

&

=&

, & , & +

,

,,

,

'

'+ +

!

' '

3 (" * ' & " '

&

& + 3

+ & '

' + &

' !

,

& " + &

' +

+

+ ' ' (3*

'

{

}

F ω = x | Aω x = b ω , x ≥ 0 . &

&

for

(3*

+ &

[ ]

pωξ ω

( A, b, c) = ξ = E ξ ω =

(A

ω

'

# &

,

& '' +

+ && ' $

, ' &

0

)

, b ω , c ω or ξ (ω )

(>* +

'!

0

ω ∈Ω

Z EV = min c x

(@*

subject to Ax = b $ + & '+

+ '

+

ω∈Ω . & !

&

[

]

Z EEV = E c ω x ev* #, ! + '

+ &

' + &

& =&

, , &

0 (:*

C !

,

' % & +

&

0



ω

,

,

'

,

'

0

Z EEV → +∞

(A*

4 .

(. * + &

+

+ ,& '+ ' + & !

' ,

' '+ ' ,

, ' !

D+ ,

&

& 8 6*7' 8++ 9: &

x ji1s = x ji1s′

∀j, i !

s ∈ [1..7],

s′ = s + 1

y ji1s = y ji1s ′

∀j, i !

s ∈ [1..7],

s′ = s + 1

w jk 1s = w jk 1s ′

∀j, i !

s ∈ [1..7],

s′ = s + 1

z jik 1s = z jik 1s′

∀j , i , k !

%

&

'+

'

s ∈ [1..7],

s′ = s + 1

&

&

12

!

' , & &

:

0 & & , < &

#

$

J

,

0

xts = {x jits ∀j, i} yts = {x jits∀j, i} wts = {w jkts∀j , k} zts = {z jikts∀j , i, k} ! &

!

&

0

D11 = ( x , y , w , z ) ts = ( x , y , w , z ) ts′ %

&+ , & !'' ! & + # ! '

' &

< ' !

s′ = s + 1

s ∈ [1..7]

, & ' 6! & & & ! ( * & & + , %0' % & & , 0

' ,

'! , &

,

t >1 s ∈Ξ

Dts = ( x , y , w , z )ts #,!

t =1 !

&+

& !

' ,

, &

,

. %

.

'

%

&-

+ ! # & &

, '

'


3

… param d{Prod,Deal,Time,Scen } …

!

.

!

'

>=0;

+ &

+

,

+

, ' & ,+ . % % & '+ & , ' , ' , 8< ' ' ( ' *! ! & ' + ' + ! & & ' + & , '

3

"

8

" #,

"&

% &

&+ , ' +

) ,&

,

%

,

, )

&

*'++@ !

'

'

' !

0

&

'+ & ' , ! + '

'

& & & , ' & , % ' , ' % & , !0

% & + &

'

& ! *

+

,

& &

, ' +

%&'

,

'+ &

,

' ,

' + '+ '

&

& ';

'

)

' %C)

' ( &

0

'' ' '

>

,

#demand

&

!

'

#demand

scenarioset Sc:=1..NS; … random param d{Prod,Deal,Time,Scen} >=0; …

%

+

> ' + , ' + $ & ' + %*8++?

; & ,

' + 8 380

' ,

! & '+

'

&

,

p(t+1)=p(t)-50% p(t) p(t+1)=p(t)+50%

%

,

'+

&

!

&

3> 23

&

2.5

1

7.5

2

7.5

3

22.5

4

5 10 15

-

%

(+

*'

"# #&

"$ ' #'

+ "% $(' )(' )(' $$('

,

&

!

$

!
%

@0

"# "$ "% "*

".

& '

&

+

)

,

0

+ , ' % '

&

#model file scenarioset scen = 1..4; random param dem{t,scen}; … #data file random param dem:= 1 1 2 1 2 3 3 1 3 2 3 3 3 4

) &

10 5 15 2.5 7.5 7.5 22.5;

, ' +

!

! & %

! ! B3 39 39 39 39

B8 : : 3: 3:

B> 8: 7: 7: 88 :

%

+

&

,

++ ' '+

:0

B3 B8 B> B@

#

%

,

'+

'

'R% S

+

#data file random param dem (tr):= 1 2 3 4

1 10 10 10 10

2 5 5 15 15

3 2.5 7.5 7.5 22.5;

24

, '

,

!0

+

&( & B! & , !

&* & & 0

&

& , ,

+

chance indexingopt constraint_name

! )

,N O J

' &

J

' , &&

& ,,& ,

relop expression;

,

!

'

&&

&

,

$0

satisfy_demand{j in Prod, k in Deal, t in Timem, s in Scen}: sum{i in Fact} z[j,i,k,t,s] >=d[j,k,t,s];

) &

'

T12 % U , '

&

'+ +

'

! &

,

, ' ,& '+ 0

!

scenarioset Sc:=1..NS; random param d{Prod,Deal,Time, Scen} >=0 param beta := 0.9;

#demand

satisfy_demand{j in Prod, k in Deal, t in Time, s in Scen}: sum{i in Fact} z[j,i,k,t,s] >=d[j,k,t,s]; chance{j in Prod, k in Deal, t in Time,s in Scen} satisfy_demand[j,k,t,s]>=beta;

% !

'

/ +

&

&

! ,

&

&

,

% #$P .

94

'-

!

#

*

& ! &' , '

)

$ & '+ , & + &,& ! , , ' & & , '

& *

)

!

$

0 & ! >

+ + ! < )

) ' ' $&

$ &' &

& & (.

# % , '

' )

$

,

&' !0

&

!

+

'

#distribution model clo2s.mod param NT; param NK; param NP; param NF; param NS; set set set set set

Fact:= Prod:= Deal:= Time:= Scen:=

param param param param param param param

1..NF; 1..NP; 1..NK; 1..NT; 1..NS;

q{ Prod, Fact }; c{ Fact,Deal}; v{ Prod, Fact }; a{ Prod, Fact }; l{Prod,Fact}; n{Prod,Fact}; p{Prod,Deal};

param d{Prod,Deal,Time,Scen}; param Pr{Scen}:=1/card(Scen);

#unit prod cost #unit transportation cost #prod capacity #inventory cost #Initial inventory #Inventory capacity #Shortage penalty #demand #Probability of the scenarios

25

&

> &

var var var var

x{Prod,Fact,Time,Scen} y{Prod,Fact,Time, Scen } z{Prod,Fact,Deal,Time, Scen} w{Prod,Deal,Time, Scen }

>=0; >=0; >=0; >=0;

#production #inventory #shipment #shortage

minimize cost: sum(s in Scen} Pr[s]* (sum{j in Prod, i in Fact, t in Time} sum{j in Prod, i in Fact, k in Deal, t in Time} sum{j in Prod, i in Fact, t in Time} sum{j in Prod, k in Deal, t in Time}

q[j,i]*x[j,i,t] + c[i,k]*z[j,i,k,t] + v[j,i]*y[j,i,t] + p[j,k]*w[j,k,t]);

subject to satisfy_demand{j in Prod, k in Deal, t in Time, s in Scen}: sum{i in Fact} z[j,i,k,t,s] + w[j,k,t,s]=d[j,k,t,s]; inv_balance_init{j in Prod, i in Fact, s in Scen }: x[j,i,1]+l[j,i]=y[j,i,1]+sum{k in Deal} z[j,i,k,1,s]; inv_balance{j in Prod, i in Fact, t in 2..NT, s in Scen }: x[j,i,t,s]+l[j,i]=y[j,i,t,s]+sum{k in Deal} z[j,i,k,t,s]; inv_capacity{j in Prod, i in Fact, t in Time, s in Scen }: y[j,i,t,s]=0; >=0; >=0; >=0;

Time,s Time,s Time,s Deal,t

in in in in

Scen} Scen} Scen} Time,s in Scen}

x.stage=t; y.stage=t; w.stage=t; z.stage=t;

0 % &

& 3

&

P3 3

'+



y1

,

!

y3

y2

#

#

''

#

88

>>

%'

'

/' %8

8

/8 %>

> ' '

8 8

! '+ , & '+ + , ' & , & , & Q % ! J2

/> 2

> >

%

)' && &

& ,

, +

%+& % R

K

'! &

++

& +

=&

' , &

9 % %

0

,, & ! & ' & & & '+ , & , & % J 2 (J * ' ,+

&+ ,

' !

+

1 ,, +

, & + & '

'' ' ' & # & & +

, ' &

, + &,&& , ' &

'

2: 0 '

, + + ! & ' ++ + + ( ' & ! ; 8993* & & + ,& - ' , & + &,& , + + ,& '' & ' ' & + ' ) ! ++ & ! & & & '+ & & '+ S% 2= (V $* % ! , , & ,! , + V $ '+ ,& && + & , V $ ' ' & + '' % & V $ & + + , 0 $( $+ 899>* 1+ $ ( = 8993* 1 $($ + ; 8993* ++ < + ' ' 1 $ &+ & &+ '' ' ! & & &< & ' & &+ '' ' )

, '

1+

! + +

''

$ ' & ''

, '

'

1 $ , ' + ' ++ & ,' ' & +

'

30

&& + & ! '' +

! '

& & '' , & &

6 &

-

%

0

%

#

% & , & ' & &+ '' & + & ++ & & % . & + ' ' &+ & , ++ & N ' & + & + + ++ & + &+ ' + + , ++ & N ' %+& & ' + & ++ & ' ' & ,, & ' ,& ! & , & ' , & ' ' ,, ) , & ++ & + & & ' ,, ' , & (K 8998* & # ' ' , + ++ + + ' + ,& ! & & & , + & + + & (! & & + ' ! * ' ' ) & + & + '

T &+ & , &

;

0F

=XW

)

0 %

'

$

& '' ,'(3* '8

. . J

P

+

& =''8 + & &

&

' &

,

, '

! &

&

'

* /) . >J V $ & ' , ,J & (! + *

% $+ $ / %& & !

8 :9/

/

)++

&

(344>* /) J

$ $+

G

&$

' ;

, &

0

''

(3454* /) &

/P

!

'

P & '

(8993* /% &

)

(344A* / + ! ) $ , < !!! '+ & 'Y&'Y& Y! Y '+ Y ". Y % "Y &

'

&/

& ' &

(3445* / )

' !

(34:4* /J

"& $ " ,' ! , ++ & & 1(3* '?=>?

'' & &

. . & (3455* /) ' & '' ,

#

(8993* /$ J & ,'(3* ?W=YY

"++ 1+

) K + ' /

(8998* /1+ ' , '

& )

&

" 1+

, (3444* /)#

# )K

) P ) & & 1+

" & ) '='W+

' %

" / '

++ &

' &

&

&

, ' + ''

+ ,

' & '

& & '

&

K

(8998* 1 & ' & & &

'

'

) K (344@* / Y1 $ 39 & & + J 347:7 (57:8:* 4Y8AY4@ Z

F

= $+ J +

(8993* /F ! & /# 1 $

P

& '' # ' & /%K.

!%&

&

V $

(899>* /) '

,& $ 0 & J

1)

,

&

P +

,

G Z

!1

&+

'

''

!

+

.




P '

$+ ;$ # 1 $&

(8993* /) V $< & , & '

J " '

,!

" ' 0)

+

(8998* /

$ ) P & '+

$

)++

+

K (8993* / (8998* P + '

%

# "* / ''

, 2 '

. .

&1+ ' ; & &

J ) &

K J'

, (A* XXW=XW8

/P

&

,

% #

&+ '' , (8* >?>=>