You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
724 B
27 lines
724 B
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
|
|
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
|
|
# Released under the modified BSD license. See COPYING.md for more details.
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
|
class Component(ABC):
|
|
"""
|
|
A Component is an object which adds functionality to a LearningSolver.
|
|
"""
|
|
|
|
@abstractmethod
|
|
def before_solve(self, solver, instance, model):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def after_solve(self, solver, instance, model, results):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def fit(self, training_instances):
|
|
pass
|
|
|
|
def after_iteration(self, solver, instance, model):
|
|
return False
|