rete

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendIdentifiers

func AppendIdentifiers(set1 []model.TupleType, set2 []model.TupleType) []model.TupleType

AppendIdentifiers ... Append identifiers from set2 to set1

func ContainedByFirst

func ContainedByFirst(first []model.TupleType, second []model.TupleType) bool

ContainedByFirst ... true if second is a subset of first

func EqualSets

func EqualSets(first []model.TupleType, second []model.TupleType) bool

EqualSets ... compare two identifiers based on their contents

func GetIndex

func GetIndex(identifiers []model.TupleType, thisIdr model.TupleType) int

GetIndex ... return the index of thisIdr in identifiers

func IntersectionIdentifiers

func IntersectionIdentifiers(first []model.TupleType, second []model.TupleType) []model.TupleType

IntersectionIdentifiers .. intersection of the two sets

func NewRtcModified

func NewRtcModified(tuple model.Tuple) model.RtcModified

func SecondMinusFirst

func SecondMinusFirst(first []model.TupleType, second []model.TupleType) []model.TupleType

SecondMinusFirst ... returns elements in the second that arent in the first

func UnionIdentifiers

func UnionIdentifiers(first []model.TupleType, second []model.TupleType) []model.TupleType

UnionIdentifiers ... union of the first and second sets

func UnionOfOtherTwoContainsAllFromFirst

func UnionOfOtherTwoContainsAllFromFirst(first []model.TupleType, second []model.TupleType, third []model.TupleType) bool

UnionOfOtherTwoContainsAllFromFirst ... true if union of second and third cover all of first

Types

type Network

type Network interface {
	AddRule(rule model.Rule) error
	String() string
	RemoveRule(string) model.Rule
	GetRules() []model.Rule
	//changedProps are the properties that changed in a previous action
	Assert(ctx context.Context, rs model.RuleSession, tuple model.Tuple, changedProps map[string]bool, mode RtcOprn)
	//mode can be one of retract, modify, delete
	Retract(ctx context.Context, tuple model.Tuple, changedProps map[string]bool, mode RtcOprn)

	GetAssertedTuple(key model.TupleKey) model.Tuple
	GetAssertedTupleByStringKey(key string) model.Tuple
	//RtcTransactionHandler
	RegisterRtcTransactionHandler(txnHandler model.RtcTransactionHandler, txnContext interface{})
	ReplayTuplesForRule(ruleName string, rs model.RuleSession) (err error)
	// contains filtered or unexported methods
}

Network ... the rete network

func NewReteNetwork

func NewReteNetwork() Network

NewReteNetwork ... creates a new rete network

type RtcOprn

type RtcOprn int
const (
	ADD RtcOprn = 1 + iota
	RETRACT
	MODIFY
	DELETE
)

Jump to

Keyboard shortcuts

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