Originally posted by: 88Simon88
Hello everyone,
I want to write an OPL code to do the piecewise-linear function but I have two parameters. Please, take a look at the following example. I have N different curves and each curve is divided into 30 breakpoints. I appreciate it if could help me in this regard.
int nbp = 30; // Number of Breakpoints
int N = 20;
range cell = 1..N;
float mortality_slope[cell][1..nbp+1] = ...;
dvar int x;
pwlFunction Mortality = piecewise(j in cell,i in 1..nbp)
{mortality_slope[j][i] -> i; mortality_slope[j][nbp+1]}(0,0);
maximize Mortality(1,x);
subject to
{
x == 35;
true;
}
Best regards.
#DecisionOptimization#OPLusingCPLEXOptimizer