Class DefaultStreamBasedInconsistencyMeasure<S extends Formula>
java.lang.Object
org.tweetyproject.logics.commons.analysis.BeliefSetInconsistencyMeasure<S>
org.tweetyproject.logics.commons.analysis.streams.StreamBasedInconsistencyMeasure<S>
org.tweetyproject.logics.commons.analysis.streams.DefaultStreamBasedInconsistencyMeasure<S>
- Type Parameters:
S
- The type of formulas
- All Implemented Interfaces:
PostulateEvaluatable<S>
,InconsistencyMeasure<BeliefSet<S,
?>>
public class DefaultStreamBasedInconsistencyMeasure<S extends Formula>
extends StreamBasedInconsistencyMeasure<S>
Implements a stream-based inconsistency measure on a given class of
inconsistency measurement processes.
- Author:
- Matthias Thimm
-
Field Summary
Fields inherited from interface org.tweetyproject.logics.commons.analysis.InconsistencyMeasure
MEASURE_TOLERANCE
-
Constructor Summary
ConstructorDescriptionDefaultStreamBasedInconsistencyMeasure
(Class<? extends InconsistencyMeasurementProcess<S>> clazz) Creates a new inconsistency measure based on the given process class.DefaultStreamBasedInconsistencyMeasure
(Class<? extends InconsistencyMeasurementProcess<S>> clazz, Map<String, Object> config) Creates a new inconsistency measure based on the given process class and the given configuration options for that process. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener to this measure.void
getInconsistencyMeasureProcess
(FormulaStream<S> stream) Processes the formulas in the given stream one after the other.inconsistencyMeasure
(Collection<S> formulas) This method measures the inconsistency of the given set of formulas.void
Remove a listener from this measure.toString()
Methods inherited from class org.tweetyproject.logics.commons.analysis.BeliefSetInconsistencyMeasure
inconsistencyMeasure
-
Constructor Details
-
DefaultStreamBasedInconsistencyMeasure
public DefaultStreamBasedInconsistencyMeasure(Class<? extends InconsistencyMeasurementProcess<S>> clazz) Creates a new inconsistency measure based on the given process class.- Parameters:
clazz
- some inconsistency measurement process class.
-
DefaultStreamBasedInconsistencyMeasure
public DefaultStreamBasedInconsistencyMeasure(Class<? extends InconsistencyMeasurementProcess<S>> clazz, Map<String, Object> config) Creates a new inconsistency measure based on the given process class and the given configuration options for that process.- Parameters:
clazz
- some inconsistency measurement process class.config
- configuration options for that class.
-
-
Method Details
-
inconsistencyMeasure
Description copied from class:BeliefSetInconsistencyMeasure
This method measures the inconsistency of the given set of formulas.- Specified by:
inconsistencyMeasure
in classStreamBasedInconsistencyMeasure<S extends Formula>
- Parameters:
formulas
- a collection of formulas.- Returns:
- a Double indicating the degree of inconsistency.
-
getInconsistencyMeasureProcess
Description copied from class:StreamBasedInconsistencyMeasure
Processes the formulas in the given stream one after the other. After each update an event of type "InconsistencyUpdateEvent" is created and listeners are notified. This method creates and starts a new object of type "InconsistencyMeasurementProcess" that processes the stream in a separate thread, and returns it. The current value of inconsistency can be retrieved by the "getInconsistencyValue()" of that process and measurement can be aborted by calling its "abort()" method.- Specified by:
getInconsistencyMeasureProcess
in classStreamBasedInconsistencyMeasure<S extends Formula>
- Parameters:
stream
- some formula stream.- Returns:
- an inconsistency measurement process.
-
addInconsistencyListener
Description copied from class:StreamBasedInconsistencyMeasure
Add a listener to this measure.- Specified by:
addInconsistencyListener
in classStreamBasedInconsistencyMeasure<S extends Formula>
- Parameters:
listener
- the listener to be added.
-
removeInconsistencyListener
Description copied from class:StreamBasedInconsistencyMeasure
Remove a listener from this measure.- Specified by:
removeInconsistencyListener
in classStreamBasedInconsistencyMeasure<S extends Formula>
- Parameters:
listener
- the listener to be removed.
-
fireInconsistencyUpdateEvent
-
toString
-