#ifndef SECONDLEVELNETWORK_H_
#define SECONDLEVELNETWORK_H_

#include <iostream>
#include <iterator>
#include <string>
#include <list>
#include <map>
#include <algorithm>
#include "float.h"
#include "networks/wiredbas/WiredBasSpecificaion.h"
#include "networks/wiredbas/WiredBasPlatformInstance.h"
#include "networks/wiredbas/WiredBasImplementation.h"
#include "networks/graph/RealWeightedGraph.h"
#include "platforms/wiredbas/BusPlatform.h"
#include "platforms/wiredbas/NetworkPlatform.h"
#include "io/bas/HmetisInterface.h"
#include "io/bas/PatohInterface.h"
#include "algorithms/graph/Tsp.h"

namespace cosi {

namespace algorithms {

namespace wiredbas {

class SecondLevelNetwork {

	bool mBusBased ;
	cosi::platforms::wiredbas::BusPlatform* mPlt ;
	cosi::platforms::wiredbas::NetworkPlatform* mNetPlt ;
	std::list<cosi::commstruct::wiredbas::Implementation*> mSubNets ;
	cosi::commstruct::wiredbas::Implementation* mI ;


	bool RunBusBased() ;
	bool RunNetBased() ;

public:

	SecondLevelNetwork(
			std::list<cosi::commstruct::wiredbas::Implementation*> SubNets,
			cosi::platforms::wiredbas::BusPlatform* Plt);

	SecondLevelNetwork(
			std::list<cosi::commstruct::wiredbas::Implementation*> SubNets,
			cosi::platforms::wiredbas::NetworkPlatform* Plt);

	bool Run() ;

	virtual ~SecondLevelNetwork();

	cosi::commstruct::wiredbas::Implementation* Get() ;
};

}

}

}

#endif /*SECONDLEVELNETWORK_H_*/
