engine

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GruleEngine

type GruleEngine struct {
	MaxCycle uint64
	// contains filtered or unexported fields
}

GruleEngine is the engine structure. It has the Execute method to start the engine to work.

func NewGruleEngine

func NewGruleEngine() *GruleEngine

NewGruleEngine will create new instance of GruleEngine struct. It will set the max cycle to 5000

func (*GruleEngine) Execute

func (g *GruleEngine) Execute(dataCtx *ast.DataContext, knowledge *ast.KnowledgeBase, memory *ast.WorkingMemory) error

Execute function will execute a knowledge evaluation and action against data context. The engine also do conflict resolution of which rule to execute.

func (*GruleEngine) Subscribe

func (g *GruleEngine) Subscribe(f func(*ast.RuleEntry))

Subscribe adds custom func to subscribers slice

Jump to

Keyboard shortcuts

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