Struct ai_kit::planner::Goal
[−]
[src]
pub struct Goal<T: ConstraintValue, U: Unify<T>, A: Operation<T, U>> { pub bindings_at_creation: Bindings<T>, pub constraints: Vec<Constraint>, pub parental_constraints: Vec<Constraint>, pub pattern: U, pub subgoals: Vec<Goal<T, U, A>>, pub unification_index: UnificationIndex, // some fields omitted }
Fields
bindings_at_creation: Bindings<T>
constraints: Vec<Constraint>
parental_constraints: Vec<Constraint>
pattern: U
subgoals: Vec<Goal<T, U, A>>
unification_index: UnificationIndex
Methods
impl<T, U, A> Goal<T, U, A> where
T: ConstraintValue,
U: Unify<T>,
A: Operation<T, U>,
[src]
T: ConstraintValue,
U: Unify<T>,
A: Operation<T, U>,
fn new(
pattern: U,
parental_constraints: Vec<Constraint>,
constraints: Vec<Constraint>,
bindings_at_creation: Bindings<T>,
unification_index: UnificationIndex,
subgoals: Vec<Self>
) -> Self
pattern: U,
parental_constraints: Vec<Constraint>,
constraints: Vec<Constraint>,
bindings_at_creation: Bindings<T>,
unification_index: UnificationIndex,
subgoals: Vec<Self>
) -> Self
fn constraints(&self) -> Vec<&Constraint>
fn with_pattern(pattern: U) -> Self
fn solve(
goal: &Self,
data: &Vec<&U>,
rules: &Vec<&A>,
increments: usize,
config: &PlanningConfig
) -> Option<(usize, Self, Bindings<T>)>
goal: &Self,
data: &Vec<&U>,
rules: &Vec<&A>,
increments: usize,
config: &PlanningConfig
) -> Option<(usize, Self, Bindings<T>)>
fn solve_conjunction(
goals: Vec<&Self>,
data: &Vec<&U>,
rules: &Vec<&A>,
increments: usize,
config: &PlanningConfig
) -> Option<(Vec<Self>, Bindings<T>)>
goals: Vec<&Self>,
data: &Vec<&U>,
rules: &Vec<&A>,
increments: usize,
config: &PlanningConfig
) -> Option<(Vec<Self>, Bindings<T>)>
fn solve_conjunction_with_criteria<X>(
goals: Vec<&Self>,
data: &Vec<&U>,
rules: &Vec<&A>,
increments: usize,
config: &PlanningConfig,
criteria: &Fn(&Vec<Self>, &Bindings<T>) -> Option<X>
) -> Option<(Vec<Self>, Bindings<T>, X)>
goals: Vec<&Self>,
data: &Vec<&U>,
rules: &Vec<&A>,
increments: usize,
config: &PlanningConfig,
criteria: &Fn(&Vec<Self>, &Bindings<T>) -> Option<X>
) -> Option<(Vec<Self>, Bindings<T>, X)>
fn validate(
&self,
data: &Vec<&U>,
rules: &Vec<&A>,
bindings: &Bindings<T>,
config: &PlanningConfig
) -> Result<Bindings<T>, InvalidPlan>
&self,
data: &Vec<&U>,
rules: &Vec<&A>,
bindings: &Bindings<T>,
config: &PlanningConfig
) -> Result<Bindings<T>, InvalidPlan>
Verify that this plan does not break any of the planning specifications and that it is consistent
fn increment(
&self,
data: &Vec<&U>,
rules: &Vec<&A>,
snowflake_prefix_id: usize,
max_depth: usize
) -> Option<Self>
&self,
data: &Vec<&U>,
rules: &Vec<&A>,
snowflake_prefix_id: usize,
max_depth: usize
) -> Option<Self>
Construct a mutated plan
fn satisified(
&self,
data: &Vec<&U>,
rules: &Vec<&A>,
bindings: &Bindings<T>
) -> Option<Bindings<T>>
&self,
data: &Vec<&U>,
rules: &Vec<&A>,
bindings: &Bindings<T>
) -> Option<Bindings<T>>
Determine if the plan is valid
fn create_subgoals(
r_pattern: &U,
rule: &A,
parent_constraints: &Vec<&Constraint>,
data: &Vec<&U>,
rules: &Vec<&A>,
snowflake_prefix_id: usize,
max_depth: usize
) -> Option<Vec<Self>>
r_pattern: &U,
rule: &A,
parent_constraints: &Vec<&Constraint>,
data: &Vec<&U>,
rules: &Vec<&A>,
snowflake_prefix_id: usize,
max_depth: usize
) -> Option<Vec<Self>>
fn increment_conjunction(
goals: Vec<&Self>,
data: &Vec<&U>,
rules: &Vec<&A>,
snowflake_prefix_id: usize,
max_depth: usize
) -> Option<Vec<Self>>
goals: Vec<&Self>,
data: &Vec<&U>,
rules: &Vec<&A>,
snowflake_prefix_id: usize,
max_depth: usize
) -> Option<Vec<Self>>
fn render_as_graphviz(&self) -> String
fn pprint(&self, ntabs: usize, only_render_spine: bool) -> String
fn apply_bindings(&self, bindings: &Bindings<T>) -> Option<Self>
fn find_reused_datum(&self, used_data: &mut HashSet<usize>) -> Option<usize>
Traverse the tree and determine if any datum is being used more than once
fn gather_leaves(&self, bindings: &Bindings<T>) -> Vec<U>
Traverse the goal tree using a depth-first search and gather the leaves of the plan
Trait Implementations
impl<T: Clone + ConstraintValue, U: Clone + Unify<T>, A: Clone + Operation<T, U>> Clone for Goal<T, U, A>
[src]
fn clone(&self) -> Goal<T, U, A>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Debug + ConstraintValue, U: Debug + Unify<T>, A: Debug + Operation<T, U>> Debug for Goal<T, U, A>
[src]
impl<T: Eq + ConstraintValue, U: Eq + Unify<T>, A: Eq + Operation<T, U>> Eq for Goal<T, U, A>
[src]
impl<T: PartialEq + ConstraintValue, U: PartialEq + Unify<T>, A: PartialEq + Operation<T, U>> PartialEq for Goal<T, U, A>
[src]
fn eq(&self, __arg_0: &Goal<T, U, A>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Goal<T, U, A>) -> bool
This method tests for !=
.
impl<T, U, A> Display for Goal<T, U, A> where
T: ConstraintValue,
U: Unify<T>,
A: Operation<T, U>,
[src]
T: ConstraintValue,
U: Unify<T>,
A: Operation<T, U>,