pub struct Report { /* private fields */ }Expand description
What Validator::validate found.
Implementations§
Source§impl Report
impl Report
Sourcepub const fn metric(&self) -> Option<&Metric>
pub const fn metric(&self) -> Option<&Metric>
Returns the value of the problem’s :metric in the final state, for a valid plan
of a problem that has one.
None if the plan is not valid, if the problem has no metric, or if its value is
undefined in the final state (it reads a fluent without a value, divides by zero
or leaves the finite range); an undefined metric does not make the plan invalid.
§Examples
use pddl::{Domain, Optimization, Parser, Problem};
use pddl_validate::Validator;
let domain = Domain::from_str("(define (domain d) (:requirements :action-costs)
(:predicates (done)) (:functions (total-cost) - number)
(:action work :parameters () :effect (and (done) (increase (total-cost) 2.5))))").unwrap();
let problem = Problem::from_str("(define (problem p) (:domain d)
(:init (= (total-cost) 0)) (:goal (done)) (:metric minimize (total-cost)))").unwrap();
let report = Validator::new(&domain, &problem).unwrap().validate_text("(work) (work)");
let metric = report.metric().unwrap();
assert_eq!((metric.optimization, metric.value), (Optimization::Minimize, 5.0));Sourcepub const fn status(&self) -> ValidationStatus
pub const fn status(&self) -> ValidationStatus
Returns the verdict.
Sourcepub const fn violation(&self) -> Option<&Violation>
pub const fn violation(&self) -> Option<&Violation>
Returns why the plan is invalid, or None if it is not.
Sourcepub const fn unsupported(&self) -> Option<&Unsupported>
pub const fn unsupported(&self) -> Option<&Unsupported>
Returns the construct the validator cannot interpret, or None if there is none.
Trait Implementations§
impl StructuralPartialEq for Report
Auto Trait Implementations§
impl Forget for Report
impl Freeze for Report
impl Move for Report
impl RefUnwindSafe for Report
impl Send for Report
impl Sync for Report
impl Unpin for Report
impl UnsafeUnpin for Report
impl UnwindSafe for Report
Blanket Implementations§
Source§impl<V, T, O> AcceptMut<V, T, O> for Twhere
V: VisitorMut<T, O>,
impl<V, T, O> AcceptMut<V, T, O> for Twhere
V: VisitorMut<T, O>,
Source§fn accept_mut(&self, v: &mut V) -> O
fn accept_mut(&self, v: &mut V) -> O
Lets the mutable visitor
v visit self.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more