Implemented a first and basic version of a Rete rule engine

This commit is contained in:
2021-02-09 16:06:32 +01:00
parent 821dbed189
commit a2a8d5c5e5
110 changed files with 7301 additions and 1654 deletions
+8 -2
View File
@@ -1,6 +1,6 @@
from dataclasses import dataclass
from core.global_symbols import NotFound
from core.global_symbols import NotFound, ErrorObj
from core.utils import sheerka_deepcopy
@@ -14,8 +14,9 @@ class BaseService:
Base class for services
"""
def __init__(self, sheerka):
def __init__(self, sheerka, order=999):
self.sheerka = sheerka
self.order = order # initialisation order. The lowest is initialized first
def initialize(self):
"""
@@ -46,3 +47,8 @@ class BaseService:
Store/record the value of an attribute
"""
self.sheerka.record_var(context, self.NAME, var_name, getattr(self, var_name))
@dataclass()
class FailedToCompileError(Exception, ErrorObj):
cause: list