Commit Graph

85 Commits

Author SHA1 Message Date
Huamonarch
18a5675109 fix: 子类实现 doMonProc() + 测试 CMake 添加缺失链接文件 2026-05-15 15:51:55 +08:00
Huamonarch
62a2e5568b fix: expression_engine.h 添加 <mix_cc/ihyper_db.h> 以解析 time_range_t 2026-05-15 15:46:37 +08:00
Huamonarch
dc26b6a7dd fix: 将 enum class 类型的 CHECK_EQ 改为 CHECK(==),避免 ostream<< 模板错误 2026-05-15 15:40:24 +08:00
Huamonarch
5a026accaf build: 添加 -Wno-unused-parameter/variable/sign-compare/reorder 减少警告噪音 2026-05-15 15:32:24 +08:00
Huamonarch
2754b7a267 docs: 添加 eqpalg 测试说明文档(77 用例,3 文件,框架使用说明) 2026-05-15 15:25:06 +08:00
Huamonarch
4032ff92ef fix: 将测试文件中 "" include 改为 <> 风格,统一项目规范 2026-05-15 15:22:04 +08:00
Huamonarch
3f10d4dd9f fix: 为 eqpalg_test 添加缺失的 include 路径(legacy/include/ihdb/memcache/iXcom) 2026-05-15 15:19:24 +08:00
Huamonarch
153ce64ae3 docs: 添加 2026-05-15 eqpalg 重构变更文档 2026-05-15 15:04:23 +08:00
Huamonarch
ca2147e499 test: 核心算法单元测试 — LogicAlg/BoundAlg/FeedbackAlg/ExpTimes/FaultCode/Roller3 2026-05-15 14:55:30 +08:00
Huamonarch
032f0d0978 refactor: 切换 build_algorithm 工厂到算法子类 + CMake 更新 2026-05-15 14:42:08 +08:00
Huamonarch
ae7834adaa refactor: 算法子类化 — LogicAlg/BoundAlg/BoundHoldAlg/FeedbackAlg 消除 exp_type_ 分支
将 ExpBase::mon_proc() 中的 exp_type_ 分支逻辑提取为 4 个子类,通过 doMonProc() 虚函数实现多态分发:
- LogicAlg (exp_type 1):实时逻辑判断
- BoundAlg (exp_type 2):监控变量上下限检测
- BoundHoldAlg (exp_type 5):持续超限检测(继承 BoundAlg)
- FeedbackAlg (exp_type 3/4):动作反馈处理

ExpBase 新增纯虚函数 doMonProc() 和钩子函数 doInitExtend(),
init() 和 mon_proc() 中所有类型分支替换为虚函数委托调用。
2026-05-15 14:37:15 +08:00
Huamonarch
4f8eecd828 refactor: 提取 StatCollector 统计学习组件
将 ExpBase::cron_proc() 中的 DAA::STA 统计学习逻辑提取到独立的
StatCollector 工具类,统一管理分布统计的生命周期(样本累积、分布
初始化、DB2 持久化、置信区间更新)。同时将 exec_task() 与
task_mon_pro() 中的任务相关 STA 操作也委托给 StatCollector。

新增:
- eqpalg/utility/stat_collector.h  -- StatCollector 接口
- eqpalg/utility/stat_collector.cpp -- StatCollector 实现

修改:
- eqpalg/algs/exp_base.h  -- 替换 sta_ptr_ 为 stat_collector_
- eqpalg/algs/exp_base.cpp -- cron_proc/reload_ci_dist/reset_dev_data/
                               exec_task/task_mon_pro 委托给 StatCollector
2026-05-15 14:21:36 +08:00
Huamonarch
b9cf5f4e9e refactor: 提取 BoundChecker 上下限检测组件
从 ExpBase 提取 detect_up_down() 逻辑和哨兵值处理至独立的 BoundChecker 类。
将 DetectMode 从 struct 升级为 enum class。
2026-05-15 14:09:56 +08:00
Huamonarch
c4bcb6610b refactor: 删除旧反馈状态方法和标志(已由 FbStateMachine 替代) 2026-05-15 13:57:20 +08:00
Huamonarch
0106e553a0 refactor: 集成 FbStateMachine 到 ExpBase::mon_proc() 2026-05-15 13:36:30 +08:00
Huamonarch
fad4ee8e38 test: FbStateMachine 状态转换单元测试 2026-05-15 13:27:27 +08:00
Huamonarch
9f66fc10b3 feat: FbStateMachine 状态转换 + 变量操作实现 2026-05-15 13:22:16 +08:00
Huamonarch
f2f6d6ffb1 feat: 添加 FbStateMachine 头文件 2026-05-15 13:19:19 +08:00
Huamonarch
e9b2c178ba refactor: 删除 ExpModule 类(已被 ExpressionEngine 替代) 2026-05-15 13:15:05 +08:00
Huamonarch
3f8d281596 fix: 清理 ExpBase 子类中的 exp_act_/exp_feedback_/exp_result_ 残留引用
将 exp_bound、exp_times、exp_sample2D 中对已删除成员的引用替换为
expr_engine_->evaluate()/evaluateBool() 调用。
exp_sample2D 中原来绑定 exp_feedback_ 和 exp_result_ 的 sample_X/sample_Y
表达式现在通过 expr_engine_->registerExpression() 注册。
2026-05-15 13:14:17 +08:00
Huamonarch
38d0942a6c refactor: 非 ExpBase 算法适配 ExpressionEngine API 2026-05-15 13:08:30 +08:00
Huamonarch
7c2fe7f7bb refactor: ExpBase 表达式管理迁移到 ExpressionEngine 2026-05-15 12:59:11 +08:00
Huamonarch
96ca4d02bb refactor: AlgBase 从 ExpModule 迁移到 ExpressionEngine 2026-05-15 12:38:49 +08:00
Huamonarch
f10da49f65 test: ExpressionEngine 单元测试用例 2026-05-15 12:35:31 +08:00
Huamonarch
693d3b5197 feat: ExpressionEngine firstFill + printVars 实现 2026-05-15 12:32:20 +08:00
Huamonarch
e575efdc8a feat: ExpressionEngine FunVars 控制 + hold 变量管理 2026-05-15 12:30:11 +08:00
Huamonarch
50173683db feat: ExpressionEngine 变量刷新实现(MEMORY + IHDB) 2026-05-15 12:27:58 +08:00
Huamonarch
da9eb2ea2e feat: ExpressionEngine 核心实现(注册 + 求值) 2026-05-15 12:25:30 +08:00
Huamonarch
2f7ca1e123 feat: 添加 ExpressionEngine 头文件声明 2026-05-15 12:17:27 +08:00
Huamonarch
ec8e44ce5d test: 为 eqpalg 添加测试基础设施(test_harness + test_main) 2026-05-15 12:15:14 +08:00
Huamonarch
1ff51483e7 在 .gitignore 中添加 Claude Code 相关条目(.claude/、CLAUDE.md) 2026-05-15 09:14:56 +08:00
Huamonarch
65863b326f 为 RNG 模块添加 CTest 单元测试,覆盖常量/线性/漂移/正弦/复合/布尔/注册表/阀对等模型 2026-05-15 09:14:02 +08:00
Huamonarch
b99cd0a73c Add change documentation for 2026-05-13 eqpalg fixes and optimizations
Covers 9 commits: TaskRecord compile fixes, dual-layer ShmSpinLock,
rm -rf cleanup, update_cold handshake fix, ExpTimes DB robustness
and async persistence with AsyncDbWorker.
2026-05-13 17:10:09 +08:00
Huamonarch
672412e5a8 docs: add RNG changelog documenting all 2026-05-13 changes 2026-05-13 17:07:41 +08:00
Huamonarch
1e781a7c03 feat: add ! negation operator for boolean models
Prefix any boolean model reference with ! to negate its output.
Works with all boolean models: !toggle_2s, !valve_px_std:toggle_2s, !bool_50, etc.
2026-05-13 16:56:30 +08:00
Huamonarch
e4233cc23d fix: add period_ms to linear and drift models to prevent unbounded divergence
Without period, y=k*t+b and y=base+drift_rate*t grow infinitely, which is
unrealistic for industrial simulation. period_ms makes t wrap modulo the period,
producing sawtooth patterns that simulate per-cycle behavior (e.g. tension build-up
per coil, sensor drift per shift).
2026-05-13 16:34:00 +08:00
Huamonarch
256aa07c1c docs: add comprehensive RNG project README 2026-05-13 16:14:42 +08:00
Huamonarch
47dd4fad4b fix: qualify is_same_v with std:: in FlowData constructor 2026-05-13 16:02:27 +08:00
Huamonarch
f41ce0c40f fix: GuassRand use sigma as stddev directly instead of sqrt(sigma) 2026-05-13 15:53:25 +08:00
Huamonarch
5ee17627e9 fix: address code review issues
- read_csv.hpp: replace std::exit(1) with std::runtime_error throw
- read_csv.hpp: remove duplicate #pragma once
- RNG.cc: wrap JSON load in try-catch to prevent crash on missing config
- Generator.cc: fix comments to reflect actual 3-pass structure
2026-05-13 15:46:06 +08:00
Huamonarch
d9b4ee8eb3 fix: prevent ValvePairModel stuck-state by freezing prev_action during delay 2026-05-13 15:43:56 +08:00
Huamonarch
10bb9937d6 chore: remove unused BaseData.h 2026-05-13 15:33:36 +08:00
Huamonarch
7385b7cc6e build: add model/ source directory to CMake 2026-05-13 15:27:22 +08:00
Huamonarch
022993ab5a feat: load rng_models.json on startup 2026-05-13 15:26:19 +08:00
Huamonarch
4821cb9d36 refactor: replace hardcoded signal mappings with ModelRegistry 2026-05-13 15:24:32 +08:00
Huamonarch
b4bb27f1e5 feat: add ModelRegistry with JSON loading and composite model
Add CompositeModel for combining base+noise models, ModelRegistry singleton
with JSON-based model template loading, per-instance-key model isolation,
and inline CSV/valve pair/composite syntax parsing in createModel.
2026-05-13 15:20:51 +08:00
Huamonarch
4f83e41c0c feat: add ValvePairModel with jitter/flash/over-delay 2026-05-13 15:15:14 +08:00
Huamonarch
3ce03911c3 feat: add 3 boolean signal models 2026-05-13 15:13:31 +08:00
Huamonarch
2ef663af81 feat: add CsvReplayModel for CSV data replay 2026-05-13 15:12:04 +08:00
Huamonarch
afd753f803 feat: add 7 analog signal models (constant, normal, linear, sine, uniform, spike, drift) 2026-05-13 15:10:37 +08:00