#ifndef ETHERNETSUBNETWORK_H_
#define ETHERNETSUBNETWORK_H_

#include <string>
#include "libraries/wiredbas/common/SubNetwork.h"
#include "rules/wiredbas/link/WiringRule.h"
#include "rules/wiredbas/node/EthernetNetworkRule.h"
#include "models/wiredbas/common/WireCost.h"
#include "models/wiredbas/common/LinkDelayModel.h"
#include "models/wiredbas/node/EthernetNetworkCost.h"
#include "models/wiredbas/node/EthernetNetworkDelay.h"
#include "libraries/wiredbas/common/InstantiableLink.h"
#include "libraries/wiredbas/common/InstantiableNode.h"

namespace cosi {

namespace library {

namespace wiredbas {

class EthernetSubNetwork : public SubNetwork {
	//Wiring model
	cosi::rules::wiredbas::WiringRule* mWiringRule;
	cosi::rules::wiredbas::EthernetNetworkRule* mEthernetRule;
	cosi::models::wiredbas::WireCost* mWireCost;
	cosi::models::wiredbas::EthernetNetworkCost* mNetCost;
	cosi::models::wiredbas::LinkDelayModel* mLinkDelay;
	cosi::models::wiredbas::EthernetNetworkDelay* mNetDelay;

public:
	EthernetSubNetwork(cosi::rules::wiredbas::WiringRule* Wr,
	cosi::rules::wiredbas::EthernetNetworkRule* Er,
	cosi::models::wiredbas::WireCost* Wc,
	cosi::models::wiredbas::EthernetNetworkCost* Nc,
	cosi::models::wiredbas::LinkDelayModel* Ld,
	cosi::models::wiredbas::EthernetNetworkDelay* Nd,
	std::map<std::string, cosi::library::wiredbas::InstantiableNode*> N,
	std::map<std::string, cosi::library::wiredbas::InstantiableLink*> L);
	virtual ~EthernetSubNetwork();
    void AddNode(string Name, Vertex V, Position pP, ThreadSet pThreads,
			TransferTable pT) ;
	void AddLink(string Name, Vertex U, Vertex V, WiringPath pPath) ;
	double LatencyValue(cosi::commstruct::wiredbas::Implementation* pNet,
			Vertex Src, std::string Dest, Vertex SrcId, Vertex DestId);
	bool Satisfies(cosi::commstruct::wiredbas::Specification* pSpec ,cosi::commstruct::wiredbas::Implementation* pNet);
	double GetCost(cosi::commstruct::wiredbas::Implementation* pNet);
};

}

}

}

#endif /*ETHERNETSUBNETWORK_H_*/
