Interface IReasonerInstance
-
- All Known Implementing Classes:
DelegatingReasonerInstance,Reasoner.ReasonerInstance
public interface IReasonerInstanceA reuseable reasoner instance. Project, configuration and reasoner configuration are fixed for this instance. The reasoner may operate sequentially or in parallel. A specific reasoner must not offer/create reasoner instances. The underlying model is assumed to have no structural changes between two subsequent reasonings.- Author:
- Holger Eichelberger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ReasoningResultcheck(ProgressObserver observer)Checks the configuration according to the given project structure and does not affect the configuration.ValueCreationResultcreateValue(AbstractVariable var, IDatatype type, ProgressObserver observer)Creates the value for a certain IVML type/variable.EvaluationResultevaluate(java.util.List<Constraint> constraints, ProgressObserver observer)Evaluates a given list of constraints (in the sense of boolean conditions) which are related to and valid in the context of the given project and configuration.ReasonerDescriptorgetDescriptor()Returns a descriptor stating common information about this reasoner.ProjectgetProject()Returns the project this instance is attached to.ReasonerConfigurationgetReasonerConfiguration()Returns the reasoner configuration this project is running with.ReasoningResultisConsistent(ProgressObserver observer)Checks whether a given variability model (project) is satisfiable.booleanisRunning()Returns whether the reasoner is (still) operating.voidnotify(IReasonerMessage message)Is called when a reasoner message is issued.ReasoningResultpropagate(ProgressObserver observer)Checks the configuration according to the given model and propagates values, if possible.booleanstop()Stops/terminates reasoning.
-
-
-
Method Detail
-
getDescriptor
ReasonerDescriptor getDescriptor()
Returns a descriptor stating common information about this reasoner.- Returns:
- the descriptor
-
isConsistent
ReasoningResult isConsistent(ProgressObserver observer)
Checks whether a given variability model (project) is satisfiable.- Parameters:
observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- The result of this reasoning step. Can have the status
Status.UNSUPPORTEDif the concrete reasoner does not support this operation.
-
check
ReasoningResult check(ProgressObserver observer)
Checks the configuration according to the given project structure and does not affect the configuration.- Parameters:
observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- The result of this reasoning step. Can have the status
Status.UNSUPPORTEDif the concrete reasoner does not support this operation.
-
propagate
ReasoningResult propagate(ProgressObserver observer)
Checks the configuration according to the given model and propagates values, if possible.- Parameters:
observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- The result of this reasoning step. Can have the status
Status.UNSUPPORTEDif the concrete reasoner does not support this operation.
-
evaluate
EvaluationResult evaluate(java.util.List<Constraint> constraints, ProgressObserver observer)
Evaluates a given list of constraints (in the sense of boolean conditions) which are related to and valid in the context of the given project and configuration.- Parameters:
constraints- the constraints (expressions which evaluate to a boolean value)observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- The result of this reasoning step. Can have the status
Status.UNSUPPORTEDif the concrete reasoner does not support this operation.
-
createValue
ValueCreationResult createValue(AbstractVariable var, IDatatype type, ProgressObserver observer)
Creates the value for a certain IVML type/variable.- Parameters:
var- the variable to create the value for (may be null iftypeis given, may imply additional constraints)type- the type to create the value for (may be null ifvaris given)observer- an optional progress observer, shall beProgressObserver.NO_OBSERVERif unused- Returns:
- the value creation result
-
notify
void notify(IReasonerMessage message)
Is called when a reasoner message is issued.- Parameters:
message- the message sent
-
isRunning
boolean isRunning()
Returns whether the reasoner is (still) operating.- Returns:
truefor operating,falseelse
-
stop
boolean stop()
Stops/terminates reasoning. If possible, a reasoner shall stop the reasoning operations as quick as possible. A reasoner must not implement this operation.- Returns:
trueif the reasoner tries to stop,falseelse (operation not implemented)- See Also:
ReasoningResult.setStopped(boolean)
-
getProject
Project getProject()
Returns the project this instance is attached to.- Returns:
- the project
-
getReasonerConfiguration
ReasonerConfiguration getReasonerConfiguration()
Returns the reasoner configuration this project is running with.- Returns:
- the reasoner configuration
-
-