Tauri 2 + Vue 3 + Vite 6 桌面应用,Rust workspace 含 13 个 crate (df-ai / df-storage / df-workflow / df-core / df-execute 等)。 核心能力:AI 聊天 agentic 循环(工具调用+人工审批)、工作流引擎、 任务/想法/项目/阶段管理、可追溯性,及配套前端组件。
76 lines
2.0 KiB
Rust
76 lines
2.0 KiB
Rust
//! 评分引擎 — 多维度加权评分
|
|
|
|
use crate::capture::Idea;
|
|
|
|
/// 想法评分详情(重新导出 capture 模块中的定义)
|
|
pub use crate::capture::IdeaScores;
|
|
|
|
/// 评分权重配置
|
|
#[derive(Debug, Clone)]
|
|
pub struct ScoringWeights {
|
|
pub feasibility: f64,
|
|
pub impact: f64,
|
|
pub urgency: f64,
|
|
}
|
|
|
|
impl Default for ScoringWeights {
|
|
fn default() -> Self {
|
|
Self {
|
|
feasibility: 0.4,
|
|
impact: 0.4,
|
|
urgency: 0.2,
|
|
}
|
|
}
|
|
}
|
|
|
|
/// 评分引擎
|
|
pub struct ScoringEngine;
|
|
|
|
impl ScoringEngine {
|
|
/// 使用默认权重计算评分
|
|
///
|
|
/// TODO: 接入 AI 进行深度评分,当前返回基于启发式的分数
|
|
pub fn compute_default(idea: &Idea) -> IdeaScores {
|
|
let weights = ScoringWeights::default();
|
|
Self::compute(idea, &weights)
|
|
}
|
|
|
|
/// 使用指定权重计算评分
|
|
pub fn compute(idea: &Idea, weights: &ScoringWeights) -> IdeaScores {
|
|
// TODO: 基于想法内容、历史数据、AI 分析等多维度评分
|
|
// 当前使用基于启发式的占位评分
|
|
let feasibility = Self::heuristic_feasibility(idea);
|
|
let impact = Self::heuristic_impact(idea);
|
|
let urgency = Self::heuristic_urgency(idea);
|
|
|
|
let overall = feasibility * weights.feasibility
|
|
+ impact * weights.impact
|
|
+ urgency * weights.urgency;
|
|
|
|
IdeaScores {
|
|
feasibility,
|
|
impact,
|
|
urgency,
|
|
overall,
|
|
}
|
|
}
|
|
|
|
/// 启发式可行性评分
|
|
fn heuristic_feasibility(_idea: &Idea) -> f64 {
|
|
// TODO: 基于描述复杂度、资源需求等评估
|
|
5.0
|
|
}
|
|
|
|
/// 启发式影响力评分
|
|
fn heuristic_impact(_idea: &Idea) -> f64 {
|
|
// TODO: 基于业务价值、用户影响等评估
|
|
5.0
|
|
}
|
|
|
|
/// 启发式紧急度评分
|
|
fn heuristic_urgency(_idea: &Idea) -> f64 {
|
|
// TODO: 基于优先级、时间窗口等评估
|
|
5.0
|
|
}
|
|
}
|