Research Article

A Lightweight Neighbor-Info-Based Routing Protocol for No-Base-Station Taxi-Call System

Algorithm 2

Algorithm of passenger node.
Initiation queue = empty
Call_taxi{
   Get its position L
   Broadcast( )
   Set Timer1();
}
Timer1_task(){
   If (queue = empty){
    Call_taxi();
  }else{
  Choose the nearer hop q,
  Produce link ID;
  Send (Reserve, link ID) to q;
  Send (Negative) to other
  }
  Set timer2;
}
Timer2_task(){Call_taxi(); }
Block_listen(Message){
 Switch typeof(Message) {
   Case
      Add q to queue;
    Break;
   Case :
    Cancel Timer2;
    Break;
   Case :
    Set Timer2 current time;
    Break;
   Default:
}