For now I suggest that we disallow negative weights.
They can cause assertions to trigger in the sum and max evaluator.
Concrete examples:
./fast-downward.py --build debug --keep-sas-file --sas-file sas-from-arguments ~/DOWNWARD_BENCHMARKS/blocks/probBLOCKS-4-1.pddl --search "astar(max([weight(blind(),-1)]),verbosity=debug)"
./fast-downward.py --build debug --keep-sas-file --sas-file sas-from-arguments ~/DOWNWARD_BENCHMARKS/blocks/probBLOCKS-4-1.pddl --search "astar(sum([weight(blind(),-1)]),verbosity=debug)"
./fast-downward.py --build debug --keep-sas-file --sas-file sas-from-arguments ~/DOWNWARD_BENCHMARKS/blocks/probBLOCKS-4-1.pddl --search "eager_wastar([blind()], w=-1 ,verbosity=debug)"
./fast-downward.py --build debug --keep-sas-file --sas-file sas-from-arguments ~/DOWNWARD_BENCHMARKS/blocks/probBLOCKS-4-1.pddl --search "lazy_wastar([blind()], w=-1 ,verbosity=debug)"
I made a tiny PR (+8,-3) where the weight for weighted evaluator, for Eager weighted A* search and for (Weighted) A* search (lazy) is bound to be non-negative.
It is ready to be reviewed: https://github.com/aibasel/downward/pull/294
This avoids the assertions from the 4 examples and produces a nicer Usage error instead. So we get right after reading the input something like:
"""
Traceback:
Constructing parsed object
-> Constructing feature 'astar': astar(max([weight(blind(),-1)]),verbosity=debug)
-> Constructing argument 'eval'
-> Constructing feature 'max': max([weight(blind(),-1)])
-> Constructing argument 'evals'
-> Constructing list
-> Constructing element 0
-> Constructing feature 'weight': weight(blind(),-1)
-> Constructing argument 'weight'
-> Constructing value with bounds
-> Checking bounds
Value is not in bounds.
Usage error occurred.
Peak memory: 46176 KB
search exit code: 33
"""
instead of starting the search and getting something like
"""
downward: /home/dolsim00/downward/src/search/evaluators/max_evaluator.cc:19: virtual int max_evaluator::MaxEvaluator::combine_values(const std::vector<int>&): Assertion `value >= 0' failed.
Peak memory: 46176 KB
caught signal 6 -- exiting
search exit code: -6
Driver aborting after search
INFO Planner time: 0.30s
"""
|