分离算法

This commit is contained in:
2025-10-23 23:45:40 +08:00
parent 3fef587ff5
commit 809a6dbe75
9 changed files with 181 additions and 81 deletions

View File

@@ -5,7 +5,38 @@ import heurams.services.timer as timer
from typing import Tuple
from .apparatus import Apparatus
class Reactor():
class Core():
"""堆芯: 记忆流程核心状态机"""
def __init__(self, atoms: list, stage = ""):
self.atoms = atoms
self.queue = atoms.copy()
self.current_atom = atoms[0]
self.cursor = 0
def forward(self, step = 1):
self.cursor += step
try:
self.current_atom = self.queue[self.cursor]
return 1 # 成功
except IndexError:
return 0
def append(self, atom):
self.queue.append(self.current_atom)
def __len__(self):
return (len(self.queue) - self.cursor)
def is_empty(self):
return len(self.queue)
class Fission():
"""裂变器: 单原子调度展开器"""
def __init__(self, atom: pt.Atom):
self.atom = atom
atom.register["orbital"]
class Reactork():
"""反应堆对象, 处理和分配一次文件记忆流程的资源与策略"""
def __init__(self, nucleon_file: pt.NucleonUnion, electron_file: pt.ElectronUnion, screen, tasked_num):
# 导入原子对象

View File

@@ -1 +0,0 @@
# 轮次编排

View File

@@ -1,11 +0,0 @@
# 核心流程状态机
import heurams.kernel.particles as pt
import heurams.services.timer as timer
from typing import Tuple
from .apparatus import Apparatus
class Reactor():
def __init__(self, atoms):
# atoms 是原子列表