pub struct Goal {
pub goal_id: GoalId,
pub level: GoalLevel,
pub description: String,
pub priority: u32,
pub constraints: Vec<GoalConstraint>,
pub dependencies: Vec<GoalId>,
pub knowledge_context: GoalKnowledgeContext,
pub assigned_roles: Vec<String>,
pub assigned_agents: Vec<AgentPid>,
pub status: GoalStatus,
pub metadata: GoalMetadata,
}Expand description
Goal representation with knowledge graph context
Fields§
§goal_id: GoalIdUnique goal identifier
level: GoalLevelGoal hierarchy level
description: StringHuman-readable goal description
priority: u32Goal priority (higher number = higher priority)
constraints: Vec<GoalConstraint>Goal constraints and requirements
dependencies: Vec<GoalId>Dependencies on other goals
knowledge_context: GoalKnowledgeContextKnowledge graph concepts related to this goal
assigned_roles: Vec<String>Agent roles that can work on this goal
assigned_agents: Vec<AgentPid>Agents currently assigned to this goal
status: GoalStatusCurrent goal status
metadata: GoalMetadataGoal metadata and tracking
Implementations§
Source§impl Goal
impl Goal
Sourcepub fn new(
goal_id: GoalId,
level: GoalLevel,
description: String,
priority: u32,
) -> Self
pub fn new( goal_id: GoalId, level: GoalLevel, description: String, priority: u32, ) -> Self
Create a new goal
Sourcepub fn add_constraint(
&mut self,
constraint: GoalConstraint,
) -> GoalAlignmentResult<()>
pub fn add_constraint( &mut self, constraint: GoalConstraint, ) -> GoalAlignmentResult<()>
Add a constraint to the goal
Sourcepub fn add_dependency(
&mut self,
dependency_goal_id: GoalId,
) -> GoalAlignmentResult<()>
pub fn add_dependency( &mut self, dependency_goal_id: GoalId, ) -> GoalAlignmentResult<()>
Add a dependency to the goal
Sourcepub fn assign_agent(&mut self, agent_id: AgentPid) -> GoalAlignmentResult<()>
pub fn assign_agent(&mut self, agent_id: AgentPid) -> GoalAlignmentResult<()>
Assign an agent to the goal
Sourcepub fn unassign_agent(&mut self, agent_id: &AgentPid) -> GoalAlignmentResult<()>
pub fn unassign_agent(&mut self, agent_id: &AgentPid) -> GoalAlignmentResult<()>
Remove an agent from the goal
Sourcepub fn update_status(&mut self, status: GoalStatus) -> GoalAlignmentResult<()>
pub fn update_status(&mut self, status: GoalStatus) -> GoalAlignmentResult<()>
Update goal status
Sourcepub fn update_progress(&mut self, progress: f64) -> GoalAlignmentResult<()>
pub fn update_progress(&mut self, progress: f64) -> GoalAlignmentResult<()>
Update goal progress
Sourcepub fn can_start(&self, completed_goals: &HashSet<GoalId>) -> bool
pub fn can_start(&self, completed_goals: &HashSet<GoalId>) -> bool
Check if goal can be started (all dependencies met)
Sourcepub fn is_blocked(&self) -> bool
pub fn is_blocked(&self) -> bool
Check if goal is blocked
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Check if goal is completed
Sourcepub fn has_failed(&self) -> bool
pub fn has_failed(&self) -> bool
Check if goal has failed
Sourcepub fn get_duration(&self) -> Option<Duration>
pub fn get_duration(&self) -> Option<Duration>
Get goal duration if completed
Sourcepub fn calculate_success_score(&self) -> f64
pub fn calculate_success_score(&self) -> f64
Calculate overall success score based on criteria
Sourcepub fn validate(&self) -> GoalAlignmentResult<()>
pub fn validate(&self) -> GoalAlignmentResult<()>
Validate the goal
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Goal
impl<'de> Deserialize<'de> for Goal
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>,
impl StructuralPartialEq for Goal
Auto Trait Implementations§
impl Freeze for Goal
impl RefUnwindSafe for Goal
impl Send for Goal
impl Sync for Goal
impl Unpin for Goal
impl UnsafeUnpin for Goal
impl UnwindSafe for Goal
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more