| package POPETAAlg; | |
| public class FirstFitPOPETAAlgTest { | |
| private static final Logger log = LoggerFactory.getLogger(FirstFitPOPETAAlgTest.class); | |
| private FirstFitPOPETAAlg alg; | |
| public void init() { | |
| UndirectedWeightedGraphBuilderBase builderBase = SimpleWeightedGraph.builder(EonEdge.class); | |
| SimpleWeightedGraph | |
| alg = new FirstFitPOPETAAlg(graph, null, null); | |
| } | |
| public void searchLowestAvaiIndexTest() { | |
| ArrayList | |
| list.add(1); | |
| list.add(3); | |
| list.add(4); | |
| list.add(6); | |
| list.add(7); | |
| list.add(8); | |
| list.add(10); | |
| list.add(12); | |
| list.add(13); | |
| list.add(14); | |
| list.add(15); | |
| } | |
| @Test | |
| public void firstFitPOPETATest() { | |
| ArrayList | |
| double rou = 20; | |
| double miu = 2; | |
| Calendar startTime = Calendar.getInstance(); | |
| Calendar endTime = Calendar.getInstance(); | |
| endTime.setTimeInMillis(startTime.getTimeInMillis()); | |
| endTime.add(Calendar.HOUR, 24); | |
| int minRequiredSlotNum = 1; | |
| int maxRequiredSlotNum = 5; | |
| int startIndex = 1; | |
| for (SimpleWeightedGraph | |
| ArrayList | |
| ServiceGenerator generator = new ServiceGenerator(avaiVertexes, rou, miu, startTime, endTime, | |
| minRequiredSlotNum, maxRequiredSlotNum, startIndex); | |
| ArrayList | |
| ServiceQueue serviceQueue = new ServiceQueue(); | |
| serviceQueue.addServiceList(services); | |
| ArrayList | |
| FirstFitPOPETAAlg ffPOPETA = new FirstFitPOPETAAlg(graph, services, serviceOrderedQueue); | |
| ffPOPETA.allocate(); | |
| // data collection | |
| ArrayList | |
| ffPOPETA.getPassedServices(), ffPOPETA.getBlockedServices(), 20, null); | |
| log.info("The BP of network is {}.", bp); | |
| } | |
| } | |
| private ArrayList | |
| ArrayList | |
| for (int i=1; i<=size; i++) { | |
| rtn.add(i); | |
| } | |
| return rtn; | |
| } | |
| @Test | |
| public void smtTest() throws Exception{ | |
| File file = new File ("USLIKENET_2017-03-12_1days_MLSPDwithFirstFitPOPETA_SpectrumMigratingTime.data"); | |
| ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(file)); | |
| ArrayList | |
| log.info("size of smt is : {}.", smt.size()); | |
| } | |
| } |