Class DefaultStreamBasedInconsistencyMeasure<S extends net.sf.tweety.commons.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:
net.sf.tweety.commons.postulates.PostulateEvaluatable<S>,InconsistencyMeasure<net.sf.tweety.commons.BeliefSet<S,?>>
public class DefaultStreamBasedInconsistencyMeasure<S extends net.sf.tweety.commons.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(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 Type Method Description voidaddInconsistencyListener(InconsistencyListener listener)Add a listener to this measure.voidfireInconsistencyUpdateEvent(InconsistencyUpdateEvent evt)InconsistencyMeasurementProcess<S>getInconsistencyMeasureProcess(net.sf.tweety.commons.streams.FormulaStream<S> stream)Processes the formulas in the given stream one after the other.DoubleinconsistencyMeasure(Collection<S> formulas)This method measures the inconsistency of the given set of formulas.voidremoveInconsistencyListener(InconsistencyListener listener)Remove a listener from this measure.StringtoString()-
Methods inherited from class net.sf.tweety.logics.commons.analysis.BeliefSetInconsistencyMeasure
inconsistencyMeasure
-
-
-
-
Constructor Detail
-
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 Detail
-
inconsistencyMeasure
public Double inconsistencyMeasure(Collection<S> formulas)
Description copied from class:BeliefSetInconsistencyMeasureThis method measures the inconsistency of the given set of formulas.- Specified by:
inconsistencyMeasurein classStreamBasedInconsistencyMeasure<S extends net.sf.tweety.commons.Formula>- Parameters:
formulas- a collection of formulas.- Returns:
- a Double indicating the degree of inconsistency.
-
getInconsistencyMeasureProcess
public InconsistencyMeasurementProcess<S> getInconsistencyMeasureProcess(net.sf.tweety.commons.streams.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 net.sf.tweety.commons.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 net.sf.tweety.commons.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 net.sf.tweety.commons.Formula>- Parameters:
listener- the listener to be removed.
-
fireInconsistencyUpdateEvent
public void fireInconsistencyUpdateEvent(InconsistencyUpdateEvent evt)
-
-