Hybrid Query Processing Engine for Coprocessing in Database Systems
HyPE
scheduling_decision.cpp
Go to the documentation of this file.
00001 
00002 #include <core/scheduling_decision.hpp>
00003 #include <core/algorithm.hpp>
00004 
00005 #include <typeinfo>
00006 #include <iostream>
00007 
00008 namespace hype{
00009    namespace core{
00010 
00011    /*
00012    SchedulingDecision::SchedulingDecision(const std::string& name_of_algorithm,
00013                                           const EstimatedTime& estimated_time_for_algorithm, 
00014                                           const Tuple& feature_values)
00015                                           : name_of_algorithm_(name_of_algorithm), 
00016                                             estimated_time_for_algorithm_(estimated_time_for_algorithm),
00017                                             feature_values_(feature_values)
00018    {
00019 
00020    }*/
00021    
00022       uint64_t getUniqueID(){
00023          static uint64_t counter=0; 
00024          return ++counter;
00025       }
00026    
00027       SchedulingDecision::SchedulingDecision(Algorithm& alg_ref,
00028                                           const EstimatedTime& estimated_time_for_algorithm, 
00029                                           const Tuple& feature_values)
00030                                           : //name_of_algorithm_(name_of_algorithm),
00031                                             alg_ref_(alg_ref),
00032                                             estimated_time_for_algorithm_(estimated_time_for_algorithm),
00033                                             feature_values_(feature_values),
00034                                             scheduling_id_(getUniqueID())
00035    {
00036       alg_ref.incrementNumberofDecisionsforThisAlgorithm();
00037    }
00038    
00039    SchedulingDecision::~SchedulingDecision(){
00040          //std::cout << "Ich geh dann mal... " << typeid(SchedulingDecision).name() << std::endl;
00041    }
00042 
00043    const std::string SchedulingDecision::getNameofChoosenAlgorithm() const{
00044       //return name_of_algorithm_;
00045       return alg_ref_.getName();
00046    }
00047 
00048    const EstimatedTime SchedulingDecision::getEstimatedExecutionTimeforAlgorithm() const{
00049       return estimated_time_for_algorithm_;
00050    }
00051 
00052    const Tuple SchedulingDecision::getFeatureValues() const{
00053       return feature_values_;
00054    }
00055    
00056    const DeviceSpecification SchedulingDecision::getDeviceSpecification() const throw(){
00057       return alg_ref_.getDeviceSpecification();
00058    }
00059    
00060    bool SchedulingDecision::operator==(const SchedulingDecision& sched_dec) const{
00061       //Scheduling Decisions are equal if and only if their (unique) ids are equal
00062       return this->scheduling_id_==sched_dec.scheduling_id_;
00063    }
00064    
00065    }; //end namespace core
00066 }; //end namespace hype
00067 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines