Originally posted by: SystemAdmin
Thank you for your reply! I'm not sure I can submit the model, as it's built dynamically while reading a product rules database and mapping file of questions (spreadsheet). I'm not using OPL, with separate model and data files, but rather calling the IloCP Java interface directly to create simple integer decision variables. I'm simulating the IloClass / IloClassSetField structure of iLog JConfigurator using parent/child relationships and compatibility tables. To account for questions and/or answers that no longer exist, I've settled on using -1 to represent NOT_POSSIBLE.
My biggest challenge was realizing that the JConfigurator member() method (member(IloClass, IloClassSetField)) was generating an existence constraint (LHS) based on an ever-changing IloClassSetField domain. During my program conversion to IloCP, however, I updated this with calls to IloCP.member(IloIntExpr, int[]), but this constraint simply says that the decision variable exists in a "static" integer array - it's not an existence constraint at all. I believe that this was contributing to my initial propagation failure mentioned above.
My solution to this existence problem has been to create the constraint with IloCP.and(IloCP.member(IloIntExpr, int[]), IloCP.neq(IloIntExpr, -1)), which says that as long as the decision variable is NOT -1 (NOT_POSSIBLE) then I exist. If I had written this simply as IloCP.neq(IloIntExpr, -1) then IloCP would immediately reduce the domain of the decision variable, eliminating -1, which is not correct.
The initial propagation now succeeds with 7,119 variables and 134,870 constraints... But it's failing after propagating 4 additional
interactive constraints (these are successful). However, it's now failing when I attempt to propagate an effective date constraint (strange). Job security, I suppose!!
#CPOptimizer#DecisionOptimization