sciforge_hub/engine/experience/
experiment.rs1#[derive(Debug, Clone)]
9pub enum DomainType {
10 Maths,
11 Physics,
12 Chemistry,
13 Biology,
14 Astronomy,
15 Geology,
16 Meteorology,
17 Astrochemistry,
18 Geophysics,
19 Astrophysics,
20 Biochemistry,
21 Biophysics,
22 Geochemistry,
23 Astrobiology,
24 AtmosphericChemistry,
25 AtmosphericPhysics,
26 PlanetaryGeology,
27 Biomathematics,
28 MathematicalPhysics,
29}
30
31#[derive(Debug, Clone)]
33pub enum ParameterValue {
34 Scalar(f64),
35 Integer(i64),
36 Vector(Vec<f64>),
37 Matrix(Vec<Vec<f64>>),
38 Boolean(bool),
39 Text(String),
40 Complex(f64, f64),
41 ComplexVector(Vec<(f64, f64)>),
42 Polynomial(Vec<f64>),
43 IntVector(Vec<usize>),
44 IntMatrix(Vec<Vec<usize>>),
45 EdgeList(Vec<(usize, usize, f64)>),
46 Sparse {
47 rows: usize,
48 cols: usize,
49 row_ptr: Vec<usize>,
50 col_idx: Vec<usize>,
51 values: Vec<f64>,
52 },
53 Tensor {
54 data: Vec<f64>,
55 shape: Vec<usize>,
56 },
57}
58
59#[derive(Debug, Clone)]
61pub struct Experiment {
62 pub domain: DomainType,
64 pub function_name: String,
66 pub parameters: Vec<(String, ParameterValue)>,
68}
69
70impl Experiment {
71 pub fn new(domain: DomainType, function_name: &str) -> Self {
73 Self {
74 domain,
75 function_name: function_name.to_string(),
76 parameters: Vec::new(),
77 }
78 }
79
80 pub fn param(mut self, name: &str, value: ParameterValue) -> Self {
82 self.parameters.push((name.to_string(), value));
83 self
84 }
85}