Class IsAlive
java.lang.Object
com.semedy.reasoner.builtin.functional.IsAlive
- All Implemented Interfaces:
Builtin
,FunctionalBuiltin
This is a simple builtin that is executed to check if the reasoner is still alive. It does
nothing else than returning true when it is called.
- Author:
- Kevin Angele - kevin.angele@onlim.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
frees up allocated resourcesclone the builtinboolean
Given the input tuple and the instantiated arguments.void
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 builtinboolean
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 tableboolean
does the builtin write into the symbol table
-
Constructor Details
-
IsAlive
public IsAlive()
-
-
Method Details
-
setSymbolTable
set the symbol table- Specified by:
setSymbolTable
in interfaceBuiltin
- Parameters:
symbolTable
- , the symbol table
-
setProperties
set the sytem properties- Specified by:
setProperties
in interfaceBuiltin
- Parameters:
prp
- , properties
-
evaluate
public boolean evaluate(long[] input, BitSet grounds) throws ReasoningException, InterruptedException, IOException Given the input tuple and the instantiated arguments. The evaluation substitutes variables of the input tuple by concrete values- Specified by:
evaluate
in interfaceFunctionalBuiltin
- Parameters:
input
- , the codes of the input valuesgrounds
- , which input arguments are ground- Returns:
- Throws:
InterruptedException
IOException
ReasoningException
-
isEvaluable
public boolean isEvaluable(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException is builtin evaluable with a certain instantiation of variables- Specified by:
isEvaluable
in interfaceBuiltin
- Parameters:
grounds
- , which arguments are groundvariableInstantiations
- , which variables are instantiatedargs
- , the arguments- Returns:
- was it evaluable
- Throws:
BuiltinException
-
init
initialize the builtin- Specified by:
init
in interfaceBuiltin
- Parameters:
args
- , the builtin arguments- Throws:
InterruptedException
BuiltinException
-
evaluationFinished
call back function. Is called when the whole evaluation has been finished- Specified by:
evaluationFinished
in interfaceBuiltin
- Throws:
BuiltinException
InterruptedException
-
getWeight
the weight of the builtin. Determines when the builtin is executed in a rule -
objectGeneratingArguments
public BitSet objectGeneratingArguments(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException In which argument position are new objects created- Specified by:
objectGeneratingArguments
in interfaceBuiltin
- 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
get the name of the builtin -
getArity
public int getArity()get the arity of the builtin -
getType
get the type of the builtin -
isInternal
public boolean isInternal()is it a builtin for internal use only- Specified by:
isInternal
in interfaceBuiltin
- Returns:
-
getDescription
get a description for the builtin- Specified by:
getDescription
in interfaceBuiltin
- Returns:
- a description of the built-in
-
getArgumentDescriptions
get descriptions for the different arguments- Specified by:
getArgumentDescriptions
in interfaceBuiltin
- Returns:
- a description of the arguments of the built-in
-
readsSymbolTable
public boolean readsSymbolTable()does the builtin read the symbol table- Specified by:
readsSymbolTable
in interfaceBuiltin
- Returns:
- true if it reads the symbol table
-
writesSymbolTable
public boolean writesSymbolTable()does the builtin write into the symbol table- Specified by:
writesSymbolTable
in interfaceBuiltin
- Returns:
- true if it writes to the symbol table
-
cloneBuiltin
clone the builtin- Specified by:
cloneBuiltin
in interfaceBuiltin
- Returns:
- the cloned built-in
-
clear
public void clear()frees up allocated resources
-