This commit is contained in:
2025-04-25 00:04:11 -04:00
parent 5724746467
commit 77b91a8140
7 changed files with 45 additions and 26 deletions

View File

@@ -30,7 +30,7 @@ tokio-rustls = "0.24"
# Bellande Architecture
bellande_step = "0.1.1"
bellande_limit = "0.1.1"
bellande_limit = "0.1.2"
bellande_node_importance = "0.1.0"
bellande_particle = "0.1.1"
bellande_probability = "0.1.1"

View File

@@ -12,3 +12,6 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::algorithm::connections::BellandeArchError;
use bellande_limit::make_bellande_limit_request;

View File

@@ -13,33 +13,11 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::algorithm::connections::BellandeArchError;
use bellande_step::make_bellande_step_request;
use futures::future::join_all;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::fmt;
/// Error types specific to this library
#[derive(Debug)]
pub enum BellandeArchError {
DimensionMismatch(String),
InvalidCoordinates(String),
AlgorithmError(String),
NetworkError(String),
}
impl fmt::Display for BellandeArchError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
BellandeArchError::DimensionMismatch(msg) => write!(f, "Dimension mismatch: {}", msg),
BellandeArchError::InvalidCoordinates(msg) => write!(f, "Invalid coordinates: {}", msg),
BellandeArchError::AlgorithmError(msg) => write!(f, "Algorithm error: {}", msg),
BellandeArchError::NetworkError(msg) => write!(f, "Network error: {}", msg),
}
}
}
impl std::error::Error for BellandeArchError {}
/// Configuration for spatial coordinate transformation
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -120,7 +98,7 @@ impl SpatialTransformer {
}
/// Process the raw Bellande Step result into our domain-specific format
fn process_result(result: Value) -> Result<TransformationResult, BellandeArchError> {
pub fn process_result(result: Value) -> Result<TransformationResult, BellandeArchError> {
// Extract the path data from the result
let path = result
.get("path")
@@ -227,7 +205,7 @@ impl SpatialTransformer {
}
/// Advanced path optimization that handles obstacles
async fn optimize_path_with_obstacles(
pub async fn optimize_path_with_obstacles(
config: SpatialTransformConfig,
obstacles: Vec<Vec<f64>>,
) -> Result<TransformationResult, BellandeArchError> {

View File

@@ -0,0 +1,36 @@
// Copyright (C) 2025 Bellande Architecture Mechanism Research Innovation Center, Ronaldson Bellande
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use std::fmt;
/// Error types specific to this library
#[derive(Debug)]
pub enum BellandeArchError {
DimensionMismatch(String),
InvalidCoordinates(String),
AlgorithmError(String),
NetworkError(String),
}
impl fmt::Display for BellandeArchError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
BellandeArchError::DimensionMismatch(msg) => write!(f, "Dimension mismatch: {}", msg),
BellandeArchError::InvalidCoordinates(msg) => write!(f, "Invalid coordinates: {}", msg),
BellandeArchError::AlgorithmError(msg) => write!(f, "Algorithm error: {}", msg),
BellandeArchError::NetworkError(msg) => write!(f, "Network error: {}", msg),
}
}
}

View File

@@ -20,3 +20,4 @@ pub mod bellande_probability;
pub mod bellande_segment;
pub mod bellande_step;
pub mod bellande_tree;
pub mod connections;

0
src/mesh/connections.rs Normal file
View File

View File

@@ -1 +1,2 @@
pub mod connections;
pub mod mesh;