Class InconsistencyMeasureResult
java.lang.Object
org.tweetyproject.logics.commons.analysis.InconsistencyMeasureResult
This class represents the results the result of a call to an inconsistency measure
with a knowledge base, i.e. the inconsistency value, if found, the computation
time and the timeout status.
- Author:
- Anna Gessler
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum representing the status of anInconsistencyMeasureResult
. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the time elapsed during the computation, in milliseconds.Returns the status of the inconsistency measure result.double
getValue()
Returns the computed inconsistency value.static InconsistencyMeasureResult
ok
(double result) Creates anInconsistencyMeasureResult
with the given inconsistency value.void
setElapsedTime
(long time) Sets the elapsed time for the computation.static InconsistencyMeasureResult
timeout()
Creates anInconsistencyMeasureResult
indicating a timeout.
-
Method Details
-
timeout
Creates anInconsistencyMeasureResult
indicating a timeout.- Returns:
- an
InconsistencyMeasureResult
withStatus.TIMEOUT
.
-
ok
Creates anInconsistencyMeasureResult
with the given inconsistency value.- Parameters:
result
- the computed inconsistency value.- Returns:
- an
InconsistencyMeasureResult
withStatus.OK
.
-
getStatus
Returns the status of the inconsistency measure result.- Returns:
- the status, either
OK
orTIMEOUT
.
-
getValue
public double getValue()Returns the computed inconsistency value.If the status is
TIMEOUT
, this value will be -1.0.- Returns:
- the inconsistency value.
-
getElapsedTime
public long getElapsedTime()Returns the time elapsed during the computation, in milliseconds.If the status is
TIMEOUT
, the elapsed time may not be meaningful.- Returns:
- the elapsed time in milliseconds.
-
setElapsedTime
public void setElapsedTime(long time) Sets the elapsed time for the computation.This method only has an effect if the status is
OK
. If the status isTIMEOUT
, the elapsed time remains unchanged.- Parameters:
time
- the elapsed time in milliseconds.
-