update
This commit is contained in:
@@ -30,7 +30,7 @@ tokio-rustls = "0.24"
|
|||||||
|
|
||||||
# Bellande Architecture
|
# Bellande Architecture
|
||||||
bellande_step = "0.1.1"
|
bellande_step = "0.1.1"
|
||||||
bellande_limit = "0.1.1"
|
bellande_limit = "0.1.2"
|
||||||
bellande_node_importance = "0.1.0"
|
bellande_node_importance = "0.1.0"
|
||||||
bellande_particle = "0.1.1"
|
bellande_particle = "0.1.1"
|
||||||
bellande_probability = "0.1.1"
|
bellande_probability = "0.1.1"
|
||||||
|
@@ -12,3 +12,6 @@
|
|||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
use crate::algorithm::connections::BellandeArchError;
|
||||||
|
use bellande_limit::make_bellande_limit_request;
|
||||||
|
@@ -13,33 +13,11 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// 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 bellande_step::make_bellande_step_request;
|
||||||
use futures::future::join_all;
|
use futures::future::join_all;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_json::Value;
|
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
|
/// Configuration for spatial coordinate transformation
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
@@ -120,7 +98,7 @@ impl SpatialTransformer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Process the raw Bellande Step result into our domain-specific format
|
/// 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
|
// Extract the path data from the result
|
||||||
let path = result
|
let path = result
|
||||||
.get("path")
|
.get("path")
|
||||||
@@ -227,7 +205,7 @@ impl SpatialTransformer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Advanced path optimization that handles obstacles
|
/// Advanced path optimization that handles obstacles
|
||||||
async fn optimize_path_with_obstacles(
|
pub async fn optimize_path_with_obstacles(
|
||||||
config: SpatialTransformConfig,
|
config: SpatialTransformConfig,
|
||||||
obstacles: Vec<Vec<f64>>,
|
obstacles: Vec<Vec<f64>>,
|
||||||
) -> Result<TransformationResult, BellandeArchError> {
|
) -> Result<TransformationResult, BellandeArchError> {
|
||||||
|
36
src/algorithm/connections.rs
Normal file
36
src/algorithm/connections.rs
Normal 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),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -20,3 +20,4 @@ pub mod bellande_probability;
|
|||||||
pub mod bellande_segment;
|
pub mod bellande_segment;
|
||||||
pub mod bellande_step;
|
pub mod bellande_step;
|
||||||
pub mod bellande_tree;
|
pub mod bellande_tree;
|
||||||
|
pub mod connections;
|
||||||
|
0
src/mesh/connections.rs
Normal file
0
src/mesh/connections.rs
Normal file
@@ -1 +1,2 @@
|
|||||||
|
pub mod connections;
|
||||||
pub mod mesh;
|
pub mod mesh;
|
||||||
|
Reference in New Issue
Block a user