观察者 线段分析/扩展分析 支持无限递归,保留之前序列为@property 形式

This commit is contained in:
YuWuKunCheng
2026-06-06 22:02:47 +08:00
parent dd40f95742
commit 0a7e9dc896
3 changed files with 46 additions and 9 deletions
+10 -5
View File
@@ -26,6 +26,7 @@ use crate::structure::dash_line::虚线;
use crate::structure::feat_fractal::;
use crate::structure::fractal_obj::;
use crate::types::{, };
use std::sync::atomic::AtomicI64;
use std::sync::atomic::Ordering;
use std::sync::{Arc, RwLock};
@@ -48,7 +49,7 @@ use std::sync::{Arc, RwLock};
#[derive(Debug)]
pub struct 线 {
/// 特征序列元素编号
pub : i64,
pub : AtomicI64,
/// 标识字符串(如 "特征<虚线>"
pub : RwLock<String>,
/// 所属线段的方向
@@ -60,7 +61,7 @@ pub struct 线段特征 {
impl Clone for 线 {
fn clone(&self) -> Self {
Self {
: self.,
: AtomicI64::new(self..load(Ordering::Relaxed)),
: RwLock::new(self..read().unwrap().clone()),
线: self.线,
: self..clone(),
@@ -72,7 +73,7 @@ impl 线段特征 {
/// 新建线段特征(给定标识、基础序列和线段方向)
pub fn new(: String, : Vec<Arc<线>>, 线: ) -> Self {
Self {
: 0,
: AtomicI64::new(0),
: RwLock::new(),
线,
,
@@ -319,10 +320,14 @@ impl 线段特征 {
/// 结构化相等校验 — 逐项递归校验基础序列中的虚线,返回 (是否相等, 差异描述)
pub fn (&self, other: &Self, : f64) -> (bool, String) {
if self. != other. {
if self..load(Ordering::Relaxed) != other..load(Ordering::Relaxed) {
return (
false,
format!("线段特征: [序号] 不等 A={},B={}", self., other.),
format!(
"线段特征: [序号] 不等 A={},B={}",
self..load(Ordering::Relaxed),
other..load(Ordering::Relaxed)
),
);
}
if *self..read().unwrap() != *other..read().unwrap() {