pub struct SolutionDescriptor {
pub type_name: &'static str,
pub type_id: TypeId,
pub entity_descriptors: Vec<EntityDescriptor>,
pub problem_fact_descriptors: Vec<ProblemFactDescriptor>,
pub score_field: &'static str,
pub score_is_optional: bool,
/* private fields */
}Expand description
Describes a planning solution at runtime.
Contains metadata about:
- Entity types and their descriptors
- Problem fact types
- Score type
Fields§
§type_name: &'static str§type_id: TypeId§entity_descriptors: Vec<EntityDescriptor>§problem_fact_descriptors: Vec<ProblemFactDescriptor>§score_field: &'static str§score_is_optional: boolImplementations§
Source§impl SolutionDescriptor
impl SolutionDescriptor
pub fn new(type_name: &'static str, type_id: TypeId) -> Self
pub fn with_entity(self, descriptor: EntityDescriptor) -> Self
pub fn with_problem_fact(self, descriptor: ProblemFactDescriptor) -> Self
pub fn with_score_field(self, field: &'static str) -> Self
pub fn find_entity_descriptor( &self, type_name: &str, ) -> Option<&EntityDescriptor>
pub fn find_entity_descriptor_by_type( &self, type_id: TypeId, ) -> Option<&EntityDescriptor>
pub fn genuine_variable_descriptors(&self) -> Vec<&VariableDescriptor>
pub fn shadow_variable_descriptors(&self) -> Vec<&VariableDescriptor>
Sourcepub fn total_entity_count(&self, solution: &dyn Any) -> Option<usize>
pub fn total_entity_count(&self, solution: &dyn Any) -> Option<usize>
Returns the total number of entities across all entity collections.
Returns None if any entity descriptor lacks an extractor or the solution
type doesn’t match.
pub fn all_entity_refs(&self, solution: &dyn Any) -> Vec<(usize, EntityRef)>
pub fn for_each_entity<F>(&self, solution: &dyn Any, f: F)
pub fn get_entity<'a>( &self, solution: &'a dyn Any, descriptor_index: usize, entity_index: usize, ) -> Option<&'a dyn Any>
pub fn get_entity_mut<'a>( &self, solution: &'a mut dyn Any, descriptor_index: usize, entity_index: usize, ) -> Option<&'a mut dyn Any>
pub fn entity_descriptor_count(&self) -> usize
pub fn problem_fact_descriptor_count(&self) -> usize
pub fn all_extractors_configured(&self) -> bool
Trait Implementations§
Source§impl Clone for SolutionDescriptor
impl Clone for SolutionDescriptor
Auto Trait Implementations§
impl Freeze for SolutionDescriptor
impl !RefUnwindSafe for SolutionDescriptor
impl Send for SolutionDescriptor
impl Sync for SolutionDescriptor
impl Unpin for SolutionDescriptor
impl UnsafeUnpin for SolutionDescriptor
impl !UnwindSafe for SolutionDescriptor
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