class multi : public NODE{
private:
  //member valiable
  bool stay, overstay;
  int sst;

  //initialize valiables
  multi(){stay = false; overstay = false; sst = 0;};

  //member function of Mobility Model
  void rule(){
    if(crowded(P, V, E) && (T % (int)rand(250.0,350.0))){
      dst.r = detour_path(P, E, dst.p);
      return;
    }
    if(late(P, V, T, dst) && prob(70)){
      V = fast(V, 0.5, dst);
      return;
    }
    if(miss(P, V, T, dst) && prob(20)){
      V = fast(V, 0.5, dst);
      dst.t += 600;
      return;
    }
    if(miss(P, V, T, dst) && prob(100)){
      dst = pop(Dlist);
      dst.r = shortest_path(P, dst.p);
      return;
    }
    if(receive_from_net(AO, new_dst) && prob(50)){
      put(new_dst, Dlist);
      return;
    }
    if(!stay && !overstay && reach(P, dst.p) && prob(100)){
      sst = T;
      stay = true;
      V = vector(0.0, 0.0);
      return;
    }
    if(stay && (T - sst) >= dst.s && prob(80)){
      stay = false;
      dst = pop(Dlist);
      dst.r = shortest_path(P, dst.p);
      V = norm(V, dst);
      return;
    }
    if(stay && (T - sst) >= dst.s && prob(100)){
      stay = false;
      overstay = true;
      dst.s += rand(300, 600);
      return;
    }
    if(overstay && (T - sst) >= dst.s && prob(100)){
      send_to_net(AI, dst.p);
      overstay = false;
      dst = pop(Dlist);
      dst.r = shortest_path(P, dst.p);
      V = norm(V, dst);
    }
  }

}