00001 #ifndef Node_h 00002 #define Node_h 1 00003 00004 #include "Cluster.h" 00005 // #include "State.h" 00006 00008 class Node { 00009 protected: 00010 00012 const Cluster* m_cluster; 00013 00015 // [optinal: do you want to have a local state] 00016 // State _state; 00017 00019 double m_residual; 00020 00022 double m_error; 00023 00024 public: 00025 00027 Node() {} 00028 00030 virtual ~Node() {} 00031 00033 ClusterType type() const 00034 {return m_cluster->type();} 00035 00037 void setCluster(const Cluster& cluster) 00038 {m_cluster = &cluster;} 00039 00041 const Cluster& cluster() const 00042 {return *m_cluster;}; 00043 00045 void setResidual(double residual) 00046 {m_residual = residual;} 00047 00049 double residual() const 00050 {return m_residual;} 00051 00053 void setResidualError(double error) 00054 {m_error = error;} 00055 00057 double residualError() const 00058 {return m_error;} 00059 00061 double quality() const { 00062 return (m_residual/m_error); 00063 } 00064 00066 00068 00069 00070 }; 00071 #endif 00072 00073 00074