When running the diet.py example, the line m.setObjective(buy.prod(cost), GRB.MINIMIZE) is displaying the following error: AttributeError: 'dict' object has no attribute 'prod'. To create the "buy" object, I used the line "for f in foods: buy[f] = m.addVar(name=f)". I noticed that "buy" is a dictionary type and not a tuple dictionary. Does anyone know why?
Please sign in to leave a comment.