fix: 变更哈希注册表以修复重复键造成的崩溃
This commit is contained in:
@@ -8,7 +8,7 @@ logger = get_logger(__name__)
|
||||
|
||||
class BaseAlgorithm:
|
||||
algo_name = "BaseAlgorithm"
|
||||
|
||||
desc = '算法基类'
|
||||
class AlgodataDict(TypedDict):
|
||||
real_rept: int
|
||||
rept: int
|
||||
|
||||
@@ -10,7 +10,7 @@ logger = get_logger(__name__)
|
||||
|
||||
class FAST0Algorithm(BaseAlgorithm):
|
||||
algo_name = "FAST-0"
|
||||
|
||||
desc = '快速筛选用特殊调度器'
|
||||
class AlgodataDict(TypedDict):
|
||||
real_rept: int
|
||||
rept: int
|
||||
|
||||
@@ -10,7 +10,7 @@ logger = get_logger(__name__)
|
||||
|
||||
class SM2Algorithm(BaseAlgorithm):
|
||||
algo_name = "SM-2"
|
||||
|
||||
desc = '经典间隔重复算法'
|
||||
class AlgodataDict(TypedDict):
|
||||
efactor: float
|
||||
real_rept: int
|
||||
|
||||
@@ -71,7 +71,8 @@ class Fission(Machine):
|
||||
"alia": item,
|
||||
}
|
||||
)
|
||||
self.current_puzzle_inf = self.puzzles_inf[0]
|
||||
if self.puzzles_inf:
|
||||
self.current_puzzle_inf = self.puzzles_inf[0]
|
||||
|
||||
for i in range(len(self.puzzles_inf)):
|
||||
self.min_ratings.append(float('inf'))
|
||||
@@ -94,12 +95,14 @@ class Fission(Machine):
|
||||
return self.current_puzzle_inf
|
||||
|
||||
def report(self, rating):
|
||||
self.min_ratings[self.cursor] = min(rating, self.min_ratings[self.cursor])
|
||||
if self.puzzles_inf:
|
||||
self.min_ratings[self.cursor] = min(rating, self.min_ratings[self.cursor])
|
||||
|
||||
def get_quality(self):
|
||||
if self.is_state("retronly", self):
|
||||
return reduce(lambda x, y: min(x, y), self.min_ratings)
|
||||
raise IndexError
|
||||
if self.puzzles_inf:
|
||||
if self.is_state("retronly", self):
|
||||
return reduce(lambda x, y: min(x, y), self.min_ratings)
|
||||
raise IndexError
|
||||
|
||||
def forward(self, step=1):
|
||||
"""将谜题指针向前移动并依情况更新或完成"""
|
||||
|
||||
Reference in New Issue
Block a user