public abstract class AbstractChainedReasoner extends java.lang.Object implements IChainingReasoner
ChainedReasonerState for implementing the passed on reasoner
state.| Modifier and Type | Class and Description |
|---|---|
private static class |
AbstractChainedReasoner.DerivedReasonerDescriptor
Implements a derived reasoner descriptor taking over capabilities.
|
| Modifier and Type | Field and Description |
|---|---|
private net.ssehub.easy.varModel.confModel.Configuration |
config |
private ReasonerDescriptor |
descriptor |
private EvaluationResult |
evaluationResult |
private IChainingReasoner[] |
reasoners |
private ReasoningResult |
reasoningResult |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractChainedReasoner(ReasonerDescriptor descriptor,
ReasonerDescriptor... chain)
Creates an reasoner chain with given descriptor.
|
protected |
AbstractChainedReasoner(java.lang.String name,
java.lang.String version,
ReasonerDescriptor... chain)
Creates an reasoner chain with given name and version.
|
| Modifier and Type | Method and Description |
|---|---|
ReasoningResult |
check(net.ssehub.easy.varModel.confModel.Configuration cfg,
ReasonerConfiguration reasonerConfiguration,
net.ssehub.easy.basics.progress.ProgressObserver observer)
Checks the configuration according to the given project structure and does not affect the configuration.
|
private static java.lang.String |
concatenate(java.lang.String s1,
java.lang.String s2)
Concatenates two strings regarding null for
s2. |
IReasonerInstance |
createInstance(net.ssehub.easy.varModel.confModel.Configuration cfg,
ReasonerConfiguration reasonerConfiguration)
Creates a reasoner instance for repeated reasoning on the same model (no structural changes allowed
during two subsequent reasoning runs).
|
private static ReasonerDescriptor |
deriveDescriptor(java.lang.String name,
java.lang.String version,
ReasonerDescriptor[] chain)
Derives the descriptor from the descriptor chain.
|
EvaluationResult |
evaluate(net.ssehub.easy.varModel.confModel.Configuration cfg,
java.util.List<net.ssehub.easy.varModel.model.Constraint> constraints,
ReasonerConfiguration reasonerConfiguration,
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.confModel.Configuration |
getLastConfiguration()
Returns the last, potentially internal configuration.
|
ReasoningResult |
isConsistent(net.ssehub.easy.varModel.model.Project project,
ReasonerConfiguration reasonerConfiguration,
net.ssehub.easy.basics.progress.ProgressObserver observer)
Checks whether a given variability model (project) is satisfiable.
|
void |
notify(IReasonerMessage message)
Is called when a reasoner message is issued.
|
ReasoningResult |
propagate(net.ssehub.easy.varModel.confModel.Configuration cfg,
ReasonerConfiguration reasonerConfiguration,
net.ssehub.easy.basics.progress.ProgressObserver observer)
Checks the configuration according to the given model and propagates values, if possible.
|
void |
setState(net.ssehub.easy.varModel.confModel.Configuration config,
EvaluationResult result)
Sets the state determined by the last reasoner.
|
void |
setState(net.ssehub.easy.varModel.confModel.Configuration config,
ReasoningResult result)
Sets the state determined by the last reasoner.
|
ReasoningResult |
upgrade(java.net.URI url,
net.ssehub.easy.basics.progress.ProgressObserver observer)
Updates the installation of this reasoner, e.g., in order to obtain a licensed reasoner version.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateValue, initialize, setInterceptorprivate ReasonerDescriptor descriptor
private IChainingReasoner[] reasoners
private net.ssehub.easy.varModel.confModel.Configuration config
private ReasoningResult reasoningResult
private EvaluationResult evaluationResult
protected AbstractChainedReasoner(java.lang.String name,
java.lang.String version,
ReasonerDescriptor... chain)
throws java.lang.IllegalArgumentException
name - the name of the reasonerversion - a version description of the integrated reasoner (may be null)chain - the reasoners to be chained (must be implementations of IChainingReasoner)java.lang.IllegalArgumentException - in case that one of the given reasoner descriptors is null, the reasoner
is not registered in the reasoner frontend, the first reasoner does not provide
GeneralReasonerCapabilities.STANDALONE_REASONING or at least one of the reasoners does not implement
IChainingReasoner/ReasonerFrontend.isChainingReasoner(ReasonerDescriptor)protected AbstractChainedReasoner(ReasonerDescriptor descriptor, ReasonerDescriptor... chain)
descriptor - the descriptor of the reasonerchain - the reasoners to be chained (must be implementations of IChainingReasoner)java.lang.IllegalArgumentException - in case that one of the given reasoner descriptors is null, the reasoner
is not registered in the reasoner frontend, the first reasoner does not provide
GeneralReasonerCapabilities.STANDALONE_REASONING or at least one of the reasoners does not implement
IChainingReasoner/ReasonerFrontend.isChainingReasoner(ReasonerDescriptor)private static ReasonerDescriptor deriveDescriptor(java.lang.String name, java.lang.String version, ReasonerDescriptor[] chain)
name - the name of the reasonerversion - the version of the reasonerchain - the chain of reasonersprivate static java.lang.String concatenate(java.lang.String s1,
java.lang.String s2)
s2.s1 - the first strings2 - the second stringpublic ReasoningResult upgrade(java.net.URI url, net.ssehub.easy.basics.progress.ProgressObserver observer)
IReasonerpublic ReasonerDescriptor getDescriptor()
IReasonergetDescriptor in interface IReasonerpublic ReasoningResult isConsistent(net.ssehub.easy.varModel.model.Project project, ReasonerConfiguration reasonerConfiguration, net.ssehub.easy.basics.progress.ProgressObserver observer)
IReasonerisConsistent in interface IReasonerproject - The project which should be tested whether it is satisfiable.reasonerConfiguration - the reasoner configuration to be used for reasoning (e.g. taken from the UI,
may be null)observer - 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.varModel.confModel.Configuration cfg, ReasonerConfiguration reasonerConfiguration, net.ssehub.easy.basics.progress.ProgressObserver observer)
IReasonercheck in interface IReasonercfg - The current configuration to reason on.reasonerConfiguration - the reasoner configuration to be used for reasoning (e.g. taken from the UI,
may be null)observer - 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.varModel.confModel.Configuration cfg, ReasonerConfiguration reasonerConfiguration, net.ssehub.easy.basics.progress.ProgressObserver observer)
IReasonerpropagate in interface IReasonercfg - The configuration to reason on (may be modified as a side effect
of value propagation)reasonerConfiguration - the reasoner configuration to be used for reasoning (e.g. taken from the UI,
may be null)observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unusedStatus.UNSUPPORTED if the concrete reasoner does not support
this operation.public EvaluationResult evaluate(net.ssehub.easy.varModel.confModel.Configuration cfg, java.util.List<net.ssehub.easy.varModel.model.Constraint> constraints, ReasonerConfiguration reasonerConfiguration, net.ssehub.easy.basics.progress.ProgressObserver observer)
IReasonerevaluate in interface IReasonercfg - the configuration as a basis for the evaluationconstraints - the constraints (expressions which evaluate to a boolean value)reasonerConfiguration - the reasoner configuration to be used for reasoning (e.g. taken from the UI,
may be null)observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unusedStatus.UNSUPPORTED if the concrete reasoner does not support
this operation.public void notify(IReasonerMessage message)
IReasonerpublic IReasonerInstance createInstance(net.ssehub.easy.varModel.confModel.Configuration cfg, ReasonerConfiguration reasonerConfiguration)
IReasonercreateInstance in interface IReasonercfg - the configuration as a basis for the evaluationreasonerConfiguration - the reasoner configuration to be used for reasoning (e.g. taken from the UI,
may be null)DelegatingReasonerInstance on this reasoner to
avoid null pointer checking.public void setState(net.ssehub.easy.varModel.confModel.Configuration config,
ReasoningResult result)
IChainingReasonerIReasoner shall be ignored.setState in interface IChainingReasonerconfig - the configuration (may be null, shall be ignored then). config may
be an internal resultresult - the last reasoning result (may be null, shall be ignored then, identifies beginning of
chain). It is assumed that the constraints and variables mentioned in reasoning result fit to
configurationpublic void setState(net.ssehub.easy.varModel.confModel.Configuration config,
EvaluationResult result)
IChainingReasonerIReasoner shall be ignored. Shall be used for #evaluate(net.ssehub.easy.varModel.model.Project, Configuration, java.util.List, ReasonerConfiguration,
net.ssehub.easy.basics.progress.ProgressObserver) only.setState in interface IChainingReasonerconfig - the configuration (may be null, shall be ignored then). config may
be an internal resultresult - the last reasoning result (may be null, shall be ignored then, identifies beginning of
chain). It is assumed that the constraints and variables mentioned in reasoning result fit to
configurationpublic net.ssehub.easy.varModel.confModel.Configuration getLastConfiguration()
IChainingReasonerIChainingReasoner.setState(Configuration, ReasoningResult) of the next reasoner. Shall
clear the attribute holding the last config.getLastConfiguration in interface IChainingReasonerCopyright © 2009 - 2018 SSE. All Rights Reserved.