evaluator

package
v5.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLocalRuleEngine

func BuildLocalRuleEngine(engineID string) (*ruleeng.RuleEngine, error)

func CloneEngine

func CloneEngine(engineID string, cloneRuleBase bool, cloneKnowledgeBase bool) (*ruleeng.RuleEngine, error)

CloneEngine inits a new engine based on an existing one

func EvaluateRules

func EvaluateRules(ruleEngine *ruleeng.RuleEngine, knowledgeBase map[string]interface{}, ruleIDs []int64) []ruleeng.Action

func GetEngine

func GetEngine(engineID string) (*ruleeng.RuleEngine, bool)

GetEngine return a specific engine

func InitEngine

func InitEngine(engineID string) error

InitEngine inits an engine if it does not exist

func UpdateEngine

func UpdateEngine(engineID string) error

UpdateEngine updates an engine if it exists

Types

type EvaluatedSituation

type EvaluatedSituation struct {
	ID                 int64
	TS                 time.Time
	TemplateInstanceID int64
	Agenda             []ruleeng.Action
}

EvaluatedSituation represents the evaluation of a situation

type SituationToEvaluate

type SituationToEvaluate struct {
	ID                 int64
	TS                 time.Time
	TemplateInstanceID int64
	Facts              []int64
	Parameters         map[string]string
}

SituationToEvaluate is used to notify a rule engine instance that a situation must me evaluated

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL