Class InconsistencyMeasurementProcess<S extends Formula>
- java.lang.Object
-
- java.lang.Thread
-
- net.sf.tweety.logics.commons.analysis.streams.InconsistencyMeasurementProcess<S>
-
- Type Parameters:
S
- The type of formulas.
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
ContensionInconsistencyMeasurementProcess
,HsInconsistencyMeasurementProcess
,WindowInconsistencyMeasurementProcess
public abstract class InconsistencyMeasurementProcess<S extends Formula> extends java.lang.Thread
The actual process of an inconsistency measure on streams.- Author:
- Matthias Thimm
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
InconsistencyMeasurementProcess.UpdateCallee
For handling timeouts.
-
Field Summary
Fields Modifier and Type Field Description private boolean
abort
Whether execution should be aborted.static java.lang.String
CONFIG_TIMEOUT
Key for the configuration map that gives a time out (given in seconds) for a single update operation Default value is -1 which means no time out.private java.lang.Double
iValue
The current inconsistency value.private StreamBasedInconsistencyMeasure<S>
parent
The measure from where this process has been dispatched.private FormulaStream<S>
stream
The stream.private long
timeout
Time out for the update operation (in seconds).
-
Constructor Summary
Constructors Constructor Description InconsistencyMeasurementProcess()
Creates a new process for the given stream.
-
Method Summary
Modifier and Type Method Description void
abort()
Aborts the measurement of a stream.java.lang.Double
getInconsistencyValue()
Returns the current inconsistency value of this stream processing or the last value if the stream processing has finalized.protected abstract void
init(java.util.Map<java.lang.String,java.lang.Object> config)
Additional initialization statements are put here.protected void
init(FormulaStream<S> stream, StreamBasedInconsistencyMeasure<S> parent, java.util.Map<java.lang.String,java.lang.Object> config)
Initialization statements.void
run()
abstract java.lang.String
toString()
protected abstract double
update(S formula)
Updates the inconsistency value with the new formula.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
-
-
-
-
Field Detail
-
CONFIG_TIMEOUT
public static final java.lang.String CONFIG_TIMEOUT
Key for the configuration map that gives a time out (given in seconds) for a single update operation Default value is -1 which means no time out.- See Also:
- Constant Field Values
-
stream
private FormulaStream<S extends Formula> stream
The stream.
-
abort
private boolean abort
Whether execution should be aborted.
-
iValue
private java.lang.Double iValue
The current inconsistency value.
-
parent
private StreamBasedInconsistencyMeasure<S extends Formula> parent
The measure from where this process has been dispatched.
-
timeout
private long timeout
Time out for the update operation (in seconds).
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
init
protected void init(FormulaStream<S> stream, StreamBasedInconsistencyMeasure<S> parent, java.util.Map<java.lang.String,java.lang.Object> config)
Initialization statements.- Parameters:
stream
- some formula stream.parent
- the measure from where this process has been dispatched.config
- configuration options for the specific process.
-
init
protected abstract void init(java.util.Map<java.lang.String,java.lang.Object> config)
Additional initialization statements are put here.- Parameters:
config
- the configuration
-
update
protected abstract double update(S formula)
Updates the inconsistency value with the new formula.- Parameters:
formula
- some formula.- Returns:
- the current inconsistency value.
-
toString
public abstract java.lang.String toString()
- Overrides:
toString
in classjava.lang.Thread
-
abort
public void abort()
Aborts the measurement of a stream.
-
getInconsistencyValue
public java.lang.Double getInconsistencyValue()
Returns the current inconsistency value of this stream processing or the last value if the stream processing has finalized.- Returns:
- the current inconsistency value.
-
-