pub struct BaseCase {
pub conditions: Vec<GroundedCondition>,
pub cost: Option<CostExpression>,
}
Expand description
Base case.
Fields§
§conditions: Vec<GroundedCondition>
§cost: Option<CostExpression>
Implementations§
source§impl BaseCase
impl BaseCase
sourcepub fn with_cost<T>(conditions: Vec<GroundedCondition>, cost: T) -> Selfwhere
CostExpression: From<T>,
pub fn with_cost<T>(conditions: Vec<GroundedCondition>, cost: T) -> Selfwhere
CostExpression: From<T>,
Creates a new base case given conditions and a cost expression.
sourcepub fn is_satisfied<S: StateInterface>(
&self,
state: &S,
registry: &TableRegistry,
) -> bool
pub fn is_satisfied<S: StateInterface>( &self, state: &S, registry: &TableRegistry, ) -> bool
Returns true if the base case is satisfied and false otherwise.
§Panics
Panics if the cost of the transition state is used or a min/max reduce operation is performed on an empty set or vector.
sourcepub fn eval_cost<S: StateInterface, T: Numeric>(
&self,
state: &S,
registry: &TableRegistry,
) -> Option<T>
pub fn eval_cost<S: StateInterface, T: Numeric>( &self, state: &S, registry: &TableRegistry, ) -> Option<T>
Returns the cost of the base case if it is satisfied and None otherwise.
§Panics
Panics if the cost of the transition state is used or a min/max reduce operation is performed on an empty set or vector.
Trait Implementations§
source§impl From<Vec<GroundedCondition>> for BaseCase
impl From<Vec<GroundedCondition>> for BaseCase
source§fn from(conditions: Vec<GroundedCondition>) -> Self
fn from(conditions: Vec<GroundedCondition>) -> Self
Converts to this type from the input type.
source§impl PartialEq for BaseCase
impl PartialEq for BaseCase
impl StructuralPartialEq for BaseCase
Auto Trait Implementations§
impl Freeze for BaseCase
impl RefUnwindSafe for BaseCase
impl Send for BaseCase
impl Sync for BaseCase
impl Unpin for BaseCase
impl UnwindSafe for BaseCase
Blanket Implementations§
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