Skip to content

Commit

Permalink
update printing
Browse files Browse the repository at this point in the history
  • Loading branch information
tias committed May 23, 2024
1 parent b76557f commit e90f11f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions cpmpy/solvers/ortools.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ def _post_constraint(self, cpm_expr, reifiable=False):
:param reifiable: if True, will throw an error if cpm_expr can not be reified by ortools (for safety)
"""
#print("c ", cpm_expr.name, len(cpm_expr.args), [type(a) for a in cpm_expr.args])

# Operators: base (bool), lhs=numexpr, lhs|rhs=boolexpr (reified ->)
if isinstance(cpm_expr, Operator):
Expand Down
12 changes: 6 additions & 6 deletions xcsp3/executable/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,18 @@ def run(args: Args):

sys.argv = ["-nocompile"] # Stop pyxcsp3 from complaining on exit

# -------------------------- Configure XCSP3 parser -------------------------- #
# ------------------------------ Parse instance ------------------------------ #

start = time.time()
parser = ParserXCSP3(args.benchname)
print_comment(f"took {(time.time() - start):.4f} seconds to parse XCSP3 model")

# -------------------------- Configure XCSP3 parser callbacks -------------------------- #
start = time.time()
callbacks = CallbacksCPMPy()
callbacks.force_exit = True
callbacker = CallbackerXCSP3(parser, callbacks)
print_comment(f"took {(time.time() - start):.4f} seconds to load callbacker")

# ------------------------------ Parse instance ------------------------------ #

start = time.time()
try:
callbacker.load_instance()
except NotImplementedError as e:
Expand All @@ -301,7 +301,7 @@ def run(args: Args):
print_status(ExitStatus.unknown)
print_comment(str(e))
exit(1)
print_comment(f"took {(time.time() - start):.4f} seconds to parse XCSP3 model")
print_comment(f"took {(time.time() - start):.4f} seconds to convert to CPMpy model")

# ------------------------------ Solve instance ------------------------------ #

Expand Down

0 comments on commit e90f11f

Please sign in to comment.