def __init__(self, model: Model, constr: Dict[int, int]): self.model = model self.pure_model = model.clone() self.left = None self.right = None self.val = float('inf') self.sol = None self.constr = constr
def __init__(self, model: Model, mu, sigma, graph, bb_params): self.model = model self.pure_model = model.clone() self.m, self.n = model.getVariable( 'I').getShape()[0], model.getVariable('Xi').getShape()[0] self.mu, self.sigma = mu, sigma self.graph = graph self.roads = [(i, j) for i in range(self.m) for j in range(self.n) if graph[i][j] == 1] self.bb_params = bb_params self.node_explored = 0 self.best_model = None self.obj_ub = None