Use instance.features in LazyStatic and Objective

This commit is contained in:
2021-03-31 09:21:34 -05:00
parent 5db4addfa5
commit 8fc9979b37
4 changed files with 38 additions and 29 deletions

View File

@@ -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:

View File

@@ -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]