算法与交互改进, 以及同步原型

This commit is contained in:
2025-10-07 02:49:26 +08:00
parent 06c62e284d
commit 7fc53e4113
4 changed files with 10 additions and 4 deletions

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
ver = "0.3.7" ver = "0.3.7"
stage = "production" stage = "prod_rev1"

View File

@@ -41,7 +41,7 @@ class Glimpse():
class Apparatus(): class Apparatus():
"""反应器对象, 决策一个原子的不同记忆方式, 并反馈到布局""" """反应器对象, 决策一个原子的不同记忆方式, 并反馈到布局"""
def __init__(self, screen, reactor, atom): def __init__(self, screen, reactor, atom, is_review = 0):
self.electron: pt.Electron = atom[0] self.electron: pt.Electron = atom[0]
self.nucleon: pt.Nucleon = atom[1] self.nucleon: pt.Nucleon = atom[1]
self.positron: dict = atom[2] self.positron: dict = atom[2]
@@ -60,7 +60,10 @@ class Apparatus():
self.procession.append(comps.registry[i](screen, reactor, atom)) self.procession.append(comps.registry[i](screen, reactor, atom))
# self.procession.reverse() # self.procession.reverse()
random.shuffle(self.procession) 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): def iterator(self):
yield from self.procession yield from self.procession
@@ -69,6 +72,7 @@ class Reactor():
"""反应堆对象, 处理和分配一次文件记忆流程的资源与策略""" """反应堆对象, 处理和分配一次文件记忆流程的资源与策略"""
def __init__(self, nucleon_file: pt.NucleonUnion, electron_file: pt.ElectronUnion, screen, tasked_num): def __init__(self, nucleon_file: pt.NucleonUnion, electron_file: pt.ElectronUnion, screen, tasked_num):
# 导入原子对象 # 导入原子对象
self.stage = 0
self.nucleon_file = nucleon_file self.nucleon_file = nucleon_file
self.electron_file = electron_file self.electron_file = electron_file
self.tasked_num = tasked_num self.tasked_num = tasked_num
@@ -132,6 +136,7 @@ class Reactor():
2: self.atoms_new, 2: self.atoms_new,
3: (self.atoms_new + self.atoms_review) 3: (self.atoms_new + self.atoms_review)
} }
self.stage = stage
ret = 1 ret = 1
if stage == 1 and len(processions[1]) == 0: if stage == 1 and len(processions[1]) == 0:
stage = 2 stage = 2
@@ -163,7 +168,7 @@ class Reactor():
return -1 # 此轮已完成 return -1 # 此轮已完成
self.index += step self.index += step
self.current_atom = self.procession[self.index] 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 return 0
def save(self): def save(self):

1
sync_t.py Normal file
View File

@@ -0,0 +1 @@
# 同步工具 原型