Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command to Run Algos #337

Merged
merged 10 commits into from
Mar 4, 2023
Prev Previous commit
Next Next commit
serialization
  • Loading branch information
uhuruhashimoto committed Mar 3, 2023
commit e6e2f030add60411465934ca1f07760b7b901a1d
3 changes: 2 additions & 1 deletion src-tauri/src/analytics/algo_result_enums/ap.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use petgraph::graph::NodeIndex;

#[derive(Debug)]
#[derive(Debug, Serialize, Deserialize)]
pub enum APResult {
Success(Vec<NodeIndex>),
Error(String),
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/analytics/algo_result_enums/diff_cen.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

#[derive(Debug)]
#[derive(Debug, Serialize, Deserialize)]
pub enum DiffCenResult {
Success(HashMap<String, HashMap<String, f64>>),
Error(String),
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/analytics/algo_result_enums/mincut.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use crate::graph::edge::Edge;

#[derive(Debug)]
#[derive(Debug, Serialize, Deserialize)]
pub enum MinCutResult {
Success(Vec<Edge>),
Error(String),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use crate::graph::graph_ds::Graph;

#[derive(Debug)]
#[derive(Debug, Serialize, Deserialize)]
pub enum MostSimTResult {
Success(Graph),
Error(String),
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/analytics/algo_result_enums/pred_state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use crate::graph::graph_ds::Graph;

#[derive(Debug)]
#[derive(Debug, Serialize, Deserialize)]
pub enum PredStateResult {
Success(Graph),
Error(String),
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/analytics/algo_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use super::algo_result_enums::mincut::MinCutResult;
use super::algo_result_enums::most_sim_timeline::MostSimTResult;
use super::algo_result_enums::pred_state::PredStateResult;
use crate::graph::graph_ds::Graph;
use serde::{Deserialize, Serialize};

/// Stores the results of the algorithms.
///
Expand All @@ -17,7 +18,7 @@ use crate::graph::graph_ds::Graph;
/// * `most_sim_t` - [`crate::state_err_enums::most_sim_timeline::MostSimTResult`] that stores Success/Error/Empty of most similar timeline algorithm.
/// * `pred_state` - [`crate::state_err_enums::pred_state::PredStateResult`] that stores Success/Error/Empty of state prediction algorithm.

#[derive(Clone)]
#[derive(Clone, Serialize, Deserialize)]
pub struct AlgoStore {
pub aps: APResult,
pub mincut: MinCutResult,
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ fn main() {
update_device_config,
update_device_user,
send_waypoint,
get_node_edges
get_node_edges,
run_algorithms
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
Expand Down