Package com.tnsai.coordination.planning
Record Class SubGoal
java.lang.Object
java.lang.Record
com.tnsai.coordination.planning.SubGoal
- Record Components:
goalName- unique name of this sub-goalparentGoal- the parent goal this was decomposed fromassigneeId- ID of the agent assigned to this sub-goalphase- execution phase (0-based); same-phase sub-goals run in paralleldependencies- set of sub-goal names this depends on (must complete first)description- human-readable description of what this sub-goal achieves
public record SubGoal(String goalName, String parentGoal, String assigneeId, int phase, Set<String> dependencies, String description)
extends Record
A sub-goal decomposed from a parent goal, assigned to a specific agent.
Sub-goals have an execution phase: sub-goals in the same phase can execute in parallel, while phases execute sequentially.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theassigneeIdrecord component.Returns the value of thedependenciesrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.goalName()Returns the value of thegoalNamerecord component.final inthashCode()Returns a hash code value for this object.booleanReturns true if this sub-goal has no dependencies.static SubGoalCreates a sub-goal with no dependencies.static SubGoalof(String goalName, String parentGoal, String assigneeId, int phase, Set<String> dependencies, String description) Creates a sub-goal with dependencies and description.Returns the value of theparentGoalrecord component.intphase()Returns the value of thephaserecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SubGoal
public SubGoal(String goalName, String parentGoal, String assigneeId, int phase, Set<String> dependencies, String description) Creates an instance of aSubGoalrecord class.- Parameters:
goalName- the value for thegoalNamerecord componentparentGoal- the value for theparentGoalrecord componentassigneeId- the value for theassigneeIdrecord componentphase- the value for thephaserecord componentdependencies- the value for thedependenciesrecord componentdescription- the value for thedescriptionrecord component
-
-
Method Details
-
of
Creates a sub-goal with no dependencies. -
of
public static SubGoal of(String goalName, String parentGoal, String assigneeId, int phase, Set<String> dependencies, String description) Creates a sub-goal with dependencies and description. -
isIndependent
public boolean isIndependent()Returns true if this sub-goal has no dependencies. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
goalName
Returns the value of thegoalNamerecord component.- Returns:
- the value of the
goalNamerecord component
-
parentGoal
Returns the value of theparentGoalrecord component.- Returns:
- the value of the
parentGoalrecord component
-
assigneeId
Returns the value of theassigneeIdrecord component.- Returns:
- the value of the
assigneeIdrecord component
-
phase
public int phase()Returns the value of thephaserecord component.- Returns:
- the value of the
phaserecord component
-
dependencies
Returns the value of thedependenciesrecord component.- Returns:
- the value of the
dependenciesrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-