public double getLastPacketTime(int entityTo)
    {
        double time = 0.0;
        for (int i = 0; i < data.size(); i++)
        {
            if ((((Event)(data.elementAt(i))).getType() == 
                                           NetworkSimulator.FROM_LAYER_3) &&
                (((Event)(data.elementAt(i))).getEntity() == entityTo))
            {
                time = ((Event)(data.elementAt(i))).getTime();
            }
        }
    
        return time;
    }