OverSim
StrategyRemoveInaccurate Class Reference

.h More...

#include <StrategyRemoveInaccurate.h>

Inheritance diagram for StrategyRemoveInaccurate:
StrategyRemoveCoords StrategySendAll AbstractSendStrategy

Public Member Functions

 StrategyRemoveInaccurate ()
virtual ~StrategyRemoveInaccurate ()
virtual void setMyCoordinates (const AbstractNcsNodeInfo &ncsInfo)
 need own implementation here, cause we need the error verctor as well
- Public Member Functions inherited from StrategyRemoveCoords
 StrategyRemoveCoords ()
virtual ~StrategyRemoveCoords ()
virtual GlobalViewBuilderCallgetCoordinateMessage ()
virtual std::string getStrategyCombinedParams ()
 return a string of the currently used strategy params
- Public Member Functions inherited from StrategySendAll
 StrategySendAll ()
 .cc
virtual ~StrategySendAll ()
virtual void handleCoordinateRpcCall (GlobalViewBuilderCall *globalViewBuilderCall)
virtual std::string getStrategyDataStatus ()
 return a short status of the running send strategy
virtual std::vector
< std::vector< double > > 
getGlobalViewData ()
 return the decodes global View Data
virtual void cleanUpCoordData (const treeNodeMap &currentTreeChildNodes)
 cleanup the coordinate map and remove data of nodes which are not longer in the branch
- Public Member Functions inherited from AbstractSendStrategy
 AbstractSendStrategy ()
 .cc
virtual ~AbstractSendStrategy ()
virtual void initialize (GlobalViewBuilder *globalViewBuilder)
 set a pointer to the neighborCache to access the optional parameters for the strategies
virtual void initializeStrategy ()
 stub method to initialize the concrete strategy
virtual void setThisNode (const NodeHandle thisNode)
 Set the Nodehandle of the own node to identify the own coordinates.

Protected Member Functions

void removeCoordinates (coordinatesVector *coords, int entrysToRemove)
 sorts the coordinatesVector by the last Value an removes the amount of entrys specified
- Protected Member Functions inherited from StrategyRemoveCoords
void processCoordinates (coordinatesVector *coords)
void removeCoordinatesByPercentage (coordinatesVector *coords, int percentage)
void removeCoordinatesByCoordLimit (coordinatesVector *coords, int coordLimit)
void removeCoordinatesByTrafficLimit (coordinatesVector *coords, int trafficLimit)
- Protected Member Functions inherited from StrategySendAll
void setBranchCoordinates (const NodeHandle &node, coordinatesVector coordsVector)
 Set the CoordinatesVector to the map, identified by the sender node.
const std::vector< std::vector
< double > > 
getCombinedCoordsVector ()
 Combine the coordinates of coordData map Structure to a single Vector of coordinates.
virtual int getSizeOfCoordVector (const coordinatesVector &combinedCoordsVector)
 calculate and return the size of the used coordinate data structure return int size
virtual int getSizeOfSingleCoordinate (const coordinatesVector &combinedCoordsVector)

Additional Inherited Members

- Protected Types inherited from StrategySendAll
typedef std::vector
< std::vector< double > > 
coordinatesVector
 The coordinatesVector is a vector of coordinates, where a coordinate itself is a vector of doubles (=Dimensions)
typedef std::pair
< TransportAddress,
coordinatesVector
nodeCoordData
typedef UNORDERED_MAP
< TransportAddress,
coordinatesVector,
TransportAddress::hashFcn
coordDataMap
- Protected Attributes inherited from StrategySendAll
coordDataMap coordData

Detailed Description

.h

Author
Daniel Lienert

Definition at line 30 of file StrategyRemoveInaccurate.h.

Constructor & Destructor Documentation

StrategyRemoveInaccurate::StrategyRemoveInaccurate ( )

Definition at line 29 of file StrategyRemoveInaccurate.cc.

{
// TODO Auto-generated constructor stub
}
StrategyRemoveInaccurate::~StrategyRemoveInaccurate ( )
virtual

Definition at line 34 of file StrategyRemoveInaccurate.cc.

{
// TODO Auto-generated destructor stub
}

Member Function Documentation

void StrategyRemoveInaccurate::removeCoordinates ( coordinatesVector coords,
int  entrysToRemove 
)
protectedvirtual

sorts the coordinatesVector by the last Value an removes the amount of entrys specified

Parameters
coordinatesVector*coords coordVector int entrysToRemove

Reimplemented from StrategyRemoveCoords.

Definition at line 38 of file StrategyRemoveInaccurate.cc.

{
std::sort(coords->begin(), coords->end(), compareCoordsByErrorVector); //sorts in ascending order
for(int i = 0; i < entrysToRemove; i++) {
coords->pop_back();
}
}
void StrategyRemoveInaccurate::setMyCoordinates ( const AbstractNcsNodeInfo ncsInfo)
virtual

need own implementation here, cause we need the error verctor as well

Reimplemented from StrategySendAll.

Definition at line 47 of file StrategyRemoveInaccurate.cc.

{
std::vector<double> tmpDimVector = ncsInfo;
coordinatesVector tmpCoordsVector;
tmpCoordsVector.push_back(tmpDimVector);
setBranchCoordinates(thisNode, tmpCoordsVector); // i am my own branch here ...
}

The documentation for this class was generated from the following files: