Record Class PlanningGoal

java.lang.Object
java.lang.Record
com.tnsai.planning.PlanningGoal
Record Components:
name - unique goal identifier
condition - condition expression for satisfaction check
priority - goal priority (higher = more important)
description - human-readable description
persistent - whether goal persists after achievement
deadline - deadline in ticks (-1 for no deadline)

public record PlanningGoal(String name, String condition, com.tnsai.enums.agent.Priority priority, String description, boolean persistent, int deadline) extends Record
Runtime representation of a planning goal.

Created from Goal annotations at runtime.

Author:
TnsAI Team
See Also:
  • Goal
  • Constructor Details

    • PlanningGoal

      public PlanningGoal(String name, String condition, com.tnsai.enums.agent.Priority priority, String description, boolean persistent, int deadline)
      Creates an instance of a PlanningGoal record class.
      Parameters:
      name - the value for the name record component
      condition - the value for the condition record component
      priority - the value for the priority record component
      description - the value for the description record component
      persistent - the value for the persistent record component
      deadline - the value for the deadline record component
  • Method Details

    • of

      public static PlanningGoal of(String name, String condition)
      Creates a simple goal with defaults.
      Parameters:
      name - goal name
      condition - satisfaction condition
      Returns:
      new PlanningGoal with default priority and persistence
    • of

      public static PlanningGoal of(String name, String condition, com.tnsai.enums.agent.Priority priority)
      Creates a goal with priority.
      Parameters:
      name - goal name
      condition - satisfaction condition
      priority - goal priority
      Returns:
      new PlanningGoal
    • hasDeadline

      public boolean hasDeadline()
      Checks if this goal has a deadline.
      Returns:
      true if deadline is set
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • condition

      public String condition()
      Returns the value of the condition record component.
      Returns:
      the value of the condition record component
    • priority

      public com.tnsai.enums.agent.Priority priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • persistent

      public boolean persistent()
      Returns the value of the persistent record component.
      Returns:
      the value of the persistent record component
    • deadline

      public int deadline()
      Returns the value of the deadline record component.
      Returns:
      the value of the deadline record component