public class LocalDistanceSequencesDIST4MADCAPPablo extends LocalDistance
LocalDistance
Constructor and Description |
---|
LocalDistanceSequencesDIST4MADCAPPablo() |
Modifier and Type | Method and Description |
---|---|
float |
distance(java.lang.Object b,
java.lang.Object a)
Metric function used to assert if a sequence contains another.
|
float |
similitude(java.util.ArrayList<java.lang.String> s1,
java.util.ArrayList<java.lang.String> s2)
Returns the similitude between a container sequence and a contained one.
|
computeDistance, setMissingMethod
public LocalDistanceSequencesDIST4MADCAPPablo()
public float distance(java.lang.Object b, java.lang.Object a)
The algorithm has been designed with the purpose of return a weighted output depending on the following properties:
Our notation assumes that within sequences, elements located at position 0 will be the last ones recorded, the newest ones, and the ones located at |s1|-1 or |s2|-1 the oldest ones. Basically, the algorithm to estimate the distances is composed of two parts. The first one is the index function, which return where the contained sequence element s2j is located inside the stream sequence s1. The search will be done after the specified position i, since it represents where s2j-1 was found. If s2j cannot be found in stream s1, it will be assigned the maximum value possible |s1|. The second part is the algorithm itself, where, for each event pattern inside s2, positions retrieved by function index are exponentially accumulated. If the last contained sequence element was not found, the index i remains the same and we continue looking from there.
distance
in class LocalDistance
b
- Object.a
- Object.public float similitude(java.util.ArrayList<java.lang.String> s1, java.util.ArrayList<java.lang.String> s2)
s1
- Container sequences2
- Contained sequence