Record Class Desire
java.lang.Object
java.lang.Record
dev.langchain4j.agentic.patterns.bdi.Desire
- Record Components:
name- human-readable label, used in log messages and error diagnosticspriority- higher value = more important; strictly higher priority triggers preemptionachievable- predicate onAgenticScope— can this desire be pursued now?satisfied- predicate onAgenticScope— has this desire been achieved?agentTypes- ordered agent classes forming the intention; resolved to instances at init time
public record Desire(String name, int priority, Predicate<AgenticScope> achievable, Predicate<AgenticScope> satisfied, List<Class<?>> agentTypes)
extends Record
A prioritized goal for the
BDIPlanner. Each desire declares when it is achievable, when
it is satisfied, and the ordered sequence of agent types that form its intention. Higher priority
values take precedence; among equal priorities, declaration order wins (stable ordering).-
Constructor Summary
ConstructorsConstructorDescriptionDesire(String name, int priority, Predicate<AgenticScope> achievable, Predicate<AgenticScope> satisfied, List<Class<?>> agentTypes) Creates an instance of aDesirerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theachievablerecord component.Returns the value of theagentTypesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.static Desireof(String name, int priority, String achievableStateKey, String satisfiedStateKey, Class<?>... agentTypes) static Desireof(String name, int priority, Predicate<AgenticScope> achievable, Predicate<AgenticScope> satisfied, Class<?>... agentTypes) intpriority()Returns the value of thepriorityrecord component.Returns the value of thesatisfiedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Desire
public Desire(String name, int priority, Predicate<AgenticScope> achievable, Predicate<AgenticScope> satisfied, List<Class<?>> agentTypes) Creates an instance of aDesirerecord class.- Parameters:
name- the value for thenamerecord componentpriority- the value for thepriorityrecord componentachievable- the value for theachievablerecord componentsatisfied- the value for thesatisfiedrecord componentagentTypes- the value for theagentTypesrecord component
-
-
Method Details
-
of
public static Desire of(String name, int priority, Predicate<AgenticScope> achievable, Predicate<AgenticScope> satisfied, Class<?>... agentTypes) -
of
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
name
-
priority
-
achievable
Returns the value of theachievablerecord component.- Returns:
- the value of the
achievablerecord component
-
satisfied
-
agentTypes
Returns the value of theagentTypesrecord component.- Returns:
- the value of the
agentTypesrecord component
-