mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 01:18:52 -06:00
Add mip_ prefix to dynamic constraints
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user