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, and te::sa::GPMWeightsAbstractStrategy::m_type.
|
virtual |
Virtual destructor.
Definition at line 44 of file GPMWeightsInverseDistanceStrategy.cpp.
|
virtual |
Implements te::sa::GPMWeightsAbstractStrategy.
Definition at line 48 of file GPMWeightsInverseDistanceStrategy.cpp.
References te::graph::Edge::addAttribute(), te::graph::GraphMetadata::getEdgePropertySize(), te::graph::MemoryIterator::getFirstVertex(), te::sa::GeneralizedProximityMatrix::getGraph(), te::graph::AbstractGraph::getMetadata(), te::graph::MemoryIterator::getNextVertex(), te::graph::Vertex::getSuccessors(), and te::graph::Edge::setAttributeVecSize().
|
protectedinherited |
Added to the edge a new attribute for weight information and return the attr index.
Definition at line 51 of file GPMWeightsAbstractStrategy.cpp.
References te::graph::AbstractGraph::addEdgeProperty(), te::dt::DOUBLE_TYPE, te::graph::AbstractGraph::getEdgePropertySize(), te::sa::GeneralizedProximityMatrix::getGraph(), te::dt::Property::setId(), te::dt::Property::setParent(), and TE_SA_WEIGHT_ATTR_NAME.
|
protectedinherited |
Function used to get the distance attribute index.
Definition at line 67 of file GPMWeightsAbstractStrategy.cpp.
References te::graph::GraphMetadata::getEdgeProperty(), te::graph::GraphMetadata::getEdgePropertySize(), te::dt::Property::getName(), and TE_SA_DISTANCE_ATTR_NAME.
|
protectedinherited |
Function used to get the distance value from a edge element.
Definition at line 81 of file GPMWeightsAbstractStrategy.cpp.
References te::graph::Edge::getAttributes(), and te::dt::SimpleData< T, typeCode >::getValue().
|
inherited |
Definition at line 46 of file GPMWeightsAbstractStrategy.cpp.
|
protected |
Definition at line 83 of file GPMWeightsInverseDistanceStrategy.h.
|
protected |
Definition at line 85 of file GPMWeightsInverseDistanceStrategy.h.
|
protectedinherited |
GPM Pointer.
Definition at line 97 of file GPMWeightsAbstractStrategy.h.
|
protected |
Definition at line 81 of file GPMWeightsInverseDistanceStrategy.h.
|
protectedinherited |
Weight Type.
Definition at line 95 of file GPMWeightsAbstractStrategy.h.
Referenced by GPMWeightsInverseDistanceStrategy(), te::sa::GPMWeightsNoWeightsStrategy::GPMWeightsNoWeightsStrategy(), and te::sa::GPMWeightsSquaredInverseDistanceStrategy::GPMWeightsSquaredInverseDistanceStrategy().