## Interface SMInterval

• All Superinterfaces:
SimilarityMeasure
All Known Implementing Classes:
SMIntervalImpl

public interface SMInterval
extends SimilarityMeasure
The attribute value in the query and in the case are intervals. We name the query interval $x_i = [x_{ilb},x_{iub}]$, the case interval $y_i = [y_{ilb},y_{iub}]$, and a possible intersection $z_i = [z_{ilb},z_{iub}]$. We have to distinguish the four combinations of the knowledge types.

The interval in the case means that a valid value exists in this range, but it is not sure where it is. It can't be assumed that valid values are in the intersection of query and case interval. Therefore, the three strategies must be distinguished:

The optimistic one assumes that valid points are in the intersection. With the imprecise query one point is requested from all the possible points of the precise case. Therefore, we just have to distinguish the following two situations:

• $z_i \not= \emptyset$: The local similarity is one, because an arbitrary element of $z_i$ or $z_i$ itself can be returned.
• $z_i = \emptyset$: The local similarity must consider the distance'' from $x_{ilb}$ to $y_{iub}$ and $x_{iub}$ to $y_{ilb}$, so that $sim^*_{Ai}(x_i,y_i) = \max\left(sim_{Ai}(x_{ilb},y_{iub}), sim_{Ai}(x_{iub},y_{ilb})\right)$

Summarizing, a local similarity measure can be defined as: $sim^*_{Ai}(x_i, y_i) = \left\{ \begin{array}{c@{\quad}l} 1 & \mbox{if} \quad z_i \not= \emptyset\\ \max\left(\begin{array}{l} sim_{Ai}(x_{ilb},y_{iub}),\\ sim_{Ai}(x_{iub},y_{ilb}) \end{array}\right) & \mbox{otherwise} \end{array} \right.$

The pessimistic strategy assumes that no valid point is in the intersection which leads to the local similarity $sim^*_{Ai}(x_i, y_i)=\\underset{\forall x_{is}\in x_i, y_{it}\in y_i}{\min}\left\{sim_{Ai}(x_{is},y_{it})\right\}$

The average strategy calculates the probability that a valid point is in the intersection $z_i$, e.g. by calculating the relation between the intersection size and the case interval size. Consequently, the similarity measure is defined as: $sim^*_{Ai}(x_i, y_i) = \begin{cases} \frac{|y_{iub}-y_{ilb}|}{|z_{iub}-z_{ilb}|} & \text{, if } z_i =\not \emptyset \\ 0 &, otherwise \end{cases}$

Author:
Rainer Maximini
• ### Field Summary

Fields
Modifier and Type Field Description
static Strategy DEFAULT_STRATEGY
Default strategy for similarity computations is .
static String NAME
Name of similarity measure is "Interval".
• ### Fields inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure

COMPONENT, COMPONENT_KEY, LOG_ORDER_NAME_NOT_FOUND
• ### Method Summary

All Methods
Modifier and Type Method Description
String getOrderName()
String getSimilarityToUse()
Strategy getStrategy()
void removeOrder()
Similarity measure for intervals can work also on the natural order of a AtomicDataClass if available.
void setOrderName​(String orderName)
void setSimilarityToUse​(String newValue)
In general, the element objects of the interval are compared with their default similarity measure.
void setStrategy​(Strategy strategy)
• ### Methods inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure

compute, getDataClass, getName, getSystemName, isForceOverride, isReusable, setForceOverride
• ### Field Detail

• #### NAME

static final String NAME
Name of similarity measure is "Interval".
Constant Field Values
• #### DEFAULT_STRATEGY

static final Strategy DEFAULT_STRATEGY
Default strategy for similarity computations is .
• ### Method Detail

• #### getOrderName

String getOrderName()
• #### setOrderName

void setOrderName​(String orderName)
throws NameNotFoundException
Throws:
NameNotFoundException
• #### setSimilarityToUse

void setSimilarityToUse​(String newValue)
In general, the element objects of the interval are compared with their default similarity measure. But in some situations it can be necessary to use another similarity measure for the elements of an interval. Therefore, it exists the possibility to specify a similarity measure name that should be used instead. For each DataObject a similarity measure with that name should exist. Otherwise, the comparision of objects are ignored.

Summarizing:

• If the newValue is null the default measures of the objects are used. This is the default behaviour.
• If the newValue is the name of a similarity measure, for each data class whose objects can be occured in the interval a similarity measure with this name must exist.
Parameters:
newValue - The name of the similarity measure that should be used for the elements.
• #### getStrategy

Strategy getStrategy()
• #### setStrategy

void setStrategy​(Strategy strategy)
• #### removeOrder

void removeOrder()
Similarity measure for intervals can work also on the natural order of a AtomicDataClass if available. Therefore, it is possible to remove an already assigned order.