分离算法
This commit is contained in:
@@ -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):
|
||||
# 导入原子对象
|
||||
@@ -1 +0,0 @@
|
||||
# 轮次编排
|
||||
@@ -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 是原子列表
|
||||
|
||||
Reference in New Issue
Block a user