Originally posted by: carope
Hello,
i do have a problem to define dexpr for my OPL Model. I have a dynamic model with demand functions different for each period and quality. I defined a range "time"{1..2} and a set "quality" {good, bad}.
The usual way to declare a dexpr named demand is:
dexpr float demand [q in quality][t in time] = a[t]+b[t]+c[t];
So the demand for all q/t combinations is the same "a[t]+b[t]+c[t]".
Unfortunately, I have different demand functions for each quality/time combination (or matrix-field). This means if q in quality is "good" and time is "1" (e.g. a[t]+b[t]+c[t]) it is a different function than for quality"bad" and time"1" (d[t]+e[t]+f[t]) and so on. I need this dexpr for further use in a similar way.
So my question is, is there any way to declare dexpr like
dexpr float demand [q in quality: q!="bad"][t in time:t==1] = a[t]+b[t]+c[t];
or
dexpr float demand ["good"][1] = a[t]+b[t]+c[t]; ???
OPL says it is not possible to use filter in generic arrays. Any ideas how to work around that without defining dexpr like demand_good_1 and so on?
Thanks for ideas in advance!
#DecisionOptimization#OPLusingCPLEXOptimizer