From 2ede9c24104924398b03777a9615ce1071ef86fc Mon Sep 17 00:00:00 2001 From: lvjunjie Date: Thu, 2 Jul 2026 10:38:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=97=A7=E7=89=886=E4=B8=AA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ML/Training/Runner/RunnerIO.cpp | 11 +++-------- ML/Training/Runner/RunnerIO.h | 3 +-- ML/Training/Runner/runner_main.cpp | 4 ++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/ML/Training/Runner/RunnerIO.cpp b/ML/Training/Runner/RunnerIO.cpp index 2c9477c..f0934be 100644 --- a/ML/Training/Runner/RunnerIO.cpp +++ b/ML/Training/Runner/RunnerIO.cpp @@ -87,7 +87,7 @@ namespace RunnerIO std::cerr << "RunnerIO::readParamsBin: header read failed\n"; return false; } - if (magic != MAGIC || (ver != 1 && ver != 2)) + if (magic != MAGIC || ver != 2) { std::cerr << "RunnerIO::readParamsBin: magic/version mismatch\n"; return false; @@ -98,12 +98,7 @@ namespace RunnerIO if (!readDouble(fs, out.wellboreC)) return false; if (!readDouble(fs, out.phi)) return false; if (!readDouble(fs, out.h)) return false; - out.hasCt = false; - out.Ct = 0.0; - if (ver >= 2) { - if (!readDouble(fs, out.Ct)) return false; - out.hasCt = true; - } + if (!readDouble(fs, out.Ct)) return false; if (!readDouble(fs, out.Cf)) return false; out.sectionIndex = 0; @@ -200,4 +195,4 @@ namespace RunnerIO return fs.good(); } -} \ No newline at end of file +} diff --git a/ML/Training/Runner/RunnerIO.h b/ML/Training/Runner/RunnerIO.h index d6cbab2..5cea698 100644 --- a/ML/Training/Runner/RunnerIO.h +++ b/ML/Training/Runner/RunnerIO.h @@ -13,7 +13,6 @@ struct RunnerParams double h; double Ct; double Cf; - bool hasCt; // optional schedule extension uint32_t sectionIndex; // wellFlowSectionIndex @@ -21,7 +20,7 @@ struct RunnerParams std::vector q; // m^3/d RunnerParams() - : k(0), skin(0), wellboreC(0), phi(0), h(0), Ct(0), Cf(0), hasCt(false), sectionIndex(0) + : k(0), skin(0), wellboreC(0), phi(0), h(0), Ct(0), Cf(0), sectionIndex(0) {} }; diff --git a/ML/Training/Runner/runner_main.cpp b/ML/Training/Runner/runner_main.cpp index d3fd401..6d52b24 100644 --- a/ML/Training/Runner/runner_main.cpp +++ b/ML/Training/Runner/runner_main.cpp @@ -130,7 +130,7 @@ static void applySampledParamsAndMaybeOverrideRate(HX_NWTM_MODEL_INPUT& in, cons std::fill(in.Base.k.begin(), in.Base.k.end(), p.k); std::fill(in.Base.phi.begin(), in.Base.phi.end(), p.phi); std::fill(in.Base.h.begin(), in.Base.h.end(), p.h); - if (p.hasCt) in.Base.Cti = p.Ct; + in.Base.Cti = p.Ct; in.Base.Cf = p.Cf; // 制度覆盖:params.bin 带 schedule 才覆盖 @@ -440,4 +440,4 @@ int main(int argc, char** argv) if (hMod_solver) FreeLibrary(hMod_solver); FreeLibrary(hx); return 0; -} \ No newline at end of file +}