Changeset 571

Show
Ignore:
Timestamp:
05/21/10 12:10:46 (14 years ago)
Author:
nikhil
Message:
 
Location:
vtcross/branches/nikhil/crossmodel2/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vtcross/branches/nikhil/crossmodel2/src/cognitive_engines/CBR_CE/CBR_CE.cpp

    r568 r571  
    2121#include "CBR_CE.h" 
    2222#include <iostream> 
    23  
     23#include <stdlib.h> 
    2424 
    2525using namespace std; 
     
    9393        /* Adapt the returned parameters to meet the objective */ 
    9494        LOG("Cognitive Engine:: Found\n"); 
    95          
     95        optList->ToA = 1;                
    9696        FineTune(); 
     97 
     98///// If u include this it will recognise better performance // 
     99 
     100        int rnd = (rand() - RAND_MAX/2); 
     101        if (rnd >= 0) { 
     102            pList[0].value = returnValues[0] + pList[0].step*(optList->Slope[0])*-1; 
     103        } 
     104        else { 
     105           pList[0].value = returnValues[0]; 
     106        } 
     107 
     108 
     109////// 
     110         
    97111 
    98112    } else if(rc == 31337) { 
     
    227241 
    228242// MAIN SELF LEARNING CODE HERE // 
     243 
     244if (optList->ToA == 0) { 
    229245 
    230246int searchOps[radioInfo->numParameters]; 
     
    298314  } 
    299315   searchOps[lp] = 0; 
    300  
    301  
    302 } 
     316} 
     317 
    303318 
    304319 
     
    314329    } 
    315330 
     331/* 
    316332   std::cout << "Ptune " << optList->Ptune << std::endl; 
    317333   std::cout << "Status1 " << optList->Status[0][0] << std::endl; 
     
    321337   std::cout << "Trend1 " << optList->Trend[0][0] << std::endl; 
    322338   std::cout << "Trend2 " << optList->Trend[1][0] << std::endl; 
    323  
     339*/ 
    324340 /// end of MAIN CODE // 
    325  
     341} 
    326342 
    327343} 
     
    351367        optList->PoC = 0.01; 
    352368        optList->Ptune = 0; // starting with most tunable parameter.. (widest range .. ) 
    353  
     369        optList->ToA = 0; 
     370         
    354371        for (int x = 0; x < radioInfo->numParameters; x++) { 
    355372                optList->Pweights[x] = 1/(pList[x].step); 
  • vtcross/branches/nikhil/crossmodel2/src/include/vtcross/cognitive_engine.h

    r561 r571  
    161161                    float PoC; 
    162162                    int Ptune; 
    163  
     163                    int ToA; 
    164164 
    165165        }*optList;