public class AlignmentSpecification extends IndexingScheme implements Cloneable
Constructor and Description |
---|
AlignmentSpecification(AlignmentSpecification other)
Constructs a copy of the given other AlignmentSpecification.
|
AlignmentSpecification(NodeSpecification nodeSpecification,
Comparator[] comparators) |
AlignmentSpecification(NodeSpecification nodeSpecification,
String[] keywords,
Comparator[] comparators) |
AlignmentSpecification(NodeSpecification nodeSpecification,
String[] keywords,
Comparator[] comparators,
double[] weighting) |
Modifier and Type | Method and Description |
---|---|
double[] |
calculateDeletionCosts(Node a)
This calculates the non-weighted costs for deleting the single values in
node a.
|
double[] |
calculateInsertionCosts(Node b)
This calculates the non-weighted costs for inserting the single values of
node b.
|
double[] |
calculateReplacementCosts(Node a,
Node b)
This calculates the non-weighted costs for replacing the single values in
node a by the values in node b.
|
double[] |
calculateSkipDeletionCosts(Node a)
This calculates the non-weighted costs for skip-deleting the single
values in node a.
|
double[] |
calculateSkipInsertionCosts(Node b)
This calculates the non-weighted costs for skip-inserting the single
values of node b.
|
protected Object |
clone() |
boolean |
equals(Object obj) |
Comparator |
getComparator(int index)
Returns the Comparator that is currently set for the given keyword.
|
Comparator |
getComparator(String keyword)
Returns the Comparator that is currently set for the given keyword.
|
NodeSpecification |
getNodeSpecification() |
int |
getOriginalIndex(int index)
This is semantically equivalent to
getNodeSpecification().getKeywordIndex(getKeyword(index)) but this is
preprocessed here for better performance.
|
double[] |
getWeighting()
Returns the current keyword weighting.
|
int |
hashCode() |
static boolean |
isValidWeighting(double[] weighting)
This checks whether the given weighting is a valid one.
|
void |
setComparator(int index,
Comparator comparator)
Sets the comparator for a given keyword.
|
void |
setComparator(String keyword,
Comparator comparator)
Sets the comparator for a given keyword.
|
void |
setWeighting(double[] weighting)
This sets the current weighting of keywords.
|
String |
toString() |
getKeyword, getKeywordIndex, getKeywords, hasKeyword, size
public AlignmentSpecification(AlignmentSpecification other)
other
- another AlignmentSpecification that shall be copied.public AlignmentSpecification(NodeSpecification nodeSpecification, Comparator[] comparators)
nodeSpecification
- The node specification that is the basis of all
sequences for this alignment.comparators
- the comparators that shall be used for the keywords.
Please note that these have to match the types of the keywords.public AlignmentSpecification(NodeSpecification nodeSpecification, String[] keywords, Comparator[] comparators)
nodeSpecification
- The node specification that is the basis of all
sequences for this alignment.keywords
- The keywords that shall be used in this alignment. This
has to be a subset of the keywords in the node specification.comparators
- the comparators that shall be used for the keywords.
Please note that these have to match the types of the keywords.public AlignmentSpecification(NodeSpecification nodeSpecification, String[] keywords, Comparator[] comparators, double[] weighting)
nodeSpecification
- The node specification that is the basis of all
sequences for this alignment.keywords
- The keywords that shall be used in this alignment. This
has to be a subset of the keywords in the node specification.comparators
- the comparators that shall be used for the keywords.
Please note that these have to match the types of the keywords.weighting
- the weights that highlight the importance of certain
keywords/features. These have to be double values between 0 and 1 that
add up to 1.public NodeSpecification getNodeSpecification()
public void setComparator(String keyword, Comparator comparator)
keyword
- a keyword that is used in this Alignment.comparator
- a fitting Comparator that defines a local normalized
distance on the values for the given keyword.public void setComparator(int index, Comparator comparator)
index
- a keyword index that is used in this Alignment.comparator
- a fitting Comparator that defines a local normalized
distance on the values for the given keyword.public Comparator getComparator(String keyword)
keyword
- a keyword that is used in this Alignment.public Comparator getComparator(int index)
index
- a keyword index that is used in this Alignment.public int getOriginalIndex(int index)
index
- a keyword index in this AlignmentSpecification.public void setWeighting(double[] weighting)
weighting
- a double vector fulfilling the criteria given above.public double[] getWeighting()
public double[] calculateReplacementCosts(Node a, Node b)
a
- The node from the left sequence.b
- The node from the right sequence.public double[] calculateDeletionCosts(Node a)
a
- The node from the left sequence.public double[] calculateInsertionCosts(Node b)
b
- The node from the right sequence.public double[] calculateSkipDeletionCosts(Node a)
a
- The node from the left sequence.public double[] calculateSkipInsertionCosts(Node b)
b
- The node from the right sequence.public static boolean isValidWeighting(double[] weighting)
weighting
- a double array that might be a weighting.public int hashCode()
hashCode
in class IndexingScheme
public boolean equals(Object obj)
equals
in class IndexingScheme
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright (C) 2013-2015 Benjamin Paaßen, Georg Zentgraf, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/