Package com.semedy.reasoner.api.builtin
Interface Builtin
- All Known Subinterfaces:
Aggregation,Connector,DirectFilterBuiltin,FilterBuiltin,FunctionalBuiltin,RelationalBuiltin
- All Known Implementing Classes:
AbstractAggregation,AbstractConnector,Alarm,Assert,Assign,BooleanExpression,Builtins1,Builtins2,BuiltinsTest.SuperSimpleBuiltin,CachedConnector,ClassFunctionBuiltin,Code,CollatingCompose,ComparisonBuiltin,ComparisonBuiltin2,ComparisonBuiltinNew,Compose,Compose,Compose,ConcatMany,ConstraintException,ContainsSequence,ContainsSequence2,ContainsSimilar,Cosine2,Cosine3,Count,CountEventsInTime,CountUnique,CreateCircle,CreateCircleWithDistanceUnit,CreateJsonID,CreatePoint,CreatePolygon,CreatePolygon,CreatePolygon2,CreatePolygonFromPoints,Currency,Damerau,Day,Different,DirectBetween,DirectLess,DirectLessOrEqual,Enumerate,Equal,Equals,ExceptionBuiltin,False,FilterA,FilterB,FilterExpression,Formatter,FuzzySearch,GeoSearch,Hamming,In,Increment,Increment,IncrementalFactsBuiltin,INGBuiltin,InstanceFilterBuiltin,InstanceFunctionBuiltin,IsAlive,IsCalendar,IsDouble,IsEqual,IsEqualSet,IsFloat,IsJsonId,IsJsonTopId,IsList,IsNotEqual,IsNotFunctional2,IsNotFunctional3,IsNumber,IsReasoning,IsSet,IsString,IsString,IsSubset,IsType,Jaccard,JaroWinkler,JaroWinkler,JaroWinklerSimilarityBuiltin,JsonIdToString,Letters,Levenshtein,Levenshtein,ListenToPort,ListenToPortSingleValue,LongestCommonSubsequence,MatchBuiltin,MathExpression,Max,Mean,Mean,Min,MoneyTransfer,Month,NGram,NGram3,NGram4,NoneOf,Now,OldSimiliarityBuiltIn,OneOf,Optimal,OptimizedContainsSequence,ParsePoint,PerformanceTest0.ContainsSequence,PerformanceTest0.ContainsWord,PointX,PointY,Predicates,Print,PrintOut,PrintToFile,QGram3,QGram4,Query,RandomBoolean,RandomDuration,RandomEnumeration,RandomInteger,RaspiGpioOut,RaspiGpioOut,ReasonerConnector,ReasonerQuery,RegularExpression,RegularExpression,Retract,Seek,Seek3,Seek4,Seek5,SeekAnd,Select,SelectOne,SendMail,SendMail2,SensorBuiltin,SensorBuiltinSingleValue,Set,SimilarityBuiltin,SimilarityBuiltIn,Sorensondice,SQLiteConnector,Sqrt,Sqrt,StartsWithOneOf,StockPrice,String2Number,SubJsonId,Substitute,Sum,Sum,Sum,SWIFT32a,TestMultiRelational,TestMultiRelationalCached,Text,TextSearch2,TextSearch3,Ticks,Time2MilliSeconds,TimeRaster,ToCSV,ToJSON,Tolerance,ToString,ToType,True,Variance,WeatherBuiltin,WeatherForecast,Week,Window,Year
public interface Builtin
Interface for all built-ins Built-ins may be seen as relations which are computed
by an algorithm.
by an algorithm.
- Author:
- angele
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()frees up allocated resourcesclone the builtinvoidcall back function.String[]get descriptions for the different argumentsintgetArity()get the arity of the builtinget a description for the builtingetName()get the name of the builtingetType()get the type of the builtinlongthe weight of the builtin.voidinitialize the builtinbooleanisEvaluable(BitSet grounds, BitSet variableInstantiations, Object[] args) is builtin evaluable with a certain instantiation of variablesbooleanis it a builtin for internal use onlyobjectGeneratingArguments(BitSet grounds, BitSet variableInstantiations, Object[] args) In which argument position are new objects createdbooleandoes the builtin read the symbol tablevoidsetProperties(Properties prp) set the sytem propertiesvoidsetSymbolTable(SymbolTable symbolTable) set the symbol tablebooleandoes the builtin write into the symbol table
-
Method Details
-
isEvaluable
boolean isEvaluable(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException is builtin evaluable with a certain instantiation of variables- Parameters:
grounds- , which arguments are groundvariableInstantiations- , which variables are instantiatedargs- , the arguments- Returns:
- was it evaluable
- Throws:
BuiltinException
-
init
initialize the builtin- Parameters:
args- , the builtin arguments- Throws:
InterruptedExceptionIOExceptionSemReasonerException
-
evaluationFinished
call back function. Is called when the whole evaluation has been finished- Throws:
BuiltinExceptionInterruptedException
-
setSymbolTable
set the symbol table- Parameters:
symbolTable- , the symbol table
-
setProperties
set the sytem properties- Parameters:
prp- , properties
-
getWeight
the weight of the builtin. Determines when the builtin is executed in a rule- Parameters:
grounds- , ground argumentsvariableInstantiations- , instantiated variablesargs- , arguments of the builtin- Returns:
- the weight of the builtin (influences the position in the rule)
-
objectGeneratingArguments
BitSet objectGeneratingArguments(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException In which argument position are new objects created- Parameters:
grounds- , ground argument positionsvariableInstantiations- , instantiated variablesargs- , arguments of the literal- Returns:
- each bit indicates the argument position where new objects are created
- Throws:
BuiltinException
-
getName
String getName()get the name of the builtin- Returns:
- the name of the built-in
-
getArity
int getArity()get the arity of the builtin- Returns:
- the arity of the built-in
-
getType
BuiltinType getType()get the type of the builtin- Returns:
- the type of the built-in
-
isInternal
boolean isInternal()is it a builtin for internal use only- Returns:
-
getArgumentDescriptions
String[] getArgumentDescriptions()get descriptions for the different arguments- Returns:
- a description of the arguments of the built-in
-
getDescription
String getDescription()get a description for the builtin- Returns:
- a description of the built-in
-
readsSymbolTable
boolean readsSymbolTable()does the builtin read the symbol table- Returns:
- true if it reads the symbol table
-
writesSymbolTable
boolean writesSymbolTable()does the builtin write into the symbol table- Returns:
- true if it writes to the symbol table
-
cloneBuiltin
Builtin cloneBuiltin()clone the builtin- Returns:
- the cloned built-in
-
clear
void clear()frees up allocated resources
-