Hi
range flights=1..5;
range Horizon=1..10;
int nbScenarii=5;
range scenarii=1..nbScenarii;
float A[i in flights][t in Horizon][s in scenarii]=rand(10);
float EofA[i in flights][t in Horizon]=1/nbScenarii*sum(s in scenarii) A[i][t][s];
execute
{
writeln(A);
writeln(EofA);
}
dvar int x[flights][Horizon];
subject to
{
forall(i in flights, t in Horizon) x[i][t]==EofA[i][t];
}
can be a starting point
Many examples at https://www.linkedin.com/pulse/making-decision-optimization-simple-alex-fleischer/
------------------------------
[Alex] [Fleischer]
[EMEA CPLEX Optimization Technical Sales]
[IBM]
------------------------------
Original Message:
Sent: Mon March 15, 2021 08:59 AM
From: Siwar Moumni
Subject: Random parameter , expected value
Thank you again Dear Alex ,
But you don't answer me about the expectation of A ( E(A)) how to express it in Cplex ??
------------------------------
Siwar
Original Message:
Sent: Mon March 15, 2021 07:19 AM
From: ALEX FLEISCHER
Subject: Random parameter , expected value
later on you can use A in your constraints
range flights=1..5;range Horizon=1..10;float A[i in flights][t in Horizon]=rand(10);execute{ writeln(A);}dvar int x[flights][Horizon];subject to{ forall(i in flights, t in Horizon) x[i][t]==A[i][t];}
works fine
------------------------------
[Alex] [Fleischer]
[EMEA CPLEX Optimization Technical Sales]
[IBM]
Original Message:
Sent: Mon March 15, 2021 06:58 AM
From: Siwar Moumni
Subject: Random parameter , expected value
Hello Dear Alex ,
Thank you for your response ,
but what about the expectation of A how to express it in CPLEX.
------------------------------
Siwar
Original Message:
Sent: Mon March 15, 2021 06:51 AM
From: ALEX FLEISCHER
Subject: Random parameter , expected value
Hi
range flights=1..5;range Horizon=1..10;float A[i in flights][t in Horizon]=rand(10);execute{ writeln(A);}
works fine
------------------------------
[Alex] [Fleischer]
[EMEA CPLEX Optimization Technical Sales]
[IBM]
Original Message:
Sent: Mon March 15, 2021 06:28 AM
From: Siwar Moumni
Subject: Random parameter , expected value
Hello everyone,
I am a beginner in CPLEX , i have a question how to declare a random parameter , i have A(i,t) is a random parameter : the amount of arrival bags , i declare it like this it is correct !!
float A[i in flights][t in Horizon]=rand(1,10);
and i have the expected amount of the arrival bags :
------------------------------
SiwSiw
------------------------------
#DecisionOptimization