def _encode_value_index(self, var_values: Dict[(int, int)]):
    ans = 0
    base = 1
    for var_id in self.var_idx:
        size = self.model.get_variable(var_id).domain.size()
        ans += (base * var_values[var_id])
        base *= size
    return ans
def _encode_value_index(self, var_values: Dict[(int, int)]):
    ans = 0
    base = 1
    for var_id in self.var_idx:
        size = self.model.get_variable(var_id).domain.size()
        ans += (base * var_values[var_id])
        base *= size
    return ans