类 Plan
java.lang.Object
io.agentscope.core.plan.model.Plan
Represents a plan containing a sequence of subtasks.
A plan breaks down a complex task into manageable subtasks with clear goals and expected outcomes. It tracks the overall progress and provides a structured approach to task execution.
Usage Example:
Plan plan = new Plan(
"Build E-commerce Website",
"Build a complete e-commerce platform with authentication and payment",
"Fully functional website deployed online",
List.of(
new SubTask("Setup", "Initialize project", "Project ready"),
new SubTask("Auth", "Implement authentication", "Users can login"),
new SubTask("Cart", "Implement shopping cart", "Cart works")
)
);
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidMark the plan as finished.Gets the creation timestamp of this plan.Gets the description of this plan.Gets the expected outcome of this plan.Gets the timestamp when this plan was finished.getId()Gets the unique identifier of this plan.getName()Gets the name of this plan.Gets the actual outcome of this plan.getState()Gets the current state of this plan.Gets the list of subtasks in this plan.voidsetCreatedAt(String createdAt) Sets the creation timestamp of this plan.voidsetDescription(String description) Sets the description of this plan.voidsetExpectedOutcome(String expectedOutcome) Sets the expected outcome of this plan.voidsetFinishedAt(String finishedAt) Sets the timestamp when this plan was finished.voidSets the unique identifier of this plan.voidSets the name of this plan.voidsetOutcome(String outcome) Sets the actual outcome of this plan.voidSets the state of this plan.voidsetSubtasks(List<SubTask> subtasks) Sets the list of subtasks for this plan.toMarkdown(boolean detailed) Convert to markdown representation.
-
构造器详细资料
-
Plan
public Plan()Default constructor for deserialization. -
Plan
Create a new plan.- 参数:
name- The plan name (should be concise, not exceed 10 words)description- The plan description including constraints and targetsexpectedOutcome- The expected outcome, specific and measurablesubtasks- The list of subtasks that make up the plan
-
-
方法详细资料
-
finish
Mark the plan as finished.- 参数:
state- The final state (DONE or ABANDONED)outcome- The actual outcome or reason for abandoning
-
toMarkdown
Convert to markdown representation.- 参数:
detailed- Whether to include detailed information for subtasks- 返回:
- Markdown string representation
-
getId
Gets the unique identifier of this plan.- 返回:
- The plan ID (UUID format)
-
setId
Sets the unique identifier of this plan.- 参数:
id- The plan ID
-
getName
Gets the name of this plan.- 返回:
- The plan name
-
setName
Sets the name of this plan.- 参数:
name- The plan name
-
getDescription
Gets the description of this plan.- 返回:
- The plan description including constraints and targets
-
setDescription
Sets the description of this plan.- 参数:
description- The plan description
-
getExpectedOutcome
Gets the expected outcome of this plan.- 返回:
- The expected outcome (specific and measurable)
-
setExpectedOutcome
Sets the expected outcome of this plan.- 参数:
expectedOutcome- The expected outcome
-
getSubtasks
Gets the list of subtasks in this plan.- 返回:
- The subtasks list
-
setSubtasks
Sets the list of subtasks for this plan.- 参数:
subtasks- The subtasks list
-
getCreatedAt
Gets the creation timestamp of this plan.- 返回:
- The creation time (formatted as "yyyy-MM-dd HH:mm:ss")
-
setCreatedAt
Sets the creation timestamp of this plan.- 参数:
createdAt- The creation time
-
getState
Gets the current state of this plan.- 返回:
- The plan state (TODO, IN_PROGRESS, DONE, or ABANDONED)
-
setState
Sets the state of this plan.- 参数:
state- The plan state
-
getFinishedAt
Gets the timestamp when this plan was finished.- 返回:
- The finish time, or null if not finished yet
-
setFinishedAt
Sets the timestamp when this plan was finished.- 参数:
finishedAt- The finish time
-
getOutcome
Gets the actual outcome of this plan.- 返回:
- The actual outcome (if done) or reason for abandoning
-
setOutcome
Sets the actual outcome of this plan.- 参数:
outcome- The actual outcome or reason
-