Add mip_ prefix to dynamic constraints

This commit is contained in:
2021-08-04 13:38:23 -05:00
parent ca925119b3
commit 067f0f847c
7 changed files with 14 additions and 14 deletions

View File

@@ -36,7 +36,7 @@ class DynamicLazyConstraintsComponent(Component):
self.dynamic: DynamicConstraintsComponent = DynamicConstraintsComponent(
classifier=classifier,
threshold=threshold,
attr="lazy_enforced",
attr="mip_constr_lazy_enforced",
)
self.classifiers = self.dynamic.classifiers
self.thresholds = self.dynamic.thresholds
@@ -78,7 +78,7 @@ class DynamicLazyConstraintsComponent(Component):
stats: LearningSolveStats,
sample: Sample,
) -> None:
sample.put_set("lazy_enforced", set(self.lazy_enforced))
sample.put_set("mip_constr_lazy_enforced", set(self.lazy_enforced))
@overrides
def iteration_cb(

View File

@@ -32,7 +32,7 @@ class UserCutsComponent(Component):
self.dynamic = DynamicConstraintsComponent(
classifier=classifier,
threshold=threshold,
attr="user_cuts_enforced",
attr="mip_user_cuts_enforced",
)
self.enforced: Set[str] = set()
self.n_added_in_callback = 0
@@ -87,7 +87,7 @@ class UserCutsComponent(Component):
stats: LearningSolveStats,
sample: Sample,
) -> None:
sample.put_set("user_cuts_enforced", set(self.enforced))
sample.put_set("mip_user_cuts_enforced", set(self.enforced))
stats["UserCuts: Added in callback"] = self.n_added_in_callback
if self.n_added_in_callback > 0:
logger.info(f"{self.n_added_in_callback} user cuts added in callback")

View File

@@ -61,7 +61,7 @@ class StaticLazyConstraintsComponent(Component):
stats: LearningSolveStats,
sample: Sample,
) -> None:
sample.put_set("lazy_enforced", self.enforced_cids)
sample.put_set("mip_constr_lazy_enforced", self.enforced_cids)
stats["LazyStatic: Restored"] = self.n_restored
stats["LazyStatic: Iterations"] = self.n_iterations
@@ -209,7 +209,7 @@ class StaticLazyConstraintsComponent(Component):
constr_names = sample.get_vector("static_constr_names")
constr_categories = sample.get_vector("static_constr_categories")
constr_lazy = sample.get_vector("static_constr_lazy")
lazy_enforced = sample.get_set("lazy_enforced")
lazy_enforced = sample.get_set("mip_constr_lazy_enforced")
if constr_features is None:
constr_features = sample.get_vector_list("static_constr_features")