Class TestMultiRelationalCached
java.lang.Object
com.semedy.reasoner.api.builtin.CachedConnector
com.semedy.reasoner.builtin.connector.TestMultiRelationalCached
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
frees up allocated resourcesclone the builtinvoid
call back function.String[]
get descriptions for the different argumentsint
getArity()
get the arity of the builtinget a description for the builtingetName()
get the name of the builtingetType()
get the type of the builtinlong
the weight of the builtin.void
initialize the builtinvoid
input
(long[] input) Feed the built-in with an input tuple.boolean
isEvaluable
(BitSet grounds, BitSet variableInstantiations, Object[] args) is builtin evaluable with a certain instantiation of variablesboolean
is it a builtin for internal use onlyobjectGeneratingArguments
(BitSet grounds, BitSet variableInstantiations, Object[] args) In which argument position are new objects createdboolean
does the builtin read the symbol tablevoid
setProperties
(Properties prp) set the sytem propertiesvoid
setSymbolTable
(SymbolTable symbolTable) set the symbol tablevoid
start
(BitSet grounds, BuiltinReceiver receiver) Start feeding the built-in with input values.void
stop()
stop feeding the built-in with input valuesboolean
does the builtin write into the symbol table
-
Constructor Details
-
TestMultiRelationalCached
public TestMultiRelationalCached()
-
-
Method Details
-
isEvaluable
public boolean isEvaluable(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException Description copied from interface:Builtin
is builtin evaluable with a certain instantiation of variables- Specified by:
isEvaluable
in interfaceBuiltin
- Specified by:
isEvaluable
in classCachedConnector
- Parameters:
grounds
- , which arguments are groundvariableInstantiations
- , which variables are instantiatedargs
- , the arguments- Returns:
- was it evaluable
- Throws:
BuiltinException
-
setProperties
Description copied from interface:Builtin
set the sytem properties- Specified by:
setProperties
in interfaceBuiltin
- Specified by:
setProperties
in classCachedConnector
- Parameters:
prp
- , properties
-
init
Description copied from interface:Builtin
initialize the builtin- Specified by:
init
in interfaceBuiltin
- Specified by:
init
in classCachedConnector
- Parameters:
args
- , the builtin arguments
-
evaluationFinished
Description copied from interface:Builtin
call back function. Is called when the whole evaluation has been finished- Specified by:
evaluationFinished
in interfaceBuiltin
- Overrides:
evaluationFinished
in classCachedConnector
- Throws:
BuiltinException
InterruptedException
-
setSymbolTable
Description copied from interface:Builtin
set the symbol table- Specified by:
setSymbolTable
in interfaceBuiltin
- Specified by:
setSymbolTable
in classCachedConnector
- Parameters:
symbolTable
- , the symbol table
-
getWeight
Description copied from interface:Builtin
the weight of the builtin. Determines when the builtin is executed in a rule- Specified by:
getWeight
in interfaceBuiltin
- Specified by:
getWeight
in classCachedConnector
- Parameters:
grounds
- , ground argumentsvariableInstantiations
- , instantiated variablesargs
- , arguments of the builtin- Returns:
- the weight of the builtin (influences the position in the rule)
-
objectGeneratingArguments
public BitSet objectGeneratingArguments(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException Description copied from interface:Builtin
In which argument position are new objects created- Specified by:
objectGeneratingArguments
in interfaceBuiltin
- Specified by:
objectGeneratingArguments
in classCachedConnector
- 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
Description copied from interface:Builtin
get the name of the builtin- Specified by:
getName
in interfaceBuiltin
- Specified by:
getName
in classCachedConnector
- Returns:
- the name of the built-in
-
getArity
public int getArity()Description copied from interface:Builtin
get the arity of the builtin- Specified by:
getArity
in interfaceBuiltin
- Specified by:
getArity
in classCachedConnector
- Returns:
- the arity of the built-in
-
getType
Description copied from interface:Builtin
get the type of the builtin- Specified by:
getType
in interfaceBuiltin
- Specified by:
getType
in classCachedConnector
- Returns:
- the type of the built-in
-
isInternal
public boolean isInternal()Description copied from interface:Builtin
is it a builtin for internal use only- Specified by:
isInternal
in interfaceBuiltin
- Specified by:
isInternal
in classCachedConnector
- Returns:
-
getArgumentDescriptions
Description copied from interface:Builtin
get descriptions for the different arguments- Specified by:
getArgumentDescriptions
in interfaceBuiltin
- Specified by:
getArgumentDescriptions
in classCachedConnector
- Returns:
- a description of the arguments of the built-in
-
getDescription
Description copied from interface:Builtin
get a description for the builtin- Specified by:
getDescription
in interfaceBuiltin
- Specified by:
getDescription
in classCachedConnector
- Returns:
- a description of the built-in
-
readsSymbolTable
public boolean readsSymbolTable()Description copied from interface:Builtin
does the builtin read the symbol table- Specified by:
readsSymbolTable
in interfaceBuiltin
- Specified by:
readsSymbolTable
in classCachedConnector
- Returns:
- true if it reads the symbol table
-
writesSymbolTable
public boolean writesSymbolTable()Description copied from interface:Builtin
does the builtin write into the symbol table- Specified by:
writesSymbolTable
in interfaceBuiltin
- Specified by:
writesSymbolTable
in classCachedConnector
- Returns:
- true if it writes to the symbol table
-
start
public void start(BitSet grounds, BuiltinReceiver receiver) throws ReasoningException, InterruptedException Description copied from interface:Connector
Start feeding the built-in with input values. Grounds indicates the ground arguments;
receiver catches the results of the evaluation- Specified by:
start
in interfaceConnector
- Specified by:
start
in classCachedConnector
- Parameters:
grounds
- , the arguments which are groundreceiver
- , the receiver receiving the results- Throws:
ReasoningException
InterruptedException
-
input
public void input(long[] input) Description copied from interface:Connector
Feed the built-in with an input tuple.
The built-in may produce at any time results,
may be during feeding or may be after calling stop- Specified by:
input
in interfaceConnector
- Specified by:
input
in classCachedConnector
- Parameters:
input
- encoded input tuple
-
stop
Description copied from interface:Connector
stop feeding the built-in with input values- Specified by:
stop
in interfaceConnector
- Specified by:
stop
in classCachedConnector
- Throws:
SemReasonerException
-
cloneBuiltin
Description copied from interface:Builtin
clone the builtin- Specified by:
cloneBuiltin
in interfaceBuiltin
- Specified by:
cloneBuiltin
in classCachedConnector
- Returns:
- the cloned built-in
-
clear
public void clear()Description copied from interface:Builtin
frees up allocated resources- Specified by:
clear
in interfaceBuiltin
- Specified by:
clear
in classCachedConnector
-