Skip to content

Commit

Permalink
Improved log
Browse files Browse the repository at this point in the history
  • Loading branch information
susuhahnml committed Jun 21, 2024
1 parent b1fa3ef commit 9a49f79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions clinguin/server/application/backends/clingo_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ def _domain_state(self):
"""
ds = ""
for f in self._domain_state_constructors:
ds += f"\n%%%%%%%% {f} %%%%%%%\n"
ds += getattr(self, f)
return ds

Expand Down Expand Up @@ -459,7 +460,7 @@ def _ds_brave(self):
It uses a cache that is erased after an operation makes changes in the control.
"""
if not self._ui_uses_predicate("_any", 1):
return ""
return "% NOT USED\n"

return self._call_solver_with_cache("_ds_brave", "_any", 0, "ignore", "brave")

Expand All @@ -471,7 +472,7 @@ def _ds_cautious(self):
It uses a cache that is erased after an operation makes changes in the control.
"""
if not self._ui_uses_predicate("_all", 1):
return ""
return "% NOT USED\n"

return self._call_solver_with_cache(
"_ds_cautious", "_all", 0, "ignore", "cautious"
Expand All @@ -485,7 +486,7 @@ def _ds_brave_optimal(self):
It uses a cache that is erased after an operation makes changes in the control.
"""
if not self._ui_uses_predicate("_any_opt", 1):
return ""
return "% NOT USED\n"

return self._call_solver_with_cache(
"_ds_brave_optimal", "_any_opt", 0, "optN", "brave"
Expand All @@ -499,7 +500,7 @@ def _ds_cautious_optimal(self):
It uses a cache that is erased after an operation makes changes in the control.
"""
if not self._ui_uses_predicate("_all_opt", 1):
return ""
return "% NOT USED\n"

return self._call_solver_with_cache(
"_ds_cautious_optimal", "_all_opt", 0, "optN", "cautious"
Expand Down
3 changes: 2 additions & 1 deletion clinguin/server/application/backends/clingodl_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def _ds_assign(self):
Additional program to pass to the UI computation with assignments
"""
if not self._ui_uses_predicate("_clinguin_assign", 2):
return ""
return "% NOT USED\n"

prg = ""
for key, val in self._assignment:
prg += f"_clinguin_assign({key},{val})."
Expand Down

0 comments on commit 9a49f79

Please sign in to comment.