当前位置: 首页>>代码示例>>Java>>正文


Java Metric类代码示例

本文整理汇总了Java中es.tid.pce.pcep.objects.Metric的典型用法代码示例。如果您正苦于以下问题:Java Metric类的具体用法?Java Metric怎么用?Java Metric使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Metric类属于es.tid.pce.pcep.objects包,在下文中一共展示了Metric类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: completeMetric

import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public static void completeMetric(Path path, Request req,List<IntraDomainEdge> edge_list){
	for (int i=0;i<req.getMetricList().size();++i){
		if (req.getMetricList().get(i).isComputedMetricBit()){
			int metric_type=req.getMetricList().get(i).getMetricType();
			switch (metric_type){
			case ObjectParameters.PCEP_METRIC_TYPE_HOP_COUNT:
				Metric metric=new Metric();
				metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_HOP_COUNT);
				float metricValue=(float)edge_list.size();
				metric.setMetricValue(metricValue);
				path.getMetricList().add(metric);
				break;
			case ObjectParameters.PCEP_METRIC_TYPE_LATENCY_METRIC:
				Metric metricLat=new Metric();
				metricLat.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_LATENCY_METRIC);
				float metricValueLat=0;
				for (int j=0;j<edge_list.size();++j){
					metricValueLat+=edge_list.get(j).getDelay_ms();
				}
				metricLat.setMetricValue(metricValueLat);
				path.getMetricList().add(metricLat);
				break;
			}
		}
	}
}
 
开发者ID:telefonicaid,项目名称:netphony-pce,代码行数:27,代码来源:PCEPUtils.java

示例2: createRequest

import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
/**
 * Create a request object
 * @param src_ip
 * @param dst_ip
 * @return
 */
private Request createRequest(int i){
	Request req = new Request();
	//RequestParameters
	RequestParameters rp= new RequestParameters();
	rp.setPbit(true);				
	rp.setRequestID(EmulatedPCCPCEPSession.getNewReqIDCounter());		
	rp.setPrio(testerParams.getRequestToSendList().get(i).getRequestParameters().getPriority());		
	rp.setReopt(testerParams.getRequestToSendList().get(i).getRequestParameters().isReoptimization());	
	rp.setBidirect(testerParams.getRequestToSendList().get(i).getRequestParameters().isBidirectional());
	rp.setLoose(testerParams.getRequestToSendList().get(i).getRequestParameters().isLoose());
	req.setRequestParameters(rp);
	//EndPoints
	EndPointsIPv4 ep=new EndPointsIPv4();				
	req.setEndPoints(ep);
	ep.setSourceIP(testerParams.getRequestToSendList().get(i).getSource());	
	ep.setDestIP(testerParams.getRequestToSendList().get(i).getDestiny());
	//Metric
	if (testerParams.getRequestToSendList().get(i).getRequestParameters().isDelayMetric()){
	     Metric metric = new Metric();
	     metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_LATENCY_METRIC);
	     metric.setComputedMetricBit(true);
	     req.getMetricList().add(metric);
	   
	  }
	//Offset Algorithmn
	  if (testerParams.getRequestToSendList().get(i).getRequestParameters().isOf()){
	   ObjectiveFunction of = new ObjectiveFunction();
	   req.setObjectiveFunction(of);
	   of.setOFcode(testerParams.getRequestToSendList().get(i).getRequestParameters().getOfCode()); 
	  }
	  //reservation
	  if (testerParams.getRequestToSendList().get(i).getRequestParameters().isReservation()){
	   Reservation res= new Reservation();
	   req.setReservation(res);
	   res.setTimer(testerParams.getRequestToSendList().get(i).getRequestParameters().getTimeReserved());
	  }
	return req;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:45,代码来源:AutomaticClientTask.java

示例3: createRequestMessage

import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
/**
 * Create a PC Request message including Monitoring, PCC-Id-Req and Request
 * @param i index of the request  
 * @return
 */
static PCEPRequest createRequestMessage(int i){
	PCEPRequest p_r = new PCEPRequest();
	//Creamos el objecto monitoring
	//Monitoring monitoring=createMonitoring();
	//Creamos el objeto PCCIdReq
	//PccReqId pccReqId = createPccReqId();
	//Creamos el object Request 
	Request req = createRequest(i);
	if (testerParams.getRequestToSendList().get(i).getRequestParameters().isDelayMetric()){
	     Metric metric = new Metric();
	     metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_LATENCY_METRIC);
	     metric.setComputedMetricBit(true);
	     req.getMetricList().add(metric);
	   
	  }
	  if (testerParams.getRequestToSendList().get(i).getRequestParameters().isOf()){
	   ObjectiveFunction of = new ObjectiveFunction();
	   req.setObjectiveFunction(of);
	   of.setOFcode(testerParams.getRequestToSendList().get(i).getRequestParameters().getOfCode()); 
	  }

	  if (testerParams.getRequestToSendList().get(i).getRequestParameters().isReservation()){
	   Reservation res= new Reservation();
	   req.setReservation(res);
	   res.setTimer(testerParams.getRequestToSendList().get(i).getRequestParameters().getTimeReserved());
	  }
	  if (testerParams.getRequestToSendList().get(i).getRequestParameters().Is_bandwidth()){
		   BandwidthRequested bw= new BandwidthRequested();
		   bw.setBw(testerParams.getRequestToSendList().get(i).getRequestParameters().getBW());
		   req.setBandwidth(bw);
		  }
	//p_r.setMonitoring(monitoring);
	//p_r.setPccReqId(pccReqId);
	p_r.addRequest(req);
	return p_r;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:42,代码来源:singleClient.java

示例4: getMetricList

import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public LinkedList<Metric> getMetricList() {
	return metricList;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:4,代码来源:RequestParametersConfiguration.java

示例5: setMetricList

import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public void setMetricList(LinkedList<Metric> metricList) {
	this.metricList = metricList;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:4,代码来源:RequestParametersConfiguration.java

示例6: createRequest

import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
/**
 * Create a request object
 * @param src_ip
 * @param dst_ip
 * @return
 */
private Request createRequest(Inet4Address source,Inet4Address destination){
	Request req = new Request();
	System.out.println("Createing request: "+source +" - " + destination);
	//RequestParameters
	RequestParameters rp= new RequestParameters();
	rp.setPbit(true);				
	rp.setRequestID(EmulatedPCCPCEPSession.getNewReqIDCounter());		
	rp.setPrio(testerParams.getRequestToSendList().get(0).getRequestParameters().getPriority());		
	rp.setReopt(testerParams.getRequestToSendList().get(0).getRequestParameters().isReoptimization());	
	rp.setBidirect(testerParams.getRequestToSendList().get(0).getRequestParameters().isBidirectional());
	rp.setLoose(testerParams.getRequestToSendList().get(0).getRequestParameters().isLoose());
	req.setRequestParameters(rp);
	//EndPoints
	EndPointsIPv4 ep=new EndPointsIPv4();				
	req.setEndPoints(ep);
	ep.setSourceIP(source);	
	ep.setDestIP(destination);
	
	if (testerParams.getRequestToSendList().get(0).getRequestParameters().isDelayMetric()){
	     Metric metric = new Metric();
	     metric.setMetricType(ObjectParameters.PCEP_METRIC_TYPE_LATENCY_METRIC);
	     metric.setComputedMetricBit(true);
	     req.getMetricList().add(metric);
	   
	  }
	//  if (testerParams.getRequestToSendList().get(0).getRequestParameters().isOf()){
	
	   ObjectiveFunction of = new ObjectiveFunction();
	   req.setObjectiveFunction(of);
	   of.setOFcode(1001); //AURE!!
	  //System.out.println("Code: "+testerParams.getRequestToSendList().get(0).getRequestParameters().getOfCode());
	  //}

	  if (testerParams.getRequestToSendList().get(0).getRequestParameters().isReservation()){
	   Reservation res= new Reservation();
	   log.info("Metemos reserva!!!!");
	   req.setReservation(res);
	   res.setTimer(testerParams.getRequestToSendList().get(0).getRequestParameters().getTimeReserved());
	  }
	  if (testerParams.getRequestToSendList().get(0).getRequestParameters().Is_bandwidth()){
		   BandwidthRequested bw= new BandwidthRequested();
		   bw.setBw(testerParams.getRequestToSendList().get(0).getRequestParameters().getBW());
		   req.setBandwidth(bw);
		  }
	
	return req;
}
 
开发者ID:telefonicaid,项目名称:netphony-gmpls-emulator,代码行数:54,代码来源:DisconnectingLinkTask.java

示例7: SVECConstruct

import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public SVECConstruct(){
	metricList=new LinkedList<Metric>(); 
	objectiveFunctionList=new LinkedList<ObjectiveFunction>();
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:5,代码来源:SVECConstruct.java

示例8: Response

import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public Response() {
	metricList=new LinkedList<Metric>();
	pathList=new LinkedList<Path>();
	metricPCEList=new LinkedList<MetricPCE>();
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:6,代码来源:Response.java

示例9: Path

import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public Path(){
	metricList=new LinkedList<Metric>();
}
 
开发者ID:telefonicaid,项目名称:netphony-network-protocols,代码行数:4,代码来源:Path.java


注:本文中的es.tid.pce.pcep.objects.Metric类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。