public class DelegatingReasonerInstance extends java.lang.Object implements IReasonerInstance
IReasoner#createInstance(
net.ssehub.easy.varModel.model.Project, net.ssehub.easy.varModel.confModel.Configuration, ReasonerConfiguration),
i.e., to avoid null pointer returns.| Modifier and Type | Field and Description |
|---|---|
private net.ssehub.easy.varModel.confModel.Configuration |
config |
private IReasoner |
delegate |
private boolean |
isRunning |
private ReasonerConfiguration |
rConfig |
| Constructor and Description |
|---|
DelegatingReasonerInstance(net.ssehub.easy.varModel.confModel.Configuration config,
ReasonerConfiguration rConfig,
IReasoner delegate)
Creates a delegating reasoner instance.
|
| Modifier and Type | Method and Description |
|---|---|
ReasoningResult |
check(net.ssehub.easy.basics.progress.ProgressObserver observer)
Checks the configuration according to the given project structure and does not affect the configuration.
|
ValueCreationResult |
createValue(net.ssehub.easy.varModel.model.AbstractVariable var,
net.ssehub.easy.varModel.model.datatypes.IDatatype type,
net.ssehub.easy.basics.progress.ProgressObserver observer)
Creates the value for a certain IVML type/variable.
|
EvaluationResult |
evaluate(java.util.List<net.ssehub.easy.varModel.model.Constraint> constraints,
net.ssehub.easy.basics.progress.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.
|
ReasonerDescriptor |
getDescriptor()
Returns a descriptor stating common information about this reasoner.
|
net.ssehub.easy.varModel.model.Project |
getProject()
Returns the project this instance is attached to.
|
ReasonerConfiguration |
getReasonerConfiguration()
Returns the reasoner configuration this project is running with.
|
ReasoningResult |
isConsistent(net.ssehub.easy.basics.progress.ProgressObserver observer)
Checks whether a given variability model (project) is satisfiable.
|
boolean |
isRunning()
Returns whether the reasoner is (still) operating.
|
void |
notify(IReasonerMessage message)
Is called when a reasoner message is issued.
|
ReasoningResult |
propagate(net.ssehub.easy.basics.progress.ProgressObserver observer)
Checks the configuration according to the given model and propagates values, if possible.
|
boolean |
stop()
Stops/terminates reasoning.
|
private IReasoner delegate
private net.ssehub.easy.varModel.confModel.Configuration config
private ReasonerConfiguration rConfig
private boolean isRunning
public DelegatingReasonerInstance(net.ssehub.easy.varModel.confModel.Configuration config,
ReasonerConfiguration rConfig,
IReasoner delegate)
config - the configuration to reason bound to this instancerConfig - the reasoner configurationdelegate - the delegatepublic ReasonerDescriptor getDescriptor()
IReasonerInstancegetDescriptor in interface IReasonerInstancepublic ReasoningResult isConsistent(net.ssehub.easy.basics.progress.ProgressObserver observer)
IReasonerInstanceisConsistent in interface IReasonerInstanceobserver - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unusedStatus.UNSUPPORTED if the concrete reasoner does not support
this operation.public ReasoningResult check(net.ssehub.easy.basics.progress.ProgressObserver observer)
IReasonerInstancecheck in interface IReasonerInstanceobserver - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unusedStatus.UNSUPPORTED if the concrete reasoner does not support
this operation.public ReasoningResult propagate(net.ssehub.easy.basics.progress.ProgressObserver observer)
IReasonerInstancepropagate in interface IReasonerInstanceobserver - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unusedStatus.UNSUPPORTED if the concrete reasoner does not support
this operation.public EvaluationResult evaluate(java.util.List<net.ssehub.easy.varModel.model.Constraint> constraints, net.ssehub.easy.basics.progress.ProgressObserver observer)
IReasonerInstanceevaluate in interface IReasonerInstanceconstraints - the constraints (expressions which evaluate to a boolean value)observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unusedStatus.UNSUPPORTED if the concrete reasoner does not support
this operation.public ValueCreationResult createValue(net.ssehub.easy.varModel.model.AbstractVariable var, net.ssehub.easy.varModel.model.datatypes.IDatatype type, net.ssehub.easy.basics.progress.ProgressObserver observer)
IReasonerInstancecreateValue in interface IReasonerInstancevar - the variable to create the value for (may be null if type is given, may imply
additional constraints)type - the type to create the value for (may be null if var is given)observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unusedpublic void notify(IReasonerMessage message)
IReasonerInstancenotify in interface IReasonerInstancemessage - the message sentpublic boolean isRunning()
IReasonerInstanceisRunning in interface IReasonerInstancetrue for operating, false elsepublic boolean stop()
IReasonerInstancestop in interface IReasonerInstancetrue if the reasoner tries to stop, false else
(operation not implemented)ReasoningResult.setStopped(boolean)public net.ssehub.easy.varModel.model.Project getProject()
IReasonerInstancegetProject in interface IReasonerInstancepublic ReasonerConfiguration getReasonerConfiguration()
IReasonerInstancegetReasonerConfiguration in interface IReasonerInstanceCopyright © 2009 - 2018 SSE. All Rights Reserved.