Originally posted by: fw2610
Hi,
I am working on a model similar to the RCPSP. In the model activities have to be done by workers. A renewable resource (workers) and a non-renewable resource (money, respectively costs) are used. If a worker is deployed, it costs money every period. Both resources are limited due to capacities:
[...]
int capacityOfWorkers = ...;
int capacityOfCosts = ...;
float periodicCostRate = ...;
[...]
tuple activity {
key int numberOfActivity;
[...]
}
{activity } activities = ...;
tuple modeOfActivity {
key int numberOfActivity;
key int numberOfMode;
int durationOfMode;
int workersOfMode;
{modeOfActivity} modesOfActivity = ...;
[...]
dvar interval performOfActivity [i in activities] optional;
dvar interval usageOfMode[m in modesOfActivity] optional size m.durationOfMode;
[...]
cumulFunction usageOfWorkers =
sum (m in modesOfActivity)
pulse (usageOfMode[m], m.workersOfMode);
dexpr float usageOfCosts =
sum (m in modesOfActivity)
presenceOf (usageOfMode[m]) * m.durationOfMode *
m.workersOfMode* periodicCostRate;
[...]
forall (i in activities)
alternative (performOfActivity[i],
all (m in modesOfActivity: m.numberOActivity == i.numberOActivity)
usageOfMode[m]);
usageOfWorkers <= capacityOfWorkers;
usageOfCosts <= capacityOfCosts;
[...]
My question: I want to set up an additional periodic cost rate for a number of deployed workers above a determined level. Please look at the attached file: The capacity of workers is 60. If 50 or less workes are deployed, they cause the normal periodic cost rate. If the remaining 10 workers are deployed (above the red line), they should cause the normal periodic cost rate plus an additional periodic cost rate.
I have no idea how to set up a dexpr float additionalUsageOfCosts. Unfortunately the function cumulFunctionValue can only be used after a solution has been calculated.
Thank you for help and best regards!
#DecisionOptimization#OPLusingCPOptimizer