pub enum MetricFluentExpression {
BinaryOp(BinaryOp, Box<Self>, Box<Self>),
MultiOp(MultiOp, Box<Self>, Vec<Self>),
Negative(Box<Self>),
Number(Number),
Function(FunctionSymbol, Vec<Name>),
TotalTime,
IsViolated(PreferenceName),
}Expand description
Variants§
BinaryOp(BinaryOp, Box<Self>, Box<Self>)
A binary operation, (<binary-op> <metric-f-exp> <metric-f-exp>).
MultiOp(MultiOp, Box<Self>, Vec<Self>)
An operation over two or more operands, (<multi-op> <metric-f-exp> <metric-f-exp>+),
with at least two in the Vec; see multi_op for fewer.
Negative(Box<Self>)
A negation, (- <metric-f-exp>).
Number(Number)
A numeric literal.
Function(FunctionSymbol, Vec<Name>)
A ground function, (<function-symbol> <name>*) or <function-symbol>.
TotalTime
The total time of the plan, total-time.
IsViolated(PreferenceName)
§Requirements
Requires Preferences.
Implementations§
Source§impl MetricFluentExpression
impl MetricFluentExpression
Sourcepub fn binary_op(op: BinaryOp, lhs: Self, rhs: Self) -> Self
pub fn binary_op(op: BinaryOp, lhs: Self, rhs: Self) -> Self
Creates a binary operation, (<binary-op> <metric-f-exp> <metric-f-exp>).
Sourcepub fn new_binary_op(op: BinaryOp, lhs: Self, rhs: Self) -> Self
pub fn new_binary_op(op: BinaryOp, lhs: Self, rhs: Self) -> Self
Creates a binary operation, (<binary-op> <metric-f-exp> <metric-f-exp>).
Sourcepub fn multi_op<I: IntoIterator<Item = Self>>(
op: MultiOp,
lhs: Self,
rhs: I,
) -> Self
pub fn multi_op<I: IntoIterator<Item = Self>>( op: MultiOp, lhs: Self, rhs: I, ) -> Self
Creates an operation over two or more operands, (<multi-op> <metric-f-exp> <metric-f-exp>+).
(<multi-op> a b) is a binary operation and (<multi-op> a) isn’t PDDL, so
with one operand in rhs this returns the equal BinaryOp, and with none
it returns lhs. The result then prints and parses back to an equal value.
Sourcepub fn new_multi_op<I: IntoIterator<Item = Self>>(
op: MultiOp,
lhs: Self,
rhs: I,
) -> Self
pub fn new_multi_op<I: IntoIterator<Item = Self>>( op: MultiOp, lhs: Self, rhs: I, ) -> Self
Creates an operation over two or more operands, (<multi-op> <metric-f-exp> <metric-f-exp>+).
Sourcepub fn new_negative(exp: Self) -> Self
pub fn new_negative(exp: Self) -> Self
Creates a negation, (- <metric-f-exp>).
Sourcepub fn new_number<N: Into<Number>>(number: N) -> Self
pub fn new_number<N: Into<Number>>(number: N) -> Self
Creates a numeric literal.
Sourcepub fn function<I: IntoIterator<Item = Name>>(
symbol: FunctionSymbol,
names: I,
) -> Self
pub fn function<I: IntoIterator<Item = Name>>( symbol: FunctionSymbol, names: I, ) -> Self
Creates a ground function, (<function-symbol> <name>*).
Sourcepub fn new_function<I: IntoIterator<Item = Name>>(
symbol: FunctionSymbol,
names: I,
) -> Self
pub fn new_function<I: IntoIterator<Item = Name>>( symbol: FunctionSymbol, names: I, ) -> Self
Creates a ground function, (<function-symbol> <name>*).
Sourcepub const fn total_time() -> Self
pub const fn total_time() -> Self
Creates the total-time expression.
Sourcepub fn new_total_time() -> Self
pub fn new_total_time() -> Self
Creates the total-time expression.
Sourcepub const fn is_violated(pref: PreferenceName) -> Self
pub const fn is_violated(pref: PreferenceName) -> Self
Creates an (is-violated <pref-name>) expression.
Sourcepub fn new_is_violated(pref: PreferenceName) -> Self
pub fn new_is_violated(pref: PreferenceName) -> Self
Creates an (is-violated <pref-name>) expression.
Trait Implementations§
Source§impl Clone for MetricFluentExpression
impl Clone for MetricFluentExpression
Source§impl Debug for MetricFluentExpression
impl Debug for MetricFluentExpression
Source§impl<'de> Deserialize<'de> for MetricFluentExpression
Available on crate feature serde only.
impl<'de> Deserialize<'de> for MetricFluentExpression
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Parser for MetricFluentExpression
Available on crate feature parser only.
impl Parser for MetricFluentExpression
parser only.Source§type Item = MetricFluentExpression
type Item = MetricFluentExpression
Self except for
DurationConstraint, which may be empty.Source§impl PartialEq for MetricFluentExpression
impl PartialEq for MetricFluentExpression
Source§impl Serialize for MetricFluentExpression
Available on crate feature serde only.
impl Serialize for MetricFluentExpression
serde only.impl StructuralPartialEq for MetricFluentExpression
Source§impl Visitor<MetricFluentExpression, RcDoc<'static>> for PrettyRenderer
Available on crate feature pretty only.
impl Visitor<MetricFluentExpression, RcDoc<'static>> for PrettyRenderer
pretty only.Source§fn visit(&self, value: &MetricFluentExpression) -> RcDoc<'static>
fn visit(&self, value: &MetricFluentExpression) -> RcDoc<'static>
value and returns the result.Auto Trait Implementations§
impl Forget for MetricFluentExpression
impl Freeze for MetricFluentExpression
impl Move for MetricFluentExpression
impl RefUnwindSafe for MetricFluentExpression
impl Send for MetricFluentExpression
impl Sync for MetricFluentExpression
impl Unpin for MetricFluentExpression
impl UnsafeUnpin for MetricFluentExpression
impl UnwindSafe for MetricFluentExpression
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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Pretty for Twhere
T: PrettyVisit,
impl<T> Pretty for Twhere
T: PrettyVisit,
Source§impl<T> PrettyVisit for T
impl<T> PrettyVisit for T
Source§fn to_doc(&self, r: &PrettyRenderer) -> RcDoc<'static>
fn to_doc(&self, r: &PrettyRenderer) -> RcDoc<'static>
pretty only.self with the renderer r.