本文整理汇总了Java中es.tid.tedb.MultiLayerTEDB类的典型用法代码示例。如果您正苦于以下问题:Java MultiLayerTEDB类的具体用法?Java MultiLayerTEDB怎么用?Java MultiLayerTEDB使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MultiLayerTEDB类属于es.tid.tedb包,在下文中一共展示了MultiLayerTEDB类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import es.tid.tedb.MultiLayerTEDB; //导入依赖的package包/类
@Override
public void run(){
SimpleDirectedWeightedGraph<Object,IntraDomainEdge> graph_IP;
graph_IP = ((MultiLayerTEDB)ted).getInterLayerGraph();
Set<IntraDomainEdge> fiberEdges= graph_IP.edgeSet();
Iterator<IntraDomainEdge> iterFiberLink;
iterFiberLink = fiberEdges.iterator();
while (iterFiberLink.hasNext()){
IntraDomainEdge fiberEdge =iterFiberLink.next();
float bw = fiberEdge.getTE_info().getUnreservedBandwidth().getUnreservedBandwidth()[0];
if (bw == fiberEdge.getTE_info().getMaximumBandwidth().getMaximumBandwidth()){
// Ligth path unused
if (LigthPathList.get(fiberEdge)==null)
LigthPathList.put(0, fiberEdge);
}
}
}
示例2: CompletedEmulatedNetworkLSPManager
import es.tid.tedb.MultiLayerTEDB; //导入依赖的package包/类
/**
* Constructor
* @param sendingQueue cola donde incluimos los mensaje ospf
* @param file fichero de la topologia, de donde leemos la topologia
* @param stats estadisticas
* @param isMultilayer boolean indicando si la red es multilayer o no
*/
public CompletedEmulatedNetworkLSPManager(
LinkedBlockingQueue<OSPFv2LinkStateUpdatePacket> sendingQueue,
String file,AutomaticTesterStatistics stats, boolean isMultilayer) {
this.setEmulatorType(NetworkLSPManagerTypes.COMPLETED_EMULATED_NETWORK);
this.multilayer=isMultilayer;
if (isMultilayer)
this.setDomainTEDB(new MultiLayerTEDB());
else
this.setDomainTEDB(new SimpleTEDB());
this.setFile(file);
if (file !=null){
log.info("Initializing TEDB de "+file);
this.getDomainTEDB().initializeFromFile(file);
}
else {
log.error("Network file NOT included!!!");
}
this.setSendingQueue(sendingQueue);
this.stats = stats;
}
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:29,代码来源:CompletedEmulatedNetworkLSPManager.java
示例3: setTEDB
import es.tid.tedb.MultiLayerTEDB; //导入依赖的package包/类
@Override
public void setTEDB(TEDB ted) {
try {
//NetworkGraphIP=((MultiLayerTEDB)ted).getDuplicatedUpperLayerkGraph();
NetworkGraphIP=((MultiLayerTEDB)ted).getUpperLayerGraph();
//getDuplicatedUpperLayerkGraph(); //getNetworkGraph();
OpticalnetworkGraph=((MultiLayerTEDB)ted).getDuplicatedLowerLayerkGraph();
//.getDuplicatedLowerLayerkGraph(); //getNetworkGraph();
InterLayerGraph = ((MultiLayerTEDB)ted).getDuplicatedInterLayerGraph();
//.getDuplicatedInterLayerGraph();
log.info("Using MultiLayerTEDB");
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
}
WSONInfo=((DomainTEDB)ted).getWSONinfo();
this.ted=(DomainTEDB)ted;
this.numLambdas=WSONInfo.getNumLambdas();
}
示例4: XMLRead
import es.tid.tedb.MultiLayerTEDB; //导入依赖的package包/类
/**
* Metodo que lee la topologia de un XML file
*/
DomainTEDB XMLRead(String file){
ted = new MultiLayerTEDB();
if (file !=null){
ted.initializeFromFile(file);
}
return ted;
}
示例5: sendMessageOSPF
import es.tid.tedb.MultiLayerTEDB; //导入依赖的package包/类
/**
* Metodo que mete en la cola de envio de OSPF un paquete
* @param sendingQueue Cola de envio de mensajes OSPF
* @param src origen del link que estamos informando
* @param dst destino del link que estamos informando
* @param layer layer del link que estamos informando
*/
private void sendMessageOSPF(LinkedBlockingQueue<OSPFv2LinkStateUpdatePacket> sendingQueue, Inet4Address src,Inet4Address dst, int layer){
IntraDomainEdge edge = null;
edge=((MultiLayerTEDB)ted).getLowerLayerGraph().getEdge(src, dst);
OSPFv2LinkStateUpdatePacket ospfv2Packet = new OSPFv2LinkStateUpdatePacket();
ospfv2Packet.setRouterID(src);
LinkedList<LSA> lsaList = new LinkedList<LSA>();
OSPFTEv2LSA lsa = new OSPFTEv2LSA();
LinkTLV linkTLV=new LinkTLV();
lsa.setLinkTLV(linkTLV);
linkTLV.setMaximumBandwidth(edge.getTE_info().getMaximumBandwidth());
if (edge.getTE_info().getUnreservedBandwidth() != null)
linkTLV.setUnreservedBandwidth(edge.getTE_info().getUnreservedBandwidth());
if (layer == LayerTypes.UPPER_LAYER){
linkTLV.setMaximumReservableBandwidth(edge.getTE_info().getMaximumReservableBandwidth());
}
LocalInterfaceIPAddress localInterfaceIPAddress= new LocalInterfaceIPAddress();
LinkedList<Inet4Address> lista =localInterfaceIPAddress.getLocalInterfaceIPAddressList();
lista.add(src);
linkTLV.setLocalInterfaceIPAddress(localInterfaceIPAddress);
RemoteInterfaceIPAddress remoteInterfaceIPAddress= new RemoteInterfaceIPAddress();
LinkedList<Inet4Address> listar = remoteInterfaceIPAddress.getRemoteInterfaceIPAddressList();
listar.add(dst);
linkTLV.setRemoteInterfaceIPAddress(remoteInterfaceIPAddress);
LinkID linkID = new LinkID();
linkID.setLinkID(dst);
linkTLV.setLinkID(linkID);
if (edge.getTE_info().getAvailableLabels() != null){
linkTLV.setAvailableLabels(edge.getTE_info().getAvailableLabels());
}
lsaList.add(lsa);
ospfv2Packet.setLSAlist(lsaList);
sendingQueue.add(ospfv2Packet);
}
示例6: setTEDB
import es.tid.tedb.MultiLayerTEDB; //导入依赖的package包/类
@Override
public void setTEDB(TEDB ted) {
try {
baseSimplegraph=((MultiLayerTEDB)ted).getUpperLayerGraph();
Opticalgraph=((MultiLayerTEDB)ted).getDuplicatedLowerLayerkGraph();
Interlayer = ((MultiLayerTEDB)ted).getDuplicatedInterLayerGraph();
log.info("Using SimpleTEDB");
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
}
WSONInfo=((DomainTEDB)ted).getWSONinfo();
this.ted=(DomainTEDB)ted;
this.numLambdas=WSONInfo.getNumLambdas();
}
示例7: reserveLigthPath
import es.tid.tedb.MultiLayerTEDB; //导入依赖的package包/类
public boolean reserveLigthPath (Inet4Address source, Inet4Address destination, float bw){
//Reservar Bandwidth en el Ligth Path
SimpleDirectedWeightedGraph<Object,IntraDomainEdge> graph_IP;
graph_IP = ((MultiLayerTEDB)ted).getDuplicatedUpperLayerkGraph();
IntraDomainEdge edge = new IntraDomainEdge();
edge = graph_IP.getEdge(source, destination);
float bandwidth = edge.getTE_info().getUnreservedBandwidth().getUnreservedBandwidth()[0];
TE_Information tE_info = null;
UnreservedBandwidth unreservedBandwidth = null;
tE_info.setUnreservedBandwidth(unreservedBandwidth);
if (bw <= bandwidth){
edge.setTE_info(tE_info);
}
return true;
}
示例8: sendMessageOSPF
import es.tid.tedb.MultiLayerTEDB; //导入依赖的package包/类
/**
* Send a OSPF message
* @param TE_info Information of the link to send
* @param src Source address of the link
* @param dst Destiny address of the link
* @param dwdmWavelengthLabel lambda used in the link (where to send), it can be null.
*/
public void sendMessageOSPF(Inet4Address src,Inet4Address dst, boolean isMultilayer, int layer, DWDMWavelengthLabel dwdmWavelengthLabel){
log.info("SEND OSPF");
//changes for multilayer OSPF (UpperLayer and LowerLayer)
IntraDomainEdge edge = null;
if (isMultilayer){
if (layer == LayerTypes.UPPER_LAYER){
edge=((MultiLayerTEDB)domainTEDB).getUpperLayerGraph().getEdge(src, dst);
}
else if (layer == LayerTypes.LOWER_LAYER){
edge=((MultiLayerTEDB)domainTEDB).getLowerLayerGraph().getEdge(src, dst);
}
}
else
edge=((SimpleTEDB)domainTEDB).getNetworkGraph().getEdge(src, dst);
OSPFv2LinkStateUpdatePacket ospfv2Packet = new OSPFv2LinkStateUpdatePacket();
ospfv2Packet.setRouterID(src);
LinkedList<LSA> lsaList = new LinkedList<LSA>();
OSPFTEv2LSA lsa = new OSPFTEv2LSA();
LinkTLV linkTLV=new LinkTLV();
lsa.setLinkTLV(linkTLV);
if (layer == LayerTypes.UPPER_LAYER){
if (edge.getTE_info().getMaximumBandwidth()!=null)
linkTLV.setMaximumBandwidth(edge.getTE_info().getMaximumBandwidth());
if (edge.getTE_info().getUnreservedBandwidth() != null)
linkTLV.setUnreservedBandwidth(edge.getTE_info().getUnreservedBandwidth());
if (edge.getTE_info().getMaximumReservableBandwidth()!=null){
linkTLV.setMaximumReservableBandwidth(edge.getTE_info().getMaximumReservableBandwidth());
}
}
LocalInterfaceIPAddress localInterfaceIPAddress= new LocalInterfaceIPAddress();
LinkedList<Inet4Address> lista =localInterfaceIPAddress.getLocalInterfaceIPAddressList();
lista.add(src);
linkTLV.setLocalInterfaceIPAddress(localInterfaceIPAddress);
RemoteInterfaceIPAddress remoteInterfaceIPAddress= new RemoteInterfaceIPAddress();
LinkedList<Inet4Address> listar = remoteInterfaceIPAddress.getRemoteInterfaceIPAddressList();
listar.add(dst);
linkTLV.setRemoteInterfaceIPAddress(remoteInterfaceIPAddress);
LinkID linkID = new LinkID();
linkID.setLinkID(dst);
linkTLV.setLinkID(linkID);
if (edge.getTE_info().getAvailableLabels() != null){
linkTLV.setAvailableLabels(edge.getTE_info().getAvailableLabels());
((BitmapLabelSet)linkTLV.getAvailableLabels().getLabelSet()).setDwdmWavelengthLabel(dwdmWavelengthLabel);
}
lsaList.add(lsa);
ospfv2Packet.setLSAlist(lsaList);
sendingQueue.add(ospfv2Packet);
}
示例9: deleteLigthPath
import es.tid.tedb.MultiLayerTEDB; //导入依赖的package包/类
public boolean deleteLigthPath (Inet4Address source, Inet4Address destination){
//borrar el ligthPath creado pasando el origen y el destino
SimpleDirectedWeightedGraph<Object,IntraDomainEdge> graph_IP;
IntraDomainEdge edge=new IntraDomainEdge();
graph_IP = ((MultiLayerTEDB)ted).getDuplicatedUpperLayerkGraph();
graph_IP.removeEdge(source, destination);
((MultiLayerTEDB)ted).setUpperLayerGraph(graph_IP);
return true;
}