public class ReasonerAdapter
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private class |
ReasonerAdapter.FrontendReasonerAdapter
Implements a full/fallback reasoner adapter.
|
private class |
ReasonerAdapter.InstanceReasonerAdapter
Implements an instance-based reasoner adapter.
|
private static interface |
ReasonerAdapter.IReasonerAdapter
Defines the interface of an abstracting reasoner adapter.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<net.ssehub.easy.varModel.confModel.Configuration,ReasonerAdapter.IReasonerAdapter> |
cache |
private ReasonerAdapter.IReasonerAdapter |
deflt |
private boolean |
enableInstanceBasedReasoning |
private static java.util.Map<java.lang.Thread,ReasonerAdapter> |
instances |
| Constructor and Description |
|---|
ReasonerAdapter()
Creates a reasoning adapter cache with instance-based reasoning allowed as default.
|
ReasonerAdapter(boolean enableInstanceBasedReasoning)
Creates a reasoning adapter cache.
|
| 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.
|
void |
clear()
Clears all cache entries.
|
void |
clear(net.ssehub.easy.varModel.confModel.Configuration config)
Clears the cache entry for
config if one was registered. |
ValueCreationResult |
createValue(net.ssehub.easy.varModel.confModel.Configuration cfg,
net.ssehub.easy.varModel.model.AbstractVariable var,
net.ssehub.easy.varModel.model.datatypes.IDatatype type,
ReasonerConfiguration reasonerConfiguration,
net.ssehub.easy.basics.progress.ProgressObserver observer)
Creates the value for a certain IVML type/variable.
|
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.
|
private ReasonerAdapter.IReasonerAdapter |
getAdapter(net.ssehub.easy.varModel.confModel.Configuration cfg,
ReasonerConfiguration reasonerConfiguration)
Returns the adapter for the given configuration.
|
static ReasonerAdapter |
getInstance()
Returns the registered instance for the current thread.
|
static ReasonerAdapter |
getInstanceSafe()
Returns the registered instance for the current thread.
|
ReasoningResult |
isConsistent(net.ssehub.easy.varModel.confModel.Configuration cfg,
ReasonerConfiguration reasonerConfiguration,
net.ssehub.easy.basics.progress.ProgressObserver observer)
Checks whether a given variability model (project) is satisfiable.
|
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 |
register(net.ssehub.easy.varModel.confModel.Configuration config)
Registers for a reasoning adapter (cache entry) for
config for instance-based reasoning. |
static void |
registerInstance(ReasonerAdapter adapter)
Registers an instance for the current thread.
|
void |
setEnableInstanceBasedReasoning(boolean enableInstanceBasedReasoning)
Defines whether instance-based reasoning shall be allowed/supported.
|
static void |
unregisterInstance()
Unregisters an instance for the current thread.
|
private static java.util.Map<java.lang.Thread,ReasonerAdapter> instances
private java.util.Map<net.ssehub.easy.varModel.confModel.Configuration,ReasonerAdapter.IReasonerAdapter> cache
private ReasonerAdapter.IReasonerAdapter deflt
private boolean enableInstanceBasedReasoning
public ReasonerAdapter()
public ReasonerAdapter(boolean enableInstanceBasedReasoning)
enableInstanceBasedReasoning - whether instance-based reasoning shall be allowedprivate ReasonerAdapter.IReasonerAdapter getAdapter(net.ssehub.easy.varModel.confModel.Configuration cfg, ReasonerConfiguration reasonerConfiguration)
cfg - The configuration to reason on.reasonerConfiguration - the reasoner configuration to be used for reasoning (e.g. taken from the UI,
may be null)public ReasoningResult isConsistent(net.ssehub.easy.varModel.confModel.Configuration cfg, ReasonerConfiguration reasonerConfiguration, net.ssehub.easy.basics.progress.ProgressObserver observer)
cfg - The configuration to reason on.observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unusedreasonerConfiguration - the reasoner configuration to be used for reasoning (e.g. taken from the UI,
may be null)Status.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)
cfg - The 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)
cfg - 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)
cfg - The configuration to reason on.constraints - 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 ValueCreationResult createValue(net.ssehub.easy.varModel.confModel.Configuration cfg, net.ssehub.easy.varModel.model.AbstractVariable var, net.ssehub.easy.varModel.model.datatypes.IDatatype type, ReasonerConfiguration reasonerConfiguration, net.ssehub.easy.basics.progress.ProgressObserver observer)
cfg - the configuration to operate on (will not be modified)var - 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)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 unusedpublic void setEnableInstanceBasedReasoning(boolean enableInstanceBasedReasoning)
enableInstanceBasedReasoning - whether instance-based reasoning shall be allowedpublic void clear()
public void clear(net.ssehub.easy.varModel.confModel.Configuration config)
config if one was registered.config - the configuration to prepare for (ignored if null)public void register(net.ssehub.easy.varModel.confModel.Configuration config)
config for instance-based reasoning.
Already registered configurations are not re-registered.config - the configuration to prepare for (ignored if null)public static void registerInstance(ReasonerAdapter adapter)
adapter - the adapter instance to registerpublic static void unregisterInstance()
public static ReasonerAdapter getInstance()
public static ReasonerAdapter getInstanceSafe()
Copyright © 2009 - 2018 SSE. All Rights Reserved.