2012年5月15日 星期二

Final_內插法_由外往內插﹍working







經過了兩天的恍神之後,找到了Bug,很單純的資料覆蓋過程,出了一點小意外  .  .
在實做雙向連結的部份,資料傳遞有點小複雜,加上變數覆蓋必須要特別小心處理
好幾次



   %  --插頭
    Table_tour_head_tail_Head=Table_tour_head_tail;
   
    Table_tour_head_tail_Head(Values,2)=Table_tour_head_tail_Head(choice_inser_tour,2);%OK
    Table_tour_head_tail_Head(Values,3)=choice_inser_tour;%OK
   
  Table_tour_head_tail_Head(Table_tour_head_tail_Head(choice_inser_tour,2),3)=Values;
    Table_tour_head_tail_Head(choice_inser_tour,2)=Values;
   
    order_Head=Tracing_table(Table_tour_head_tail_Head,storage_choice);
    Reslout_Head= Counting_Reslut_temp_order(Tracing_table(Table_tour_head_tail_Head,storage_choice),cityxy)
 
   %  ----插頭
 
        %  --插尾
    Table_tour_head_tail_Tail=Table_tour_head_tail;
       
    Table_tour_head_tail_Tail(Values,2)=choice_inser_tour;
    Table_tour_head_tail_Tail(Values,3)=Table_tour_head_tail_Tail(choice_inser_tour,3);
   
    Table_tour_head_tail_Tail( Table_tour_head_tail_Tail(choice_inser_tour,3),2)=Values;  
    Table_tour_head_tail_Tail(choice_inser_tour,3)=Values;
   
      order_Tail=Tracing_table(Table_tour_head_tail_Tail,storage_choice);
   Reslout_Tail= Counting_Reslut_temp_order(Tracing_table(Table_tour_head_tail_Tail,storage_choice),cityxy)
   %  --插尾
   
    %  比較  插頭好,插尾好
        if Reslout_Head<Reslout_Tail
            Table_tour_head_tail=Table_tour_head_tail_Head;
        else
            Table_tour_head_tail=Table_tour_head_tail_Tail;
        end

短短地十二行,反覆改寫變改插入頭端做連結或是插入尾端做連結

我就被搞死了!

最後還是感謝Matlab 的 Debug 工具 慢慢Step Step 看變數資料

找到 腦殘的 BUG . . . . .  12行 我重寫了快七八次

實做一個可雙向追蹤連結的程式真的是寫過一次就好了 . . . . .

還好最好跑出來的圖形算適合理解

從有Bug的65%準確率->提升到74.94%的準確率






明天在把 內插法的由內往外插,重寫一次 . . . .

今天終於還是有點小進度  有外往內插的寫法 終於DEBUG 完成 . . . .


沒有留言:

張貼留言