#ifndef _NETWORK_COST_H_
#define _NETWORK_COST_H_

#include <map>
#include "float.h"
#include "networks/onchipcommunication/Specification.h"
#include "networks/onchipcommunication/ChannelDependencyGraph.h"
#include "networks/onchipcommunication/Implementation.h"
#include "platforms/onchipcommunication/NocPlatformInterface.h"
#include "platforms/onchipcommunication/Platform.h"

namespace cosi {

namespace algorithms {

namespace onchipcommunication {

class NetworkCost {
 public:
  NetworkCost( ) ;
  ~NetworkCost( ) ;

  bool Verify( cosi::commstruct::onchipcommunication::Specification* Spec ) ;
  void Initialize(cosi::commstruct::onchipcommunication::Implementation* I ,
		  cosi::platforms::onchipcommunication::NocPlatformInterface* PltIf ,
		  cosi::platforms::onchipcommunication::Platform* Plt) ;

  void RunApprox( ) ;
  void Run();


  double GetWireStaticPower( ) ;
  double GetWireDynamicPower( ) ;
  double GetWireTotalPower( ) ;
  double GetRouterStaticPower( ) ;
  double GetRouterDynamicPower( ) ;
  double GetRouterTotalPower( ) ;
  double GetTotalPower( ) ;
  double GetWireArea( ) ;
  double GetWireDeviceArea( ) ;
  double GetWireWiringArea( ) ;
  double GetRouterArea( ) ;
  double GetArea( ) ;

  double GetMaxDist( ) { return mMaxDist ; };
  double GetMinDist( ) { return mMinDist; };
  double GetTotalDist( ) { return mTotalDist; };
  double GetAverageDist( ) { return mAverageDist; };

  int GetMinInDegree( ) { return mMinInDegree; };
  int GetMaxInDegree( ) { return mMaxInDegree; };

  int GetMinOutDegree( ) { return mMinOutDegree; };
  int GetMaxOutDegree( ) { return mMaxOutDegree; };



  double GetAverageInDegree( ) { return mAverageInDegree; };
  double GetAverageOutDegree( ) { return mAverageOutDegree; };


  int GetNnodes( ) { return mNnodes; };
  int GetNlinks( ) { return mNlinks ;};

  int GetMaxHop( ) { return mMaxHop ;} ;
  int GetMinHop( ) { return mMinHop ;}  ;

  //map< pair<int,int> , pair<int,int> > GetViolatedPaths( ) { return mViolatedPaths ; } ;

  double GetAverageHop( ) { return mHopAvg ;};

 private:

  cosi::commstruct::onchipcommunication::Implementation* mI ;
  cosi::platforms::onchipcommunication::NocPlatformInterface* mPltIf ;
  cosi::platforms::onchipcommunication::Platform* mPlt ;
  double mWireStaticPower ;
  double mWireDynamicPower ;
  double mInterfacePower ;
  double mInterfaceArea ;
  double mRouterDynamicPower ;
  double mRouterStaticPower ;
  double mWireArea ;
  double mWireDeviceArea ;
  double mWireWiringArea ;
  double mRouterArea ;

  double mMaxDist ;
  double mMinDist ;
  double mTotalDist ;
  double mAverageDist ;

  int mMinInDegree ;
  int mMaxInDegree ;

  int mMinOutDegree ;
  int mMaxOutDegree ;



  double mAverageInDegree ;
  double mAverageOutDegree ;

  int mNnodes ;
  int mNlinks ;

  int mMaxHop ;
  int mMaxHopPathSource ;
  int mMaxHopPathDest ;
  int mMinHop ;
  double mHopAvg ;

} ;

}
}
}

#endif
