gear_tools.hh File Reference

#include <math.h>
#include "diffapp.hh"

Include dependency graph for gear_tools.hh:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  GeoLocation
class  HeuristicValue
class  HeuristicValueEntry
class  HeuristicValueTable
class  LearnedCostEntry
class  LearnedCostTable

Defines

#define ABS(x)   ((x) >= 0 ? (x): -(x))
#define FAIL   -1
#define FORWARD_TABLE_SIZE   100
#define GEO_HEURISTIC_VALUE_UPDATE_THRESHOLD   2
#define INITIAL_HEURISTIC_VALUE   -1
#define LEARNED_COST_TABLE_SIZE   1000

Functions

double Distance (double long1, double lat1, double long2, double lat2)
bool IsSameLocation (GeoLocation src, GeoLocation dst)


Define Documentation

#define ABS  )     ((x) >= 0 ? (x): -(x))
 

Definition at line 57 of file gear_tools.hh.

Referenced by HeuristicValueTable::updateEntry().

#define FAIL   -1
 

Definition at line 50 of file gear_tools.hh.

Referenced by DiffusionRouting::addFilter(), GeoRoutingFilter::estimateCost(), DiffusionRouting::publish(), DiffusionRouting::removeFilter(), LearnedCostTable::retrieveEntry(), HeuristicValueTable::retrieveEntry(), GeoRoutingFilter::retrieveHeuristicValue(), GeoRoutingFilter::retrieveLearnedCost(), DiffusionRouting::send(), DiffusionRouting::sendMessage(), DiffusionRouting::sendRmst(), DiffusionRouting::subscribe(), DiffusionRouting::unpublish(), DiffusionRouting::unsubscribe(), LearnedCostTable::updateEntry(), and HeuristicValueTable::updateEntry().

#define FORWARD_TABLE_SIZE   100
 

Definition at line 52 of file gear_tools.hh.

Referenced by HeuristicValueTable::addEntry(), and HeuristicValueTable::next().

#define GEO_HEURISTIC_VALUE_UPDATE_THRESHOLD   2
 

Definition at line 55 of file gear_tools.hh.

Referenced by HeuristicValueTable::updateEntry().

#define INITIAL_HEURISTIC_VALUE   -1
 

Definition at line 51 of file gear_tools.hh.

Referenced by HeuristicValueEntry::HeuristicValueEntry(), LearnedCostEntry::LearnedCostEntry(), GeoRoutingFilter::preProcessFilter(), and GeoRoutingFilter::retrieveHeuristicValue().

#define LEARNED_COST_TABLE_SIZE   1000
 

Definition at line 53 of file gear_tools.hh.

Referenced by LearnedCostTable::addEntry(), and LearnedCostTable::next().


Function Documentation

double Distance double  long1,
double  lat1,
double  long2,
double  lat2
 

Definition at line 54 of file gear_tools.cc.

Referenced by GeoRoutingFilter::estimateCost(), GeoRoutingFilter::findNextHop(), GeoRoutingFilter::floodInsideRegion(), and GeoRoutingFilter::preProcessMessage().

00055 {
00056   double distance;
00057  
00058   distance = sqrt((long1 - long2) * (long1 - long2) +
00059           (lat1 - lat2) * (lat1 - lat2));
00060 
00061   return distance;
00062 }

bool IsSameLocation GeoLocation  src,
GeoLocation  dst
 

Definition at line 46 of file gear_tools.cc.

References GeoLocation::latitude_, and GeoLocation::longitude_.

Referenced by HeuristicValueTable::retrieveEntry(), and LearnedCostTable::retrieveEntry().

00047 {
00048   if  ((src.longitude_ == dst.longitude_) &&
00049        (src.latitude_ == dst.latitude_))
00050     return true;
00051   return false;
00052 }


Generated on Tue Mar 6 16:53:00 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6