更新 providers
This commit is contained in:
@@ -4,6 +4,7 @@ __all__ = [
|
||||
'SM2Algorithm',
|
||||
]
|
||||
|
||||
registry = {
|
||||
algorithms = {
|
||||
"SM-2": SM2Algorithm,
|
||||
"supermemo2": SM2Algorithm,
|
||||
}
|
||||
33
src/heurams/kernel/algorithms/base.py
Normal file
33
src/heurams/kernel/algorithms/base.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import heurams.services.timer as timer
|
||||
from typing import TypedDict
|
||||
|
||||
class BaseAlgorithm:
|
||||
algo_name = "BaseAlgorithm"
|
||||
|
||||
class AlgodataDict(TypedDict):
|
||||
efactor: float
|
||||
real_rept: int
|
||||
rept: int
|
||||
interval: int
|
||||
last_date: int
|
||||
next_date: int
|
||||
is_activated: int
|
||||
last_modify: float
|
||||
|
||||
defaults = {
|
||||
'real_rept': 0,
|
||||
'rept': 0,
|
||||
'interval': 0,
|
||||
'last_date': 0,
|
||||
'next_date': 0,
|
||||
'is_activated': 0,
|
||||
'last_modify': timer.get_timestamp()
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def revisor(cls, algodata: dict, feedback: int = 5, is_new_activation: bool = False):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def is_due(cls, algodata):
|
||||
return 1
|
||||
@@ -1,7 +1,8 @@
|
||||
from .base import BaseAlgorithm
|
||||
import heurams.services.timer as timer
|
||||
from typing import TypedDict
|
||||
|
||||
class SM2Algorithm:
|
||||
class SM2Algorithm(BaseAlgorithm):
|
||||
algo_name = "SM-2"
|
||||
|
||||
class AlgodataDict(TypedDict):
|
||||
|
||||
Reference in New Issue
Block a user