Modularize LearningSolver into components; implement branch-priority

This commit is contained in:
2020-01-28 13:35:51 -06:00
parent 897743fce7
commit 6a29411df3
11 changed files with 348 additions and 141 deletions

23
miplearn/component.py Normal file
View File

@@ -0,0 +1,23 @@
# MIPLearn, an extensible framework for Learning-Enhanced Mixed-Integer Optimization
# Copyright (C) 2019-2020 Argonne National Laboratory. All rights reserved.
# Written by Alinson S. Xavier <axavier@anl.gov>
from abc import ABC, abstractmethod
class Component(ABC):
@abstractmethod
def fit(self, solver):
pass
@abstractmethod
def before_solve(self, solver, instance, model):
pass
@abstractmethod
def after_solve(self, solver, instance, model):
pass
@abstractmethod
def merge(self, other):
pass