pub struct GoalTree {
pub nodes: BTreeMap<String, GoalNode>,
pub root_id: Option<String>,
pub active_id: Option<String>,
}Fields§
§nodes: BTreeMap<String, GoalNode>§root_id: Option<String>§active_id: Option<String>Implementations§
Source§impl GoalTree
impl GoalTree
pub fn new() -> Self
pub fn from_flat(targets: BTreeMap<String, f64>) -> Self
pub fn to_flat(&self) -> BTreeMap<String, f64>
pub fn add_root( &mut self, id: impl Into<String>, targets: BTreeMap<String, f64>, priority: i32, )
pub fn add_child( &mut self, parent_id: &str, id: impl Into<String>, targets: BTreeMap<String, f64>, weight: f64, priority: i32, ) -> bool
pub fn update_from_state( &mut self, state: &BTreeMap<String, f64>, tolerance: f64, )
pub fn select_active(&mut self) -> Option<&GoalNode>
pub fn summary(&self) -> GoalTreeSummary
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GoalTree
impl<'de> Deserialize<'de> for GoalTree
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for GoalTree
Auto Trait Implementations§
impl Forget for GoalTree
impl Freeze for GoalTree
impl Move for GoalTree
impl RefUnwindSafe for GoalTree
impl Send for GoalTree
impl Sync for GoalTree
impl Unpin for GoalTree
impl UnsafeUnpin for GoalTreewhere
*const LeafNode<String, GoalNode> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, GoalNode)>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for GoalTree
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