Research Article

Autonomic Obstacle Detection and Avoidance in MANETs Driven by Cartography Enhanced OLSR

Algorithm 1

Pruning procedure.
Require:
     : a list containing pairs of non communicating positions (obstacle information: OI).
     MaxAngle: The maximum angle aperture tolerated between two given prunable OI.
     MaxFarness: the maximum distance tolerated (i.e. to be prunable) between the projected OI extremity and its
     orthogonal projection on the line carrying the other OI.
Ensure:     : list of non communicating positions with more accurate extremities.
()    for  (; .size; )  do
()    for  (; .size; )  do
()         if  ([].hasSimilarDirection([], MaxAngle) = false)  then
()          Continue               ▹  go to the next iteration
()         end if
()        Let the line passing through []
()        Let the line passing through []
()        Point getOrthogonalProjection([].LeftExtremity, )
()        Point getOrthogonalProjection([].LeftExtremity, )
()      euclidianDistance([].LeftExtremity, )
()      euclidianDistance([].LeftExtremity, )
()     Point getOrthogonalProjection([].RightExtremity, )
()     Point getOrthogonalProjection([].RightExtremity, )
()      euclidianDistance([].RightExtremity, )
()      euclidianDistance([].RightExtremity, )
()      if  (.isInsideSegment([])  and   MaxFarness)  then
()        [].LeftExtremity  ;
()      else if (.isInsideSegment([])  and   MaxFarness)  then
()        [].LeftExtremity  ;
()    end if
()    if  (.isInsideSegment([])  and   MaxFarness)  then
()        [].RightExtremity ;
()    else if  (.isInsideSegment([])  and   MaxFarness)  then
()        [].RightExtremity  ;
()    end if
()   end for
() end for
() return