Hi, I want you to ask about something.
5 attractions in theme parks
25 visitors in theme parks
time table: 1, 2 (just 1 hours)
I assume that x[i][t] is 'Number of visitors at time interval t on attraction I',
and y[i][j][t] is 'Flow from attraction i to cell j at time interval t'.
if x[1][1] = 7, x[2][1] = 8, x[3][1] = 2, x[4][1] = 3, x[5][1] = 5,
I want to distribute each visitors in attractions, so that
x[1][2] = 5, x[2][2] = 5, x[3][5] = 5, x[4][5] = 5, x[5][5] = 5, and finally I want to know the value of y[i][j][t].
How can I solve this problem in CPLEX? Help me please...
.mod is...
//Data
range I = 1..5; // attractions
range t = 1..2; //timetable .
//Parameters
int x[I][t] = ...; //Number of visitors at time interval t on attraction I
int m = 5; //Average
//Variables
dvar float y[i in I][j in I]; // Flow from cell i to cell j at time interval 1
dexpr float Variance = sum(i in I) (x[i][2 in t] - m)^2;
//Objective function.
minimize Variance/m;
//Constraints
subject to{
one: //Conservation of flow
forall(i in I)
x[i][2 in t] - x[i][1 in t] - sum(k in I : k != i) y[k][i] + sum(j in I : j != i) y[i][j] == 0;
two:
forall(i in I, j in I : j != i)
x[i][1 in t] + y[i][j] - x[i][2 in t] == 0;
};
------------------------------
Yonghwan Kim
------------------------------
#DecisionOptimization