Package com.semedy.reasoner.reasoning
Class IncrementalFactsBuiltin
java.lang.Object
com.semedy.reasoner.api.builtin.SensorBuiltin
com.semedy.reasoner.reasoning.IncrementalFactsBuiltin
- All Implemented Interfaces:
Builtin
- Author:
- angele
-
Constructor Summary
ConstructorDescriptionIncrementalFactsBuiltin
(String predicate) IncrementalFactsBuiltin
(String predicate, int arity, ReasoningMonitor monitor, boolean cepReasoning) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
frees up allocated resourcescreate a clone of the built-inString[]
get a description of the argumentsint
getArity()
get the arity of the built-inget a description of the built-in itselfgetName()
get the name of the built-ingetType()
get the type of the built-inlong
get the weight of the built-invoid
initialize the built-inboolean
isEvaluable
(BitSet grounds, BitSet variableInstantiations, Object[] args) is builtin evaluable with the given ground instantiation of variablesboolean
is it an internal built-inobjectGeneratingArguments
(BitSet grounds, BitSet variableInstantiations, Object[] args) at which argument positions new objects are generatedboolean
does the built-in read the symbol tablevoid
receiveEvent
(long[] tuple) void
receiveEvent
(TupleBuffer tuple) void
receiveRelation
(BaseRelation relation) void
setProperties
(Properties prp) set the sytem propertiestoString()
boolean
does the built-in write the symbol tableMethods inherited from class com.semedy.reasoner.api.builtin.SensorBuiltin
addReceiver, evaluationFinished, receiveEncodedEvent, receiveEvent, retractEncodedEvent, retractEvent, retractEvents, setSemaphore, setSymbolTable
-
Constructor Details
-
IncrementalFactsBuiltin
public IncrementalFactsBuiltin(String predicate, int arity, ReasoningMonitor monitor, boolean cepReasoning) -
IncrementalFactsBuiltin
-
-
Method Details
-
setProperties
Description copied from interface:Builtin
set the sytem properties- Parameters:
prp
- , properties
-
receiveRelation
public void receiveRelation(BaseRelation relation) throws SemReasonerException, InterruptedException, IOException -
receiveEvent
public void receiveEvent(TupleBuffer tuple) throws SemReasonerException, InterruptedException, IOException -
receiveEvent
public void receiveEvent(long[] tuple) throws SemReasonerException, InterruptedException, IOException -
isEvaluable
public boolean isEvaluable(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException Description copied from class:SensorBuiltin
is builtin evaluable with the given ground instantiation of variables- Specified by:
isEvaluable
in interfaceBuiltin
- Specified by:
isEvaluable
in classSensorBuiltin
- Parameters:
grounds
- , which arguments are groundvariableInstantiations
- , which variables are instantiatedargs
- , the arguments- Returns:
- was it evaluable
- Throws:
BuiltinException
-
init
Description copied from class:SensorBuiltin
initialize the built-in- Specified by:
init
in interfaceBuiltin
- Specified by:
init
in classSensorBuiltin
- Parameters:
args
- , the builtin arguments- Throws:
InterruptedException
BuiltinException
-
getWeight
Description copied from class:SensorBuiltin
get the weight of the built-in- Specified by:
getWeight
in interfaceBuiltin
- Specified by:
getWeight
in classSensorBuiltin
- 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 class:SensorBuiltin
at which argument positions new objects are generated- Specified by:
objectGeneratingArguments
in interfaceBuiltin
- Specified by:
objectGeneratingArguments
in classSensorBuiltin
- 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 class:SensorBuiltin
get the name of the built-in- Specified by:
getName
in interfaceBuiltin
- Specified by:
getName
in classSensorBuiltin
- Returns:
- the name of the built-in
-
getArity
public int getArity()Description copied from class:SensorBuiltin
get the arity of the built-in- Specified by:
getArity
in interfaceBuiltin
- Specified by:
getArity
in classSensorBuiltin
- Returns:
- the arity of the built-in
-
getType
Description copied from class:SensorBuiltin
get the type of the built-in- Specified by:
getType
in interfaceBuiltin
- Specified by:
getType
in classSensorBuiltin
- Returns:
- the type of the built-in
-
isInternal
public boolean isInternal()Description copied from class:SensorBuiltin
is it an internal built-in- Specified by:
isInternal
in interfaceBuiltin
- Specified by:
isInternal
in classSensorBuiltin
- Returns:
-
getArgumentDescriptions
Description copied from class:SensorBuiltin
get a description of the arguments- Specified by:
getArgumentDescriptions
in interfaceBuiltin
- Specified by:
getArgumentDescriptions
in classSensorBuiltin
- Returns:
- a description of the arguments of the built-in
-
getDescription
Description copied from class:SensorBuiltin
get a description of the built-in itself- Specified by:
getDescription
in interfaceBuiltin
- Specified by:
getDescription
in classSensorBuiltin
- Returns:
- a description of the built-in
-
readsSymbolTable
public boolean readsSymbolTable()Description copied from class:SensorBuiltin
does the built-in read the symbol table- Specified by:
readsSymbolTable
in interfaceBuiltin
- Specified by:
readsSymbolTable
in classSensorBuiltin
- Returns:
- true if it reads the symbol table
-
writesSymbolTable
public boolean writesSymbolTable()Description copied from class:SensorBuiltin
does the built-in write the symbol table- Specified by:
writesSymbolTable
in interfaceBuiltin
- Specified by:
writesSymbolTable
in classSensorBuiltin
- Returns:
- true if it writes to the symbol table
-
cloneBuiltin
Description copied from class:SensorBuiltin
create a clone of the built-in- Specified by:
cloneBuiltin
in interfaceBuiltin
- Specified by:
cloneBuiltin
in classSensorBuiltin
- Returns:
- the cloned built-in
-
clear
public void clear()Description copied from interface:Builtin
frees up allocated resources -
toString
-