Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.
Originally posted by: Sandeep.chauhan
Is there any inbuilt opl examples present regarding the piecewise linear function or explain the same concept?
Hi,
see
https://www.ibm.com/support/knowledgecenter/en/SSSA5P_12.7.1/ilog.odms.ide.help/OPL_Studio/opllangref/topics/opl_langref_scheduling_pwstep.html
You have some examples in CPLEX_Studio127\opl\examples\opl\sailco
And a tiny example in the quick reference manual:
int n=2; float objectiveforxequals0=300; float breakpoint[1..n]=[100,200]; float slope[1..n+1]=[1,2,-3]; dvar int x; maximize piecewise(i in 1..n) {slope[i] -> breakpoint[i]; slope[n+1]}(0,objectiveforxequals0) x; subject to { true; }
int n=2; float objectiveforxequals0=300; float breakpoint[1..n]=[100,200]; float slope[1..n+1]=[1,2,-3]; dvar int x;
maximize piecewise(i in 1..n) {slope[i] -> breakpoint[i]; slope[n+1]}(0,objectiveforxequals0) x;
subject to { true; }
regards