mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-07 01:48:51 -06:00
ConstraintFeatures: Store lhs and sense
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
import logging
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any, Dict, List, Optional
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from miplearn.instance import Instance
|
||||
from miplearn.types import (
|
||||
@@ -162,6 +162,17 @@ class InternalSolver(ABC):
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_constraint_lhs(self, cid: str) -> Dict[str, float]:
|
||||
"""
|
||||
Returns a list of tuples encoding the left-hand side of the constraint.
|
||||
|
||||
The first element of the tuple is the name of the variable and the second
|
||||
element is the coefficient. For example, the left-hand side of "2 x1 + x2 <= 3"
|
||||
is encoded as [{"x1": 2, "x2": 1}].
|
||||
"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def add_constraint(self, cobj: Constraint) -> None:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user