task_plan_execute_2/include/plan_manager.hpp

110 lines
3.7 KiB
C++
Raw Permalink Normal View History

2026-06-17 04:58:09 +00:00
#ifndef TPS_PLAN_MANAGER_HPP
#define TPS_PLAN_MANAGER_HPP
#include "app.hpp"
#include <string>
#include <vector>
// ============================================================
// 计划管理模块SU-06 计划管理单元)
// ============================================================
/**
*
*
*/
class PlanManager {
public:
PlanManager() = default;
~PlanManager() = default;
/**
*
*
* @requirement(name="生成作战任务并送交处理", id="SRS-F-02-004")
* "生成任务"
*
*
* @param name
* @param eventIds ID列表
* @param templateId 使ID
* @return ID
*/
std::string createPlan(const std::string& name,
const std::vector<std::string>& eventIds,
const std::string& templateId);
/**
*
*
* @requirement(name="集中式计划管理与偏好排序", id="SRS-F-05-001")
*
*
* @param weightPriority
* @param weightTime
* @return
*/
std::vector<TaskPlan> sortPlans(double weightPriority, double weightTime);
/**
*
*
* @requirement(name="计划详情可视化与HITL通知", id="SRS-F-05-002")
*
*
* @param planId ID
* @param nodeId ID
* @param user
* @return true
*/
bool notifyHITL(const std::string& planId,
const std::string& nodeId,
const std::string& user);
/**
*
*
* @requirement(name="计划重配置操作与可视化", id="SRS-F-05-003")
*
*
*
* @param planId ID
* @param newNodes
* @return ID
*/
std::string reconfigurePlan(const std::string& planId,
const std::vector<PlanNode>& newNodes);
/**
*
*
* @requirement(name="分布式计划管理与算法处理", id="SRS-F-05-004")
*
*
* @param externalPlans
* @return true
*/
bool mergeAndCheckConsistency(const std::vector<TaskPlan>& externalPlans);
/**
*
*/
std::vector<TaskPlan> getAllPlans() const;
/**
*
*/
std::vector<PlanNode> getPlanNodes(const std::string& planId) const;
private:
std::vector<TaskPlan> plans_; ///< 本地计划集合
std::map<std::string, std::vector<PlanNode>> planNodes_; ///< planId -> 节点列表
/**
* IDUUID模拟
*/
std::string generateId();
};
#endif // TPS_PLAN_MANAGER_HPP