pub enum AssignOp {
Assign,
ScaleUp,
ScaleDown,
Increase,
Decrease,
}Expand description
Variants§
Assign
An assign effect assigns the value of a numeric variable to the given amount.
(assign (battery-level ?r) 10)It is possible to use another numeric variable as the assign value, for example:
(assign (battery-level ?r) (max-charge ?r))ScaleUp
A scale up effect increases the value of the numeric variable by the given scale factor.
This resembles the C-style operator *=.
(scale-up (battery-level ?r) 2)The scale factor can be another numeric variable.
(scale-up (battery-level ?r) (charge-rate ?r))ScaleDown
A scale down effect decreases the value of the numeric variable by the given scale factor.
This resembles the C-style operator /=.
(scale-down (battery-level ?r) 2)The scale factor can be another numeric variable.
(scale-down (battery-level ?r) (consumption-rate ?r))Increase
An increase effect increases the value of a numeric variable by the given amount.
This resembles the C-style operator +=.
(increase (battery-level ?r) 10)It is possible to use another numeric variable as the increase value for example.
(increase (battery-level ?r) (charge-available - ?solarpanel))Decrease
A decrease effect decreases the value of a numeric variable by the given amount.
This resembles the C-style operator -=.
(decrease (battery-level ?r) 10)It is possible to use another numeric variable as the decrease value for example.
(decrease (battery-level ?r) (power-needed-for-work - ?task))Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AssignOp
Available on crate feature serde only.
impl<'de> Deserialize<'de> for AssignOp
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>
impl Eq for AssignOp
impl StructuralPartialEq for AssignOp
Auto Trait Implementations§
impl Forget for AssignOp
impl Freeze for AssignOp
impl Move for AssignOp
impl RefUnwindSafe for AssignOp
impl Send for AssignOp
impl Sync for AssignOp
impl Unpin for AssignOp
impl UnsafeUnpin for AssignOp
impl UnwindSafe for AssignOp
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.