You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The aries engine integration crashes when a timed effect is added to a problem.
To Reproduce
Run the following:
import unified_planning as up
from unified_planning.shortcuts import *
from unified_planning.model.htn import *
problem = HierarchicalProblem()
done = Fluent('done', BoolType())
problem.add_fluent(done)
problem.set_initial_value(done, False)
problem.add_timed_effect(
Timing(60, Timepoint(TimepointKind.GLOBAL_START)), done, True
)
print(problem.timed_effects)
with OneshotPlanner(name='aries') as planner:
res = planner.solve(problem)
print(res)
The output is the following:
{start + 60: [done := true]}
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/ngigante/projects/telaio/backend/planning/models/issue.py", line 19, in <module>
res = planner.solve(problem)
File "/home/ngigante/projects/telaio/.venv/lib/python3.9/site-packages/unified_planning/engines/mixins/oneshot_planner.py", line 80, in solve
return self._solve(problem, heuristic, timeout, output_stream)
File "/home/ngigante/projects/telaio/.venv/lib/python3.9/site-packages/up_aries/solver.py", line 347, in _solve
server, req = self._prepare_solving(problem, heuristic, timeout, output_stream)
File "/home/ngigante/projects/telaio/.venv/lib/python3.9/site-packages/up_aries/solver.py", line 310, in _prepare_solving
proto_problem = self._writer.convert(problem)
File "/home/ngigante/projects/telaio/.venv/lib/python3.9/site-packages/unified_planning/grpc/converter.py", line 37, in convert
return f(element, *args)
File "/home/ngigante/projects/telaio/.venv/lib/python3.9/site-packages/unified_planning/grpc/proto_writer.py", line 587, in _convert_problem
return proto.Problem(
TypeError: Parameter to MergeFrom() must be instance of same class: expected <class 'unified_planning_pb2.TimedEffect'> got <class 'unified_planning_pb2.Timing'>.
Since MergeFrom is a protobuf function and the aries integration uses protobuf to communicate to the backend, I suspect this is a problem in the conversion of the UP Problem class to the unified_planning.grpc.generated.unified_planning_pb2.Problem class.
Note that the fact that I'm creating a HierarchicalProblem here is irrelevant.
The same happens if I create a simple Problem.
Expected behavior
I would expect to get whatever result the planning problem has, instead of an exception.
Additional context
I'm on Python 3.9 on Debian Linux.
The text was updated successfully, but these errors were encountered:
Describe the bug
The
aries
engine integration crashes when a timed effect is added to a problem.To Reproduce
Run the following:
The output is the following:
Since
MergeFrom
is aprotobuf
function and thearies
integration usesprotobuf
to communicate to the backend, I suspect this is a problem in the conversion of the UPProblem
class to theunified_planning.grpc.generated.unified_planning_pb2.Problem
class.Note that the fact that I'm creating a
HierarchicalProblem
here is irrelevant.The same happens if I create a simple
Problem
.Expected behavior
I would expect to get whatever result the planning problem has, instead of an exception.
Additional context
I'm on Python 3.9 on Debian Linux.
The text was updated successfully, but these errors were encountered: