Originally posted by: Avadrus
Hello,
I am using CP optimizer to solve a scheduling problem for which I have created an array of interval variables that is contained in a sequence. Various restrictions are being imposed on these variables through the sequence variable and so far, I have managed to implement all of the constraints that were necessary. The intervals I am using have been given a type in the sequence using the "types" statement.
However, I am now struggling to implement the following: I would like to integrate a penalty term in the objective function that works as follows: If two successive intervals (which represent production jobs in a factory) in a sequence require a different material (the material that each job requires is stored in an array), then the objective function should be incremented by a fixed amount X to be determined (I am considering a minimization problem). This means that for each sequence variable, the intervals it contains and their order has to be extracted and a sum has to add the amount X to the objective if two successive intervals require a different material.
Unfortunately, I am not quite sure whether a goal like this may be implemented in CP Optimizer using OPL, if yes, can anybody help me on which functions should be used to obtain the intervals and their order in each sequence and to sum up the penalty described above?
Thank you very much in advance!
Kind regards
#DecisionOptimization#OPLusingCPOptimizer