Trying to create a Product Configurator using Google OR tools. I got a few examples working, but cant figure out how to create string domains and access their values.
var colorValues = new string[] { "Red", "Green", "Blue" };
var sizeValues = new string[] { "Small", "Medium", "Large" };
IntVar color = model.NewIntVar(0, colorValues.Length - 1, "color");
IntVar size = model.NewIntVar(0, sizeValues.Length - 1, "size");
I need to create a constraint like,
- If Color is Red then Size is Small
- If Color is Blue then Size is not Large
How can I do this using
model.add(....)
Or some other method using Google OR Tools.