I have already seen in the Python-MIP documentation on how to implement a variable with multiple indices. In each example I read, this is done with the use of lists and integers as indices.
This is how I implement a variable that I needed in the beginning:
x = [[[model.add_var(name='x({},{},{})'.format(e,s,a),var_type=INTEGER,ub = employeeDict[e].mitarbeiter_ist_formen)
for e in employeeDict] for s in demandBelongingToShiftDict] for a in demandAppendedWithShiftDict]
But got the following error:
TypeError: list indices must be integers or slices, not str
Since the index a is a string.
Now I know that in Python is impossible to search within a list with strings as indices. This is why I would like to use dictionaries:
x = {{{model.add_var(name='x({},{},{})'.format(e,s,a),var_type=INTEGER,ub = employeeDict[e].mitarbeiter_ist_formen)
for e in employeeDict} for s in demandBelongingToShiftDict} for a in demandAppendedWithShiftDict}
Unfortunately, I am getting the following error:
TypeError: unhashable type: 'set'