From 7fc53e41139b0cb8cb91b60d1ae741433eecc91b Mon Sep 17 00:00:00 2001 From: david-ajax Date: Tue, 7 Oct 2025 02:49:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=97=E6=B3=95=E4=B8=8E=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E6=94=B9=E8=BF=9B,=20=E4=BB=A5=E5=8F=8A=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=8E=9F=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metadata.py | 2 +- precache.py => precache_legacy.py | 0 reactor.py | 11 ++++++++--- sync_t.py | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) rename precache.py => precache_legacy.py (100%) create mode 100644 sync_t.py diff --git a/metadata.py b/metadata.py index d7473b1..a6396c1 100644 --- a/metadata.py +++ b/metadata.py @@ -1,3 +1,3 @@ #!/usr/bin/env python3 ver = "0.3.7" -stage = "production" \ No newline at end of file +stage = "prod_rev1" \ No newline at end of file diff --git a/precache.py b/precache_legacy.py similarity index 100% rename from precache.py rename to precache_legacy.py diff --git a/reactor.py b/reactor.py index 8e2483e..68c8010 100644 --- a/reactor.py +++ b/reactor.py @@ -41,7 +41,7 @@ class Glimpse(): class Apparatus(): """反应器对象, 决策一个原子的不同记忆方式, 并反馈到布局""" - def __init__(self, screen, reactor, atom): + def __init__(self, screen, reactor, atom, is_review = 0): self.electron: pt.Electron = atom[0] self.nucleon: pt.Nucleon = atom[1] self.positron: dict = atom[2] @@ -60,7 +60,10 @@ class Apparatus(): self.procession.append(comps.registry[i](screen, reactor, atom)) # self.procession.reverse() random.shuffle(self.procession) - + if self.positron["is_new_activation"] == 0: + self.procession.append(comps.registry['recognition'](screen, reactor, atom)) + if is_review == 1: + self.procession = [self.procession[-2], self.procession[-1]] def iterator(self): yield from self.procession @@ -69,6 +72,7 @@ class Reactor(): """反应堆对象, 处理和分配一次文件记忆流程的资源与策略""" def __init__(self, nucleon_file: pt.NucleonUnion, electron_file: pt.ElectronUnion, screen, tasked_num): # 导入原子对象 + self.stage = 0 self.nucleon_file = nucleon_file self.electron_file = electron_file self.tasked_num = tasked_num @@ -132,6 +136,7 @@ class Reactor(): 2: self.atoms_new, 3: (self.atoms_new + self.atoms_review) } + self.stage = stage ret = 1 if stage == 1 and len(processions[1]) == 0: stage = 2 @@ -163,7 +168,7 @@ class Reactor(): return -1 # 此轮已完成 self.index += step self.current_atom = self.procession[self.index] - self.current_appar = Apparatus(self.screen, self, self.current_atom).iterator() + self.current_appar = Apparatus(self.screen, self, self.current_atom, (self.stage == 1)).iterator() return 0 def save(self): diff --git a/sync_t.py b/sync_t.py new file mode 100644 index 0000000..6adaba9 --- /dev/null +++ b/sync_t.py @@ -0,0 +1 @@ +# 同步工具 原型 \ No newline at end of file