rete

package
v0.0.0-...-220c311 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLASS_NAME = iota
	IDENTIFIER
	ATTRIBUTE
	VALUE
	NO_TEST
)
View Source
const (
	BETA_MEMORY_NODE = "beta_memory"
	JOIN_NODE        = "join_node"
	NEGATIVE_NODE    = "negative_node"
	NCC_NODE         = "ncc_node"
	NCC_PARTNER_NODE = "ncc_parter_node"
	FILTER_NODE      = "filter_node"
)

Variables

Functions

func Eval

func Eval(exp ast.Expr, env Env) (result []reflect.Value, err error)

func EvalBinaryExpr

func EvalBinaryExpr(exp *ast.BinaryExpr, env map[string]interface{}) (result []reflect.Value, err error)

func EvalCall

func EvalCall(exp *ast.CallExpr, env Env) (result []reflect.Value, err error)

func EvalFromString

func EvalFromString(s string, env Env) (result []reflect.Value, err error)

func EvalIdent

func EvalIdent(exp *ast.Ident, env Env) (result []reflect.Value, err error)

func RemoveWME

func RemoveWME(w *WME)

Types

type AlphaMemory

type AlphaMemory struct {
	// contains filtered or unexported fields
}

type BetaMemory

type BetaMemory struct {
	RHS *RHS
	// contains filtered or unexported fields
}

func (BetaMemory) GetChildren

func (node BetaMemory) GetChildren() *list.List

func (BetaMemory) GetExecuteParam

func (node BetaMemory) GetExecuteParam(s string) interface{}

func (BetaMemory) GetItems

func (node BetaMemory) GetItems() *list.List

func (BetaMemory) GetNodeType

func (node BetaMemory) GetNodeType() string

func (BetaMemory) GetParent

func (node BetaMemory) GetParent() IReteNode

func (*BetaMemory) LeftActivation

func (node *BetaMemory) LeftActivation(t *Token, w *WME, b Env)

func (BetaMemory) PopToken

func (node BetaMemory) PopToken() *Token

func (BetaMemory) RightActivation

func (node BetaMemory) RightActivation(w *WME)

type ConstantTestNode

type ConstantTestNode struct {
	// contains filtered or unexported fields
}

type Env

type Env map[string]interface{}

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

type FilterNode

type FilterNode struct {
	// contains filtered or unexported fields
}

func (FilterNode) GetChildren

func (node FilterNode) GetChildren() *list.List

func (FilterNode) GetItems

func (node FilterNode) GetItems() *list.List

func (FilterNode) GetNodeType

func (node FilterNode) GetNodeType() string

func (FilterNode) GetParent

func (node FilterNode) GetParent() IReteNode

func (*FilterNode) LeftActivation

func (node *FilterNode) LeftActivation(t *Token, w *WME, b Env)

func (*FilterNode) RightActivation

func (node *FilterNode) RightActivation(w *WME)

type Has

type Has struct {
	// contains filtered or unexported fields
}

func NewHas

func NewHas(class_name, id, attr, value string) Has

func NewNeg

func NewNeg(class_name, id, attr, value string) Has

type IReteNode

type IReteNode interface {
	GetNodeType() string
	GetItems() *list.List
	GetParent() IReteNode
	GetChildren() *list.List
	LeftActivation(t *Token, w *WME, b Env)
	RightActivation(w *WME)
}

type JoinNode

type JoinNode struct {
	// contains filtered or unexported fields
}

func (JoinNode) GetChildren

func (node JoinNode) GetChildren() *list.List

func (JoinNode) GetItems

func (node JoinNode) GetItems() *list.List

func (JoinNode) GetNodeType

func (node JoinNode) GetNodeType() string

func (JoinNode) GetParent

func (node JoinNode) GetParent() IReteNode

func (*JoinNode) LeftActivation

func (node *JoinNode) LeftActivation(t *Token, w *WME, b Env)

func (*JoinNode) RightActivation

func (node *JoinNode) RightActivation(w *WME)

type LHS

type LHS struct {
	// contains filtered or unexported fields
}

func JSONParseLHS

func JSONParseLHS(lhs []interface{}) (r LHS, err error)

func NewLHS

func NewLHS(items ...interface{}) LHS

func NewNccRule

func NewNccRule(items ...interface{}) LHS

func XMLParseLHS

func XMLParseLHS(root *etree.Element) LHS

type NccNode

type NccNode struct {
	// contains filtered or unexported fields
}

func (NccNode) GetChildren

func (node NccNode) GetChildren() *list.List

func (NccNode) GetItems

func (node NccNode) GetItems() *list.List

func (NccNode) GetNodeType

func (node NccNode) GetNodeType() string

func (NccNode) GetParent

func (node NccNode) GetParent() IReteNode

func (NccNode) LeftActivation

func (node NccNode) LeftActivation(t *Token, w *WME, b Env)

func (NccNode) RightActivation

func (node NccNode) RightActivation(w *WME)

type NccPartnerNode

type NccPartnerNode struct {
	// contains filtered or unexported fields
}

func (NccPartnerNode) GetChildren

func (node NccPartnerNode) GetChildren() *list.List

func (NccPartnerNode) GetItems

func (node NccPartnerNode) GetItems() *list.List

func (NccPartnerNode) GetNodeType

func (node NccPartnerNode) GetNodeType() string

func (NccPartnerNode) GetParent

func (node NccPartnerNode) GetParent() IReteNode

func (NccPartnerNode) LeftActivation

func (node NccPartnerNode) LeftActivation(t *Token, w *WME, b Env)

func (NccPartnerNode) RightActivation

func (node NccPartnerNode) RightActivation(w *WME)

type NegativeJoinResult

type NegativeJoinResult struct {
	// contains filtered or unexported fields
}

type NegativeNode

type NegativeNode struct {
	// contains filtered or unexported fields
}

func (*NegativeNode) GetChildren

func (node *NegativeNode) GetChildren() *list.List

func (NegativeNode) GetItems

func (node NegativeNode) GetItems() *list.List

func (NegativeNode) GetNodeType

func (node NegativeNode) GetNodeType() string

func (NegativeNode) GetParent

func (node NegativeNode) GetParent() IReteNode

func (*NegativeNode) LeftActivation

func (node *NegativeNode) LeftActivation(t *Token, w *WME, b Env)

func (*NegativeNode) RightActivation

func (node *NegativeNode) RightActivation(w *WME)

type Network

type Network struct {
	PNodes []*BetaMemory

	LogBuf *bytes.Buffer
	// contains filtered or unexported fields
}

func NewNetwork

func NewNetwork() *Network

func (*Network) AddObject

func (n *Network) AddObject(key string, obj interface{})

func (*Network) AddProduction

func (n *Network) AddProduction(lhs LHS, rhs RHS) *BetaMemory

func (*Network) AddProductionFromXML

func (n *Network) AddProductionFromXML(s string) (result []*BetaMemory, err error)

func (*Network) AddWME

func (n *Network) AddWME(w *WME)

func (*Network) ExecuteRules

func (n *Network) ExecuteRules(env Env) (err error)

func (Network) GetObject

func (n Network) GetObject(key string) interface{}

func (Network) GetObjects

func (n Network) GetObjects() Env

func (*Network) Halt

func (n *Network) Halt()

type Production

type Production struct {
	// contains filtered or unexported fields
}

func FromJSON

func FromJSON(s string) (r []Production, err error)

func FromXML

func FromXML(s string) (result []Production, err error)

type RHS

type RHS struct {
	Extra map[string]interface{}
	// contains filtered or unexported fields
}

func NewRHS

func NewRHS() RHS

type TestAtJoinNode

type TestAtJoinNode struct {
	// contains filtered or unexported fields
}

type Token

type Token struct {
	// contains filtered or unexported fields
}

func (*Token) AllBinding

func (tok *Token) AllBinding() Env

func (*Token) GetBinding

func (tok *Token) GetBinding(k string) interface{}

func (*Token) GetRHSParam

func (tok *Token) GetRHSParam(k string) interface{}

func (Token) String

func (tok Token) String() string

type WME

type WME struct {
	// contains filtered or unexported fields
}

func NewWME

func NewWME(class_name, id, attr, value string) *WME

func (*WME) Equal

func (wme *WME) Equal(w *WME) bool

func (*WME) String

func (wme *WME) String() string

Jump to

Keyboard shortcuts

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