! Evacuation model. In an emergency, we want to
  evacuate people as "fast as possible" from
  interior "at risk" nodes to the safety of the
  outside world. The "at risk" nodes could be the
  interior of a building or a geographic area
  threatened by a possible disaster.
 Keywords: Evacuation, Emergency, Network, Routing, Multi-period, Dynamic network;
SETS:
  NODE: V0, NCAP;
  NXN(NODE, NODE): ACAP, LT;
  TIME: OUT;
  NXT( NODE, TIME): V;
  NXNXT( NXN, TIME): X;
ENDSETS
! Definition of variables: X(i,j,t) = flow from i at beginning of period t(end of period t-1), arriving at node j at end of period t + LT(i,j), V(i,t) = number people remaining at node i at during period t, OUT(t) = number of people who make it out at end of period t; ! Data: V0(i) = number of people initially at node i, NCAP(i) = maximum people that can ever be waiting( in inventory) at node i, ACAP(i,j)= upper limit on X(i,j,t), LT(i,j) = lead time from node i to j = time to get from i to j. Must be an integer; ! Assume that the last node, NLAST, is the safety of the outside world; DATA: TIME = 1..10; ! We think we can do it in 10 periods; NODE = A B C D E F; NCAP = 99 99 14 10 14 999999; V0 = 50 47 11 0 0 0; NXN = A,C B,C B,E C,D C,E D,F E,F; ACAP= 10 14 16 12 17 30 30; LT = 1 1 2 1 3 0 0; ENDDATA NLAST = @SIZE(NODE); TLAST = @SIZE(TIME); ! Objective, Maximize number of people getting out early; [OBJ] MAX = @SUM( TIME(t): (TLAST+1-t)*OUT(t)); ! Count number that get out in period t; @FOR( TIME(t): [OUTT] OUT(t) = @SUM( NXNXT(i,j,t)| j #EQ# NLAST: X(i,j,t)); ); ! Conservation of flow at each node; ! For first period; @FOR(NODE(k): [BAL1] V(k,1) = V0(k) - @SUM( NXN(k,j): X(k,j,1)); ); ! For every node k and time period t; @FOR( NXT( k,t)| t #GT# 1: [BAL] V(k,t) = V(k,t-1) - @SUM(NXN(k,j): X(k,j,t)) + @SUM(NXN(i,k)| t-LT(i,k) #GT# 0: X(i,k,t-LT(i,k))); ); ! Arc capacities; @FOR( NXNXT(i,j,t): [UFLO] X(i,j,t) <= ACAP(i,j); ); ! Node storage capacities; @FOR( NXT(i,t): [USTOR] V(i,t) <= NCAP(i); );