Class AlgorithmParameters
java.lang.Object
fr.inria.rules.integraal.component_builder.AlgorithmParameters
- All Implemented Interfaces:
IAlgorithmParameters
Default implementation for
IAlgorithmParameters.
This class encapsulates configuration parameters for an algorithm. It includes both "closed" parameters (represented by enumerations) and "open" parameters that may vary more widely. The structure is designed to allow flexible handling of these parameters while maintaining type safety through enums and reflection-based field assignment.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmParameters(String name, InteGraalKeywords.Algorithms algorithmType) Constructs a newAlgorithmParametersinstance.AlgorithmParameters(String name, InteGraalKeywords.Algorithms algorithmType, IGParameter<InteGraalKeywords, ?>... params) Constructs a newAlgorithmParametersinstance and immediately sets parameters from the specifiedIGParameterobject. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanasksSet()Returns the current algorithm type.getMax()getName()Returns the name of the configuration concatenated with the algorithm name.getRank()setCompilation(String compilationName) Sets the compilation approach (e.g., "DEFAULT") by matching the input string to an enum constant and then callingsetParameter(Enum).setComputer(String computerName) Sets the chase computer by matching the input string to an enum constant and then callingsetParameter(Enum).setCriterion(String criterionName) Sets the chase criterion (checker) by matching the input string to an enum constant and then callingsetParameter(Enum).setDBDriver(String storageDriverName) Sets the database driver type (e.g., "JDBC") by matching the input string to an enum constant and then callingsetParameter(Enum).setDBMSDriverParameters(InteGraalKeywords.InternalStorageConfiguration.DBMSDriverParameters paramName, String value) voidsetDBMSDriverParameters(String paramName, String paramValue) Sets a DBMS driver parameter based on the provided parameter name and value.setDBStrategy(String storageStrategyName) Sets the storage layout strategy (e.g., "DEFAULT") by matching the input string to an enum constant and then callingsetParameter(Enum).setEvaluator(String evaluatorName) Sets the chase evaluator by matching the input string to an enum constant and then callingsetParameter(Enum).setExplainerVerbosity(InteGraalKeywords.Algorithms.Parameters.Explanation.ExplainerVerbosity verbosity) setExplanationCategory(InteGraalKeywords.Algorithms.Parameters.Explanation explanationCategory) setExplanationSupportType(InteGraalKeywords.Algorithms.Parameters.Explanation.ExplanationSupportType explanationSupportType) ////////////////////////////////////// / OVERRIDDEN / PUBLIC SETTER METHODS //////////////////////////////////////setGMUSSolverTreshold(int treshold) setGraphOfRuleInstancesType(InteGraalKeywords.Algorithms.Parameters.Explanation.GraphOfRuleInstancesComputation griComputation) setGraphOfRuleInstancesType(InteGraalKeywords.Algorithms.Parameters.Explanation.GraphOfRuleInstancesType griType) setGSATSolverParameters(InteGraalKeywords.Algorithms.Parameters.Explanation.GSATSolverParameters paramName, String value) voidsetGSATSolverParameters(String paramName, String paramValue) Sets a GSAT solver parameter from its string name.voidsetMARCOPathToExecutable(String pathtoExecutable) setOpenParameter(InteGraalKeywords k, Object value) Sets an open parameter (one that is not tied to a closed enumeration of values) by matching its name to one of the fields declared in this class.setOpenParameterFromEnumeration(Class<? extends Enum<?>> className, String propertyName, String value) Sets an open parameter (defined within a known enumeration) by mapping the givenpropertyNameto the appropriate enum constant inclassName, and assigning the providedvalue.setOpenParameterFromEnumeration(Enum<?> enumName, String propertyName, String value) Similar tosetOpenParameterFromEnumeration(Class, String, String), but takes anenumNameinstead of the enumclassName.setParameter(Enum<?> enumValue) Sets the value of a parameter based on the provided enum constant.voidsetRuleApplier(String applierName) Sets the chase rule applier by matching the input string to an enum constant and then callingsetParameter(Enum).setScheduler(String scheduler) Sets the scheduler by matching the input string to an enum constant and then callingsetParameter(Enum).setSkolemization(String skolemizationName) Sets the chase Skolemization approach by matching the input string to an enum constant and then callingsetParameter(Enum).setStorageType(String storageDBTypeName) Sets the DB storage type (e.g., PostgreSQL, H2) by matching the input string to an enum constant and then callingsetParameter(Enum).setTimeout(Duration timeout) setTransformer(String transformerName) Sets the chase transformer by matching the input string to an enum constant and then callingsetParameter(Enum).toString()Returns a string representation of thisAlgorithmParametersobject, which includes key fields and values.booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IAlgorithmParameters
Chase
-
Field Details
-
name
Base name of this parameter set before the algorithm suffix is appended.
-
-
Constructor Details
-
AlgorithmParameters
Constructs a newAlgorithmParametersinstance.- Parameters:
name- the name of the configurationalgorithmType- the algorithm type (e.g., KB_CHASE, OMQA_CHASE)
-
AlgorithmParameters
public AlgorithmParameters(String name, InteGraalKeywords.Algorithms algorithmType, IGParameter<InteGraalKeywords, ?>... params) Constructs a newAlgorithmParametersinstance and immediately sets parameters from the specifiedIGParameterobject.- Parameters:
name- the name of the configurationalgorithmType- the algorithm typeparams- anIGParametercontaining parameter metadata
-
-
Method Details
-
getName
Returns the name of the configuration concatenated with the algorithm name.- Specified by:
getNamein interfaceIAlgorithmParameters- Returns:
- the name of the configuration (e.g., "MyConfig_OMQA_CHASE")
-
getAlgorithm
Returns the current algorithm type.- Specified by:
getAlgorithmin interfaceIAlgorithmParameters- Returns:
- the current
InteGraalKeywords.Algorithmsenum value
-
usesSaturationAlgorithm
public boolean usesSaturationAlgorithm() -
usesQueryRewritingAlgorithm
public boolean usesQueryRewritingAlgorithm() -
usesQueryAnsweringAlgorithm
public boolean usesQueryAnsweringAlgorithm() -
usesRuleCompilationAlgorithm
public boolean usesRuleCompilationAlgorithm() -
usesOMQASaturationAlgorithm
public boolean usesOMQASaturationAlgorithm() -
usesOMQARewritingAlgorithm
public boolean usesOMQARewritingAlgorithm() -
usesOMQAHybridAlgorithm
public boolean usesOMQAHybridAlgorithm() -
usesStorage
public boolean usesStorage() -
getRuleApplier
-
getScheduler
-
getCriterion
-
getComputer
-
getSkolemization
-
getEvaluator
-
getTransformer
-
getStorageType
-
getDBDriver
-
getDBStrategy
-
getCompilation
-
getRank
-
getMax
-
getTimeout
-
getResultType
-
getImageType
-
setResultType
-
setImageType
-
asksLists
public boolean asksLists() -
asksSet
public boolean asksSet() -
asksCountOnly
public boolean asksCountOnly() -
getExternalHaltingConditions
-
getDBMSDriverParameters
public Optional<Map<InteGraalKeywords.InternalStorageConfiguration.DBMSDriverParameters, String>> getDBMSDriverParameters() -
setExternalHaltingConditions
////////////////////////////////////// / OVERRIDDEN / PUBLIC SETTER METHODS ////////////////////////////////////// -
setMax
-
setRank
-
setTimeout
-
setStorageType
Sets the DB storage type (e.g., PostgreSQL, H2) by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
storageDBTypeName- the name of the storage type (e.g., "H2", "POSTGRESQL")- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setStorageType
public IAlgorithmParameters setStorageType(InteGraalKeywords.InternalStorageConfiguration.DBType storage) -
setDBDriver
Sets the database driver type (e.g., "JDBC") by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
storageDriverName- the name of the driver type- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setDBDriver
public IAlgorithmParameters setDBDriver(InteGraalKeywords.InternalStorageConfiguration.DriverType storageDriver) -
setDBStrategy
Sets the storage layout strategy (e.g., "DEFAULT") by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
storageStrategyName- the name of the storage layout- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setDBStrategy
public IAlgorithmParameters setDBStrategy(InteGraalKeywords.InternalStorageConfiguration.StorageLayout storageStrategy) -
setRuleApplier
Sets the chase rule applier by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
applierName- the name of the rule applier- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setRuleApplier
public IAlgorithmParameters setRuleApplier(InteGraalKeywords.Algorithms.Parameters.Chase.Applier applier) -
setScheduler
Sets the scheduler by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
scheduler- the name of the scheduler- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setScheduler
public IAlgorithmParameters setScheduler(InteGraalKeywords.Algorithms.Parameters.Chase.Scheduler scheduler) -
setCriterion
Sets the chase criterion (checker) by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
criterionName- the name of the chase checker- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setCriterion
public IAlgorithmParameters setCriterion(InteGraalKeywords.Algorithms.Parameters.Chase.Checker criterion) -
setComputer
Sets the chase computer by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
computerName- the name of the chase computer- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setComputer
public IAlgorithmParameters setComputer(InteGraalKeywords.Algorithms.Parameters.Chase.Computer computer) -
setSkolemization
Sets the chase Skolemization approach by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
skolemizationName- the name of the Skolemization approach- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setSkolemization
public IAlgorithmParameters setSkolemization(InteGraalKeywords.Algorithms.Parameters.Chase.Namer skolemization) -
setEvaluator
Sets the chase evaluator by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
evaluatorName- the name of the evaluator- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setEvaluator
public IAlgorithmParameters setEvaluator(InteGraalKeywords.Algorithms.Parameters.Chase.Evaluator evaluator) -
setTransformer
Sets the chase transformer by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
transformerName- the name of the transformer- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setTransformer
public IAlgorithmParameters setTransformer(InteGraalKeywords.Algorithms.Parameters.Chase.Transformer transformer) -
setCompilation
Sets the compilation approach (e.g., "DEFAULT") by matching the input string to an enum constant and then callingsetParameter(Enum).- Parameters:
compilationName- the name of the compilation type- Returns:
- this
IAlgorithmParametersinstance for method chaining
-
setCompilation
public IAlgorithmParameters setCompilation(InteGraalKeywords.Algorithms.Parameters.Compilation compilation) -
setDBMSDriverParameters
Sets a DBMS driver parameter based on the provided parameter name and value. The parameter name is mapped to an enum instance ofInteGraalKeywords.InternalStorageConfiguration.DBMSDriverParameters, and then the appropriate field in this class is updated.- Parameters:
paramName- the name of the DBMS driver parameter, e.g., "URL" or "PORT"paramValue- the value to set for the specified parameter- Throws:
IllegalArgumentException- ifparamNamedoes not match any knownInteGraalKeywords.InternalStorageConfiguration.DBMSDriverParametersvalue- See Also:
-
setGSATSolverParameters
-
setDBMSDriverParameters
public IAlgorithmParameters setDBMSDriverParameters(InteGraalKeywords.InternalStorageConfiguration.DBMSDriverParameters paramName, String value) -
setGSATSolverParameters
public IAlgorithmParameters setGSATSolverParameters(InteGraalKeywords.Algorithms.Parameters.Explanation.GSATSolverParameters paramName, String value) -
getMARCOPathToExecutable
-
setMARCOPathToExecutable
-
setParameter
Sets the value of a parameter based on the provided enum constant. This method uses reflection to dynamically identify and set the field within this class that corresponds to the enum type of the given constant. The field name is expected to match the simple name of the enum's class, with the first letter lowercased (following Java naming conventions)- Specified by:
setParameterin interfaceIAlgorithmParameters- Parameters:
enumValue- The enum constant to set as the value of the corresponding field. The enum's class simple name (lowercased) should match the name of the field in this class.- Returns:
- the updated algorithm parameters
- Throws:
RuntimeException- If no matching field is found for the enum type, or if an error occurs while attempting to set the field's value. This includes cases where the field is not accessible or if the field name does not match the expected naming convention.- See Also:
-
setOpenParameterFromEnumeration
public IAlgorithmParameters setOpenParameterFromEnumeration(Class<? extends Enum<?>> className, String propertyName, String value) Sets an open parameter (defined within a known enumeration) by mapping the givenpropertyNameto the appropriate enum constant inclassName, and assigning the providedvalue.Currently, this is primarily used for
DBMSDriverParameters.- Specified by:
setOpenParameterFromEnumerationin interfaceIAlgorithmParameters- Parameters:
className- the enum's class, e.g.,DBMSDriverParameters.classpropertyName- the name of the enum constant, e.g., "URL" or "USER_NAME"value- the string value to assign to this parameter- Returns:
- this
IAlgorithmParametersinstance for method chaining - Throws:
IllegalArgumentException- ifpropertyNamedoes not match any known constant inclassName
-
setOpenParameterFromEnumeration
public IAlgorithmParameters setOpenParameterFromEnumeration(Enum<?> enumName, String propertyName, String value) Similar tosetOpenParameterFromEnumeration(Class, String, String), but takes anenumNameinstead of the enumclassName. This method is used to handle open parameters where the parent enumeration is already determined.- Specified by:
setOpenParameterFromEnumerationin interfaceIAlgorithmParameters- Parameters:
enumName- the enumeration constant representing the parameter categorypropertyName- the name of the specific parameter within that categoryvalue- the string value to assign to the parameter- Returns:
- this
IAlgorithmParametersinstance for method chaining - Throws:
IllegalArgumentException- ifpropertyNamedoes not match any recognized constant for the givenenumName
-
setOpenParameter
Sets an open parameter (one that is not tied to a closed enumeration of values) by matching its name to one of the fields declared in this class. If found, the field is updated with the providedvalue.- Specified by:
setOpenParameterin interfaceIAlgorithmParameters- Parameters:
k- the keyword representing the parameter namevalue- the value to set (typeObjectbecause parameters can vary)- Returns:
- this
IAlgorithmParametersinstance for method chaining - Throws:
RuntimeException- if the parameter field cannot be found or set- See Also:
-
toString
-
getExplanation
-
setExplanationCategory
public IAlgorithmParameters setExplanationCategory(InteGraalKeywords.Algorithms.Parameters.Explanation explanationCategory) -
getExplainerSolver
public Optional<InteGraalKeywords.Algorithms.Parameters.Explanation.ExplainerSolver> getExplainerSolver() -
setExplainerSolver
public IAlgorithmParameters setExplainerSolver(InteGraalKeywords.Algorithms.Parameters.Explanation.ExplainerSolver solver) -
getExplanationSupportType
public Optional<InteGraalKeywords.Algorithms.Parameters.Explanation.ExplanationSupportType> getExplanationSupportType() -
setExplanationSupportType
public IAlgorithmParameters setExplanationSupportType(InteGraalKeywords.Algorithms.Parameters.Explanation.ExplanationSupportType explanationSupportType) -
getExplainerVerbosity
public Optional<InteGraalKeywords.Algorithms.Parameters.Explanation.ExplainerVerbosity> getExplainerVerbosity() -
setExplainerVerbosity
public IAlgorithmParameters setExplainerVerbosity(InteGraalKeywords.Algorithms.Parameters.Explanation.ExplainerVerbosity verbosity) -
getGraphOfRuleInstancesType
public Optional<InteGraalKeywords.Algorithms.Parameters.Explanation.GraphOfRuleInstancesType> getGraphOfRuleInstancesType() -
setGraphOfRuleInstancesType
public IAlgorithmParameters setGraphOfRuleInstancesType(InteGraalKeywords.Algorithms.Parameters.Explanation.GraphOfRuleInstancesType griType) -
getGraphOfRuleInstancesComputation
public Optional<InteGraalKeywords.Algorithms.Parameters.Explanation.GraphOfRuleInstancesComputation> getGraphOfRuleInstancesComputation() -
setGraphOfRuleInstancesType
public IAlgorithmParameters setGraphOfRuleInstancesType(InteGraalKeywords.Algorithms.Parameters.Explanation.GraphOfRuleInstancesComputation griComputation) -
getGMUSSolverTreshold
-
setGMUSSolverTreshold
-