mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Use instance.features in LazyStatic and Objective
This commit is contained in:
@@ -215,13 +215,14 @@ class StaticLazyConstraintsComponent(Component):
|
||||
if "LazyStatic: All" not in sample:
|
||||
return x, y
|
||||
for cid in sorted(sample["LazyStatic: All"]):
|
||||
category = instance.get_constraint_category(cid)
|
||||
cfeatures = instance.features["Constraints"][cid]
|
||||
category = cfeatures["Category"]
|
||||
if category is None:
|
||||
continue
|
||||
if category not in x:
|
||||
x[category] = []
|
||||
y[category] = []
|
||||
x[category] += [instance.get_constraint_features(cid)]
|
||||
x[category] += [cfeatures["User features"]]
|
||||
if cid in sample["LazyStatic: Enforced"]:
|
||||
y[category] += [[False, True]]
|
||||
else:
|
||||
|
||||
@@ -171,7 +171,7 @@ class ObjectiveValueComponent(Component):
|
||||
y: Dict = {}
|
||||
if "Lower bound" not in sample:
|
||||
return x, y
|
||||
features = instance.get_instance_features()
|
||||
features = instance.features["Instance"]["User features"]
|
||||
if "LP value" in sample and sample["LP value"] is not None:
|
||||
features += [sample["LP value"]]
|
||||
x["Lower bound"] = [features]
|
||||
|
||||
Reference in New Issue
Block a user