00001 /*************************************************************************** 00002 * Copyright (C) 2007 by Universidad Nacional de Colombia * 00003 * http://www.unal.edu.co * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #ifndef NODEWEIGHT_H 00021 #define NODEWEIGHT_H 00022 00023 #include <math.h> 00024 00034 class NodeWeight{ 00035 public: 00036 NodeWeight(); 00037 // NodeWeight( const NodeWeight& nw ); 00038 NodeWeight( double weightValue, bool root = false ); 00039 NodeWeight( double weightValue, bool root, int deepestNoNodes ) ; 00040 NodeWeight( double potentialValue, double weightValue ); 00041 NodeWeight( double potentialValue, double weightValue, bool root, int deepestNoNodes ) ; 00042 // friend bool operator == ( const NodeWeight& nw1, const NodeWeight& nw2 ) ; 00043 // friend bool operator < (const NodeWeight& nw1, const NodeWeight& nw2); 00044 ~NodeWeight(); 00045 00046 void setExternalId(const int& value); 00047 int getExternalId() const; 00048 void setKeyroot(bool value); 00049 bool isKeyroot() const; 00050 void setLeftmost(const int& value); 00051 int getLeftmost() const; 00052 void setPotentialValue( const double& value); 00053 double getPotentialValue() const; 00054 void setWeightValue( const double& value); 00055 double getWeightValue() const; 00056 00057 void setRoot( bool root ) ; 00058 bool isRoot() const ; 00059 void setDeepestNoNodes(const int& value); 00060 int getDeepestNoNodes() const; 00061 00062 private: 00063 bool keyroot ; 00064 bool root ; 00065 int externalId ; 00066 double potentialValue ; 00067 double weightValue ; 00068 int leftmost ; 00069 int deepestNoNodes ; 00070 00071 }; 00072 00073 #endif