|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgorithm.psgm.CostGetter
public class CostGetter
Given two skeletons, get the costs to match two specified end nodes by first
creating a path distance matrix and then applying OSBv5 to this
matrix.
| Field Summary | |
|---|---|
private Config |
config
holding configuration parameters |
private org.apache.log4j.Logger |
logger
logger instance |
(package private) double |
normalizationFactor
factor to multiply all path lengths with to make the algorithm invariant to scale. |
private SkeletonObject |
so1
first skeleton object to be matched |
private SkeletonObject |
so2
second skeleton object to be matched |
| Constructor Summary | |
|---|---|
CostGetter(SkeletonObject so1,
SkeletonObject so2,
Config config)
Constructor. |
|
| Method Summary | |
|---|---|
double |
getCost(SkeletonNode sn1,
SkeletonNode sn2)
Get the matching costs for the two specified end nodes. |
private double |
getMaximalPathLength(SkeletonObject so)
get the length of the longest path in the specified skeleton object. |
private void |
getNormalizationFactor()
Get the normalization factor. |
double |
getPathDistanceByPath(SkeletonPath p1,
SkeletonPath p2)
Get the path distance between the two specified skeleton paths. |
double |
getPathDistanceByPathLength(SkeletonPath p1,
SkeletonPath p2)
Get the path distance between a pair of skeleton paths, based on their path length. |
double[][] |
getPathDistanceMatrix(SkeletonNode sn1,
SkeletonNode sn2)
Get the path distance matrix for a pair of end nodes to be matched. |
private java.util.List<SkeletonPath> |
wrapList(java.util.List<SkeletonPath> toBeWrapped,
int index)
Rotate a list of skeleton paths by the given distance by using Collections.rotate(List, int). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final org.apache.log4j.Logger logger
private final SkeletonObject so1
private final SkeletonObject so2
private final Config config
double normalizationFactor
| Constructor Detail |
|---|
public CostGetter(SkeletonObject so1,
SkeletonObject so2,
Config config)
so1 - - the first skeleton object to be matched. Make sure this is
the one with lesser end nodes.so2 - - the second skeleton object to be matched. Make sure this the
one with more end nodes.config - - holding all configuration parameters| Method Detail |
|---|
public double getCost(SkeletonNode sn1,
SkeletonNode sn2)
throws InvalidSkeletonException,
InvalidWeightFunctionGivenException
sn1 - - a skeleton node from so1 to be matchedsn2 - - a skeleton node from so2 to be matched
InvalidSkeletonException - if one of the skeletons seems broken
InvalidWeightFunctionGivenException - if no valid weight function could be constructed from the
path distances
public double[][] getPathDistanceMatrix(SkeletonNode sn1,
SkeletonNode sn2)
throws InvalidSkeletonException
sn1 - the end node from the first skeletonsn2 - the end node from the second skeleton
InvalidSkeletonException - if the skeleton seems to be broken
public double getPathDistanceByPathLength(SkeletonPath p1,
SkeletonPath p2)
p1 - the first skeleton pathp2 - the second skeleton path
public double getPathDistanceByPath(SkeletonPath p1,
SkeletonPath p2)
SkeletonPath.getVectorRepresentation() for more information.
p1 - - a skeleton path from skeleton so1p2 - - a skeleton path from skeleton so2
private void getNormalizationFactor()
private java.util.List<SkeletonPath> wrapList(java.util.List<SkeletonPath> toBeWrapped,
int index)
Collections.rotate(List, int). The original list is copied
before, so the original list is not changed by this function.
toBeWrapped - - the list of skeleton paths to be rotated.index - - the value by that the list will be rotated.
private double getMaximalPathLength(SkeletonObject so)
so - the skeleton object where the longest path is searched
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||