use std::any::Any;
use std::hash::Hash;
use crate::constraint_weights::ConstraintWeights;
use crate::score::Score;
pub trait PlanningSolution: Clone + Send + Sync + 'static {
type Score: Score;
fn score(&self) -> Option<Self::Score>;
fn set_score(&mut self, score: Option<Self::Score>);
fn update_entity_shadows(&mut self, _descriptor_index: usize, _entity_index: usize) {}
fn update_all_shadows(&mut self) {}
const HAS_CONSTRAINT_WEIGHTS: bool = false;
fn constraint_weights(&self) -> Option<&ConstraintWeights> {
None
}
fn list_shadow_elements(
&self,
_descriptor_index: usize,
_entity_index: usize,
) -> Option<(usize, &[usize])> {
None
}
fn clear_list_shadows(&mut self, _element: usize) {}
fn list_shadow_source(_collection: &str) -> Option<usize> {
None
}
const HAS_CASCADING_SHADOWS: bool = false;
fn cascading_element_count(&self) -> usize {
0
}
fn cascading_assigned(&self, _element: usize) -> bool {
false
}
fn cascading_next(&self, _element: usize) -> Option<usize> {
None
}
fn cascading_dependencies(&self, _element: usize, _dependencies: &mut Vec<usize>) {}
fn cascading_peers(&self, _element: usize, _peers: &mut Vec<usize>) {}
fn list_structure_unchanged(
&self,
_element: usize,
_owner_descriptor: usize,
_owner_index: usize,
_index: usize,
_previous: Option<usize>,
_next: Option<usize>,
) -> bool {
false
}
fn cascading_unset(&self, _element: usize) -> bool {
true
}
fn update_cascading_shadow<W: FnOnce(&Self)>(
&mut self,
_element: usize,
_computable: bool,
_before_write: W,
) -> bool {
false
}
fn update_list_structure_shadows(&mut self, descriptor_index: usize, entity_index: usize) {
self.update_entity_shadows(descriptor_index, entity_index);
}
fn is_initialized(&self) -> bool {
true
}
}
pub trait PlanningEntity: Clone + Send + Sync + Any + 'static {
fn is_pinned(&self) -> bool {
false
}
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
}
pub trait ProblemFact: Clone + Send + Sync + Any + 'static {
fn as_any(&self) -> &dyn Any;
}
pub trait PlanningId {
type Id: Eq + Hash + Clone + Send + Sync + 'static;
fn planning_id(&self) -> Self::Id;
}