mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 01:18:52 -06:00
Convert InstanceFeatures into dataclass
This commit is contained in:
@@ -64,7 +64,7 @@ class StaticLazyConstraintsComponent(Component):
|
||||
assert features.instance is not None
|
||||
assert features.constraints is not None
|
||||
|
||||
if not features.instance["Lazy constraint count"] == 0:
|
||||
if not features.instance.lazy_constraint_count == 0:
|
||||
logger.info("Instance does not have static lazy constraints. Skipping.")
|
||||
logger.info("Predicting required lazy constraints...")
|
||||
self.enforced_cids = set(self.sample_predict(features, training_data))
|
||||
|
||||
@@ -80,7 +80,7 @@ class ObjectiveValueComponent(Component):
|
||||
assert features.instance is not None
|
||||
x: Dict[Hashable, List[List[float]]] = {}
|
||||
y: Dict[Hashable, List[List[float]]] = {}
|
||||
f = list(features.instance["User features"])
|
||||
f = list(features.instance.user_features)
|
||||
if "LP value" in sample and sample["LP value"] is not None:
|
||||
f += [sample["LP value"]]
|
||||
for c in ["Upper bound", "Lower bound"]:
|
||||
|
||||
Reference in New Issue
Block a user