eryon_rt/tasks/
kinds.rs

1/*
2    Appellation: kinds <module>
3    Contrib: @FL03
4*/
5use crate::actors::OperatorKind;
6use rshyper::EdgeId;
7use rstmt::nrt::LPR;
8
9/// Types of tasks that can be scheduled
10#[derive(Clone, Debug, PartialEq, PartialOrd, strum::EnumDiscriminants, strum::EnumIs)]
11#[strum_discriminants(
12    name(TaskTypeKey),
13    derive(
14        Hash,
15        Ord,
16        PartialOrd,
17        strum::AsRefStr,
18        strum::Display,
19        strum::EnumCount,
20        strum::EnumIs,
21        strum::EnumIter,
22        strum::EnumString,
23        strum::VariantArray,
24        strum::VariantNames
25    )
26)]
27pub enum TaskType {
28    /// Apply a transformation to a specific node
29    Transform {
30        node_id: EdgeId,
31        transformation: LPR,
32    },
33    /// Apply multiple transformations to multiple nodes
34    BatchTransform(Vec<(EdgeId, Vec<LPR>)>),
35    /// Compute all possible transformations between nodes
36    ComputeTransformations,
37    /// Share patterns between nodes
38    SharePatterns,
39    /// Learn a pattern on a specific node
40    LearnPattern {
41        node_id: EdgeId,
42        pattern: Vec<f32>,
43        target: f32,
44    },
45    /// Optimize memory usage
46    OptimizeMemory { max_features: usize },
47    /// Optimize a specific node
48    OptimizeNode {
49        node_id: EdgeId,
50        target_memory: usize,
51    },
52    /// Balance resources across nodes
53    BalanceResources,
54    /// Change node operator mode
55    ChangeNodeMode(EdgeId, OperatorKind),
56    /// Process agent proposals
57    ProcessAgentProposals,
58    /// Coordinate learning between nodes
59    CoordinateLearning,
60    /// Evaluate ensemble performance
61    EvaluateEnsemble {
62        node_id: EdgeId,
63        component_nodes: Vec<EdgeId>,
64    },
65    /// Evaluate performance
66    EvaluatePerformance,
67}
68
69impl TaskType {
70    pub fn transform(node_id: EdgeId, transformation: LPR) -> Self {
71        TaskType::Transform {
72            node_id,
73            transformation,
74        }
75    }
76}
77impl Eq for TaskType {}