Changeset 2149


Ignore:
Timestamp:
02/22/07 10:26:50 (17 years ago)
Author:
mattausch
Message:

worked on traversal tree

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.cpp

    r2130 r2149  
    314314        if (axis == -1) { 
    315315                cout << "terminate on cost ratio" << endl; 
     316                ++ mStat.costRatioNodes; 
    316317                return leaf; 
    317318        } 
     
    421422                minCostNodes * 100 / (double)Leaves() << endl; 
    422423 
     424        app << "#N_COSTRATIOLEAVES ( Percentage of leaves with cost ratio termination )\n"<< 
     425                costRatioNodes * 100 / (double)Leaves() << endl; 
     426 
    423427        //  app << setprecision(4); 
    424428        //  app << "#N_CTIME  ( Construction time [s] )\n" 
     
    434438        TraversalLeaf *leaf = (TraversalLeaf *)data.mNode; 
    435439 
    436         if (data.mDepth > mTermMaxDepth) 
     440        if (data.mDepth >= mTermMaxDepth) 
    437441                ++ mStat.maxDepthNodes; 
    438442 
    439         if ((int)(leaf->mViewCells.size()) < mTermMinCost) 
     443        if ((int)(leaf->mViewCells.size()) <= mTermMinCost) 
    440444                ++ mStat.minCostNodes; 
    441445 
     
    474478                AxisAlignedBox3 box = (*mi)->GetBox(); 
    475479 
     480                //cout << "box: " << box << endl; 
    476481                splitCandidates->push_back(new SortableEntry(SortableEntry::BOX_MAX, 
    477482                        box.Max(axis), 
     
    511516{ 
    512517 
    513 #define DEBUG_COST 0 
     518#define DEBUG_COST 1 
    514519 
    515520#if DEBUG_COST 
     
    518523 
    519524        static int lastAxis = 100; 
     525 
    520526        if (axis <= lastAxis) 
    521                 nodeId++; 
     527                ++ nodeId; 
    522528 
    523529        lastAxis = axis; 
     
    552558        float minSum = 1e20f; 
    553559 
     560        int openBoxes = 0; 
     561 
    554562        for(ci = splitCandidates->begin(); ci < splitCandidates->end(); ++ ci)  
    555563        { 
     
    558566                case SortableEntry::BOX_MIN: 
    559567                        ++ objectsLeft; 
     568                        ++ openBoxes; 
    560569                        break; 
    561570                case SortableEntry::BOX_MAX: 
    562571                        -- objectsRight; 
     572                        -- openBoxes; 
    563573                        break; 
    564574                } 
     
    581591                        { 
    582592                                float oldCost = (float)node->mViewCells.size(); 
    583                                 float newCost = mCt_div_ci + sum/boxArea; 
     593                                float newCost = mCt_div_ci + sum / boxArea; 
    584594                                float ratio = newCost / oldCost; 
    585                                 costStream<<(*ci)->value<<" "<<ratio<<endl; 
     595 
     596                                costStream << (*ci)->value << " " << ratio << " open: " << openBoxes; 
     597 
     598                                if ((*ci)->type == SortableEntry::BOX_MAX) 
     599                                        costStream << " max event" << endl; 
     600                                else  
     601                                        costStream << " min event" << endl; 
    586602                        } 
    587603#endif 
  • GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.h

    r2124 r2149  
    5656  // number of dynamically removed ray refs 
    5757  int removedRayRefs; 
    58    
     58  // number of nodes terminated on cost ratio 
     59  int costRatioNodes; 
     60 
    5961  // Constructor 
    6062  TraversalTreeStatistics()  
     
    7173          nodes = 0; 
    7274           
    73           for (int i=0; i<7; i++) 
     75          for (int i = 0; i < 7; ++ i) 
    7476                  splits[i] = 0; 
    7577           
     
    8284          totalObjectRefs = 0; 
    8385          addedRayRefs = removedRayRefs = 0; 
     86          costRatioNodes = 0; 
    8487  } 
    8588 
Note: See TracChangeset for help on using the changeset viewer.