This class defines a class to calculates a weight for a GPM using Inverse Distance strategy. More...
#include <GPMWeightsInverseDistanceStrategy.h>
Public Member Functions | |
| GPMWeightsInverseDistanceStrategy (bool normalize, double a=1.0, double factor=1.0) | |
| Default constructor. More... | |
| virtual | ~GPMWeightsInverseDistanceStrategy () |
| Virtual destructor. More... | |
Methods | |
Methods used by the GPM constructor | |
| virtual void | calculate (GeneralizedProximityMatrix *gpm) |
Protected Attributes | |
| double | m_a |
| double | m_factor |
| GeneralizedProximityMatrix * | m_gpm |
| GPM Pointer. More... | |
| bool | m_normalize |
| GPMWeightsStrategyType | m_type |
| Weight Type. More... | |
Methods | |
| GPMWeightsStrategyType | getWeightsType () |
| int | createWeightAttribute (GeneralizedProximityMatrix *gpm) |
| Added to the edge a new attribute for weight information and return the attr index. More... | |
| bool | getDistanceAttributeIndex (te::graph::GraphMetadata *gm, int &index) |
| Function used to get the distance attribute index. More... | |
| double | getDistanceAttributeValue (te::graph::Edge *e, const int index) |
| Function used to get the distance value from a edge element. More... | |
This class defines a class to calculates a weight for a GPM using Inverse Distance strategy.
Formula: w = (a*1/dist_centroids + b*1/dist_to_net + c*1/dist_net_connection)*factor
These values can be normalized or not.
Definition at line 57 of file GPMWeightsInverseDistanceStrategy.h.
| te::sa::GPMWeightsInverseDistanceStrategy::GPMWeightsInverseDistanceStrategy | ( | bool | normalize, |
| double | a = 1.0, |
||
| double | factor = 1.0 |
||
| ) |
Default constructor.
Definition at line 36 of file GPMWeightsInverseDistanceStrategy.cpp.
References te::sa::InverseDistanceStrategy, te::sa::GPMWeightsAbstractStrategy::m_type, and ~GPMWeightsInverseDistanceStrategy().
|
virtualdefault |
Virtual destructor.
Referenced by GPMWeightsInverseDistanceStrategy().
|
virtual |
Implements te::sa::GPMWeightsAbstractStrategy.
Definition at line 46 of file GPMWeightsInverseDistanceStrategy.cpp.
References te::graph::Edge::addAttribute(), te::sa::GPMWeightsAbstractStrategy::createWeightAttribute(), te::sa::GPMWeightsAbstractStrategy::getDistanceAttributeIndex(), te::sa::GPMWeightsAbstractStrategy::getDistanceAttributeValue(), te::graph::GraphMetadata::getEdgePropertySize(), te::graph::MemoryIterator::getFirstVertex(), te::sa::GeneralizedProximityMatrix::getGraph(), te::graph::AbstractGraph::getMetadata(), te::graph::MemoryIterator::getNextVertex(), te::graph::Vertex::getSuccessors(), m_a, m_factor, m_normalize, and te::graph::Edge::setAttributeVecSize().
|
protectedinherited |
Added to the edge a new attribute for weight information and return the attr index.
Definition at line 49 of file GPMWeightsAbstractStrategy.cpp.
References te::graph::AbstractGraph::addEdgeProperty(), te::dt::DOUBLE_TYPE, te::graph::AbstractGraph::getEdgePropertySize(), te::sa::GeneralizedProximityMatrix::getGraph(), p, te::dt::Property::setId(), te::dt::Property::setParent(), and TE_SA_WEIGHT_ATTR_NAME.
Referenced by te::sa::GPMWeightsNoWeightsStrategy::calculate(), calculate(), and te::sa::GPMWeightsSquaredInverseDistanceStrategy::calculate().
|
protectedinherited |
Function used to get the distance attribute index.
Definition at line 65 of file GPMWeightsAbstractStrategy.cpp.
References te::graph::GraphMetadata::getEdgeProperty(), te::graph::GraphMetadata::getEdgePropertySize(), te::dt::Property::getName(), and TE_SA_DISTANCE_ATTR_NAME.
Referenced by calculate(), and te::sa::GPMWeightsSquaredInverseDistanceStrategy::calculate().
|
protectedinherited |
Function used to get the distance value from a edge element.
Definition at line 79 of file GPMWeightsAbstractStrategy.cpp.
References te::graph::Edge::getAttributes(), and te::dt::SimpleData< T, typeCode >::getValue().
Referenced by calculate(), and te::sa::GPMWeightsSquaredInverseDistanceStrategy::calculate().
|
inherited |
Definition at line 44 of file GPMWeightsAbstractStrategy.cpp.
References te::sa::GPMWeightsAbstractStrategy::m_type.
|
protected |
Definition at line 83 of file GPMWeightsInverseDistanceStrategy.h.
Referenced by calculate().
|
protected |
Definition at line 85 of file GPMWeightsInverseDistanceStrategy.h.
Referenced by calculate().
|
protectedinherited |
GPM Pointer.
Definition at line 97 of file GPMWeightsAbstractStrategy.h.
|
protected |
Definition at line 81 of file GPMWeightsInverseDistanceStrategy.h.
Referenced by calculate().
|
protectedinherited |
Weight Type.
Definition at line 95 of file GPMWeightsAbstractStrategy.h.
Referenced by te::sa::GPMWeightsAbstractStrategy::getWeightsType(), GPMWeightsInverseDistanceStrategy(), te::sa::GPMWeightsNoWeightsStrategy::GPMWeightsNoWeightsStrategy(), and te::sa::GPMWeightsSquaredInverseDistanceStrategy::GPMWeightsSquaredInverseDistanceStrategy().