This commit is contained in:
2025-10-26 11:33:08 +08:00
parent 809a6dbe75
commit 98f225efe4
13 changed files with 95 additions and 57 deletions

View File

@@ -1,32 +0,0 @@
# 单个原子处理器
import heurams.kernel.particles as pt
import typing
class Apparatus():
"""反应器对象, 决策一个原子的不同记忆方式, 并反馈到布局"""
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]
self.testdata = self.positron["testdata"]
self.procession: typing.List[comps.Composition] = list()
if self.positron["is_new_activation"] == 1:
self.positron["is_new_activation"] = 0
self.procession.append(comps.registry["recognition"](screen, reactor, atom))
return
for i in self.positron["testdata"].keys():
if i == "additional_inf":
continue
if i == "fill_blank_test": # 加深
self.procession.append(comps.registry[i](screen, reactor, atom))
# self.procession.append(comps.registry[i](screen, reactor, atom))
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

View File

@@ -3,15 +3,15 @@
import heurams.kernel.particles as pt
import heurams.services.timer as timer
from typing import Tuple
from .apparatus import Apparatus
class Core():
"""堆芯: 记忆流程核心状态机"""
def __init__(self, atoms: list, stage = ""):
class Procession():
"""队列: 记忆流程核心状态机"""
def __init__(self, atoms: list, phase: str = ""):
self.atoms = atoms
self.queue = atoms.copy()
self.current_atom = atoms[0]
self.cursor = 0
self.phase = phase
def forward(self, step = 1):
self.cursor += step
@@ -21,8 +21,11 @@ class Core():
except IndexError:
return 0
def append(self, atom):
self.queue.append(self.current_atom)
def append(self, atom = None):
if atom == None:
self.queue.append(self.current_atom)
else:
self.queue.append(atom)
def __len__(self):
return (len(self.queue) - self.cursor)
@@ -32,9 +35,13 @@ class Core():
class Fission():
"""裂变器: 单原子调度展开器"""
def __init__(self, atom: pt.Atom):
def __init__(self, atom: pt.Atom, stage = ""):
self.atom = atom
atom.register["orbital"]
atom.register["orbital"]["puzzle_config"]
class Phaser():
"""移相器: 全局调度阶段管理器"""
class Reactork():
"""反应堆对象, 处理和分配一次文件记忆流程的资源与策略"""