Class DefaultStreamBasedInconsistencyMeasure<S extends Formula>
- java.lang.Object
-
- net.sf.tweety.logics.commons.analysis.BeliefSetInconsistencyMeasure<S>
-
- net.sf.tweety.logics.commons.analysis.streams.StreamBasedInconsistencyMeasure<S>
-
- net.sf.tweety.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 net.sf.tweety.logics.commons.analysis.InconsistencyMeasure
MEASURE_TOLERANCE
-
-
Constructor Summary
Constructors Constructor Description DefaultStreamBasedInconsistencyMeasure(java.lang.Class<? extends InconsistencyMeasurementProcess<S>> clazz)Creates a new inconsistency measure based on the given process class.DefaultStreamBasedInconsistencyMeasure(java.lang.Class<? extends InconsistencyMeasurementProcess<S>> clazz, java.util.Map<java.lang.String,java.lang.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 Type Method Description voidaddInconsistencyListener(InconsistencyListener listener)Add a listener to this measure.voidfireInconsistencyUpdateEvent(InconsistencyUpdateEvent evt)InconsistencyMeasurementProcess<S>getInconsistencyMeasureProcess(FormulaStream<S> stream)Processes the formulas in the given stream one after the other.java.lang.DoubleinconsistencyMeasure(java.util.Collection<S> formulas)This method measures the inconsistency of the given set of formulas.voidremoveInconsistencyListener(InconsistencyListener listener)Remove a listener from this measure.java.lang.StringtoString()-
Methods inherited from class net.sf.tweety.logics.commons.analysis.BeliefSetInconsistencyMeasure
inconsistencyMeasure
-
-
-
-
Constructor Detail
-
DefaultStreamBasedInconsistencyMeasure
public DefaultStreamBasedInconsistencyMeasure(java.lang.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(java.lang.Class<? extends InconsistencyMeasurementProcess<S>> clazz, java.util.Map<java.lang.String,java.lang.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 Detail
-
inconsistencyMeasure
public java.lang.Double inconsistencyMeasure(java.util.Collection<S> formulas)
Description copied from class:BeliefSetInconsistencyMeasureThis method measures the inconsistency of the given set of formulas.- Specified by:
inconsistencyMeasurein classStreamBasedInconsistencyMeasure<S extends Formula>- Parameters:
formulas- a collection of formulas.- Returns:
- a Double indicating the degree of inconsistency.
-
getInconsistencyMeasureProcess
public InconsistencyMeasurementProcess<S> getInconsistencyMeasureProcess(FormulaStream<S> stream)
Description copied from class:StreamBasedInconsistencyMeasureProcesses 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:
getInconsistencyMeasureProcessin classStreamBasedInconsistencyMeasure<S extends Formula>- Parameters:
stream- some formula stream.- Returns:
- an inconsistency measurement process.
-
addInconsistencyListener
public void addInconsistencyListener(InconsistencyListener listener)
Description copied from class:StreamBasedInconsistencyMeasureAdd a listener to this measure.- Specified by:
addInconsistencyListenerin classStreamBasedInconsistencyMeasure<S extends Formula>- Parameters:
listener- the listener to be added.
-
removeInconsistencyListener
public void removeInconsistencyListener(InconsistencyListener listener)
Description copied from class:StreamBasedInconsistencyMeasureRemove a listener from this measure.- Specified by:
removeInconsistencyListenerin classStreamBasedInconsistencyMeasure<S extends Formula>- Parameters:
listener- the listener to be removed.
-
fireInconsistencyUpdateEvent
public void fireInconsistencyUpdateEvent(InconsistencyUpdateEvent evt)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-