Package com.bayesserver.inference
Class QueryFunction
- java.lang.Object
-
- com.bayesserver.inference.QueryFunction
-
public final class QueryFunction extends Object
Defines a function to be evaluated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
. Functions do not form part of the core inference routine, but are evaluated afterwards in topological order.
-
-
Constructor Summary
Constructors Constructor Description QueryFunction(QueryFunctionOutput functionOutput)
Initializes a new instance of theQueryFunction
class.QueryFunction(QueryFunctionOutput functionOutput, boolean isEnabled)
Initializes a new instance of theQueryFunction
class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryFunction
copy()
Copies this instance, creating a copy of the function output as well.QueryFunctionOutput
getFunctionOutput()
Gets the function to evaluate.boolean
getIsEnabled()
Gets a value indicating whether the function should be evaluated.void
setIsEnabled(boolean value)
Sets a value indicating whether the function should be evaluated.
-
-
-
Constructor Detail
-
QueryFunction
public QueryFunction(QueryFunctionOutput functionOutput)
Initializes a new instance of theQueryFunction
class. The enabled property defaults to true.- Parameters:
functionOutput
- Collects the output of the function evaluation.
-
QueryFunction
public QueryFunction(QueryFunctionOutput functionOutput, boolean isEnabled)
Initializes a new instance of theQueryFunction
class.- Parameters:
functionOutput
- Collects the output of the function evaluation.isEnabled
- Sets thegetIsEnabled()
property.
-
-
Method Detail
-
getIsEnabled
public boolean getIsEnabled()
Gets a value indicating whether the function should be evaluated.- Returns:
true
if the function should be evaluated; otherwise,false
.
-
setIsEnabled
public void setIsEnabled(boolean value)
Sets a value indicating whether the function should be evaluated.- Parameters:
value
-true
if the function should be evaluated; otherwise,false
.
-
getFunctionOutput
public QueryFunctionOutput getFunctionOutput()
Gets the function to evaluate.- Returns:
- The function.
-
copy
public QueryFunction copy()
Copies this instance, creating a copy of the function output as well.- Returns:
- A copy of this instance.
-
-