Hi,
if after that line you add
execute
{
writeln(EndNewstock);
}
the warning you got should go away.
Lazy evaluation means values are computed only if needed.
int a;
will also generate a warning if you do not use a later on
------------------------------
[Alex] [Fleischer]
[EMEA CPLEX Optimization Technical Sales]
[IBM]
------------------------------
Original Message:
Sent: Wed March 23, 2022 10:40 AM
From: Jia Zhong
Subject: Ex-Post calculation
Hi all,
I am still new to CPLEX. I have got my model running and got the feasible solutions from the model.
However, when I ex-post calculate the value from the variable (as below), I ran into the warning message of "Element has never been used". I simply want to sum over the solution of the variable (NEWSTOCK) into the parameters (EndNewstock) and cross check the number with the actual data.
This statement is added after the minimize statement and the constraints statement.
As warning message indicated, even though I got the solutions for decision variable NEWSTOCK, EndNewstock is not created nor has any value showed in the "problem browser" tab.
float EndNewstock[ti in t][v in vehicle][s in segment]=sum(a in agev, vmt in vmtgrp) NEWSTOCK[ti][v][a][vmt][s];
I wonder how could I correctly ex-post calculate the values I got from the model. Do I have to use the Script language?
Thanks,
Jia
------------------------------
Jia Zhong, PhD
------------------------------
#DecisionOptimization