本文整理汇总了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;
}
}
}
}
示例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;
}
示例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;
}
示例4: getMetricList
import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public LinkedList<Metric> getMetricList() {
return metricList;
}
示例5: setMetricList
import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public void setMetricList(LinkedList<Metric> metricList) {
this.metricList = metricList;
}
示例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;
}
示例7: SVECConstruct
import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public SVECConstruct(){
metricList=new LinkedList<Metric>();
objectiveFunctionList=new LinkedList<ObjectiveFunction>();
}
示例8: Response
import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public Response() {
metricList=new LinkedList<Metric>();
pathList=new LinkedList<Path>();
metricPCEList=new LinkedList<MetricPCE>();
}
示例9: Path
import es.tid.pce.pcep.objects.Metric; //导入依赖的package包/类
public Path(){
metricList=new LinkedList<Metric>();
}