Class ReasoningProcess
- java.lang.Object
-
- net.ssehub.easy.reasoning.core.frontend.ReasoningProcess
-
- All Implemented Interfaces:
java.lang.Runnable
public class ReasoningProcess extends java.lang.Object implements java.lang.RunnableDelegate for starting a reasoning. This class can be run as a thread or be used inside a thread, e.g. as an Eclipse WorkspaceJob.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private Configurationconfigprivate ReasoningOperationdesiredOperationprivate IReasonerListenerlistenerprivate static booleanLOG_RESULTprivate ProgressObserverobserverprivate Projectprojectprivate ReasonerConfigurationreasonerConfigprivate ReasoningResultresult
-
Constructor Summary
Constructors Constructor Description ReasoningProcess(ReasoningOperation desiredOperation, Configuration config, ReasonerConfiguration reasonerConfig, IReasonerListener listener, ProgressObserver observer)Sole constructor for this class.ReasoningProcess(Project project, ReasonerConfiguration reasonerConfig, IReasonerListener listener, ProgressObserver observer)Constructor for checking the consistency (satisfiability) of a project, without having a configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReasoningResultgetReasoningResult()Returns the result of the reasoning, i.e.private voidlogResult()Performs the result logging as it was previously integrated into the reasoner but removed for performance reasons.voidrun()Executes the reasoning.private voidsetErrorResult(java.lang.String errorMsg)Sets aReasoningResultdenoting that an error occurred during reasoning.
-
-
-
Field Detail
-
LOG_RESULT
private static final boolean LOG_RESULT
- See Also:
- Constant Field Values
-
desiredOperation
private ReasoningOperation desiredOperation
-
result
private ReasoningResult result
-
project
private Project project
-
config
private Configuration config
-
reasonerConfig
private ReasonerConfiguration reasonerConfig
-
listener
private IReasonerListener listener
-
observer
private ProgressObserver observer
-
-
Constructor Detail
-
ReasoningProcess
public ReasoningProcess(ReasoningOperation desiredOperation, Configuration config, ReasonerConfiguration reasonerConfig, IReasonerListener listener, ProgressObserver observer)
Sole constructor for this class.- Parameters:
desiredOperation- Specifies which reasoning operation should be performed.config- The configuration, which should be used for reasoning.reasonerConfig- the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)listener- A listener which will be called after the reasoning has been finished. Can be null, if no action shall be executed after the reasoning is finished.observer- a progress observer indicating the progress, useProgressObserver.NO_OBSERVERif no progress shall be indicated
-
ReasoningProcess
public ReasoningProcess(Project project, ReasonerConfiguration reasonerConfig, IReasonerListener listener, ProgressObserver observer)
Constructor for checking the consistency (satisfiability) of a project, without having a configuration.- Parameters:
project- The origin project which should be used for reasoningreasonerConfig- the reasoner configuration to be used for reasoning (e.g. taken from the UI, may be null)listener- A listener which will be called after the reasoning has been finished. Can be null, if no action shall be executed after the reasoning is finished.observer- a progress observer indicating the progress, useProgressObserver.NO_OBSERVERif no progress shall be indicated
-
-
Method Detail
-
run
public void run()
Executes the reasoning.- Specified by:
runin interfacejava.lang.Runnable
-
logResult
private void logResult()
Performs the result logging as it was previously integrated into the reasoner but removed for performance reasons.
-
getReasoningResult
public ReasoningResult getReasoningResult()
Returns the result of the reasoning, i.e. the result of therun()method. This method should be used, if noReasoningResultwas used.- Returns:
- The result of the reasoning.
-
setErrorResult
private void setErrorResult(java.lang.String errorMsg)
Sets aReasoningResultdenoting that an error occurred during reasoning.- Parameters:
errorMsg- A description what kind of error occurred.
-
-