Online_evGen_wdm extends IEventGenerator { @Override public List<Triple<String, String, String>> getParameters() { return InputParameter.getInformationAllInputParameterFieldsOfObject(this); }  @Override String getDescription(); @Override List<Triple<String, String, String>> getParameters(); @Override void initialize(NetPlan initialNetPlan, Map<String, String> algorithmParameters, Map<String, String> simulationParameters, Map<String, String> net2planParameters); @Override void processEvent(NetPlan currentNetPlan, SimEvent event);  }
@Test public void test() { final IEventGenerator generator = new Online_evGen_wdm(); final IEventProcessor processor = new Online_evProc_wdm (); ((Online_evProc_wdm) processor).DEBUG = true; final Map<String,String> simulationParameters = new HashMap<> (); simulationParameters.put("disableStatistics" , "false"); simulationParameters.put("refreshTime" , "1"); simulationParameters.put("simEvents" , "-1"); simulationParameters.put("transitoryEvents" , "-1"); simulationParameters.put("transitoryTime" , "" + (TIMEPERSIMULATIONINSECONDS/2)); simulationParameters.put("simTime" , "" + TIMEPERSIMULATIONINSECONDS); final Map<String,String> net2planParameters = ImmutableMap.of("precisionFactor" , "0.001"); final Map<String,List<String>> generatorParameters = new HashMap <>(); generatorParameters.put("_fail_failureModel" , Arrays.asList("perBidirectionalLinkBundle")); generatorParameters.put("_tfFast_fluctuationType" , Arrays.asList("random-truncated-gaussian")); generatorParameters.put("_trafficType" , Arrays.asList("connection-based-longrun" , "connection-based-incremental")); generatorParameters.put("_tfSlow_fluctuationType" , Arrays.asList("time-zone-based")); generatorParameters.put("cac_arrivalsPattern" , Arrays.asList("random-exponential-arrivals-and-duration")); generatorParameters.put("trafficLayerId" , Arrays.asList("" + np.getNetworkLayer(wdmLayerIndex).getId())); generatorParameters.put("fail_statisticalPattern" , Arrays.asList("exponential-iid")); generatorParameters.put("lineRatesPerLightpath_Gbps" , Arrays.asList("10 0.5 ; 20 0.5")); final List<Map<String,String>> testsParamGenerator = InputParameter.getCartesianProductOfParameters (generatorParameters); for (Map<String,String> paramsGeneratorChangingThisTest : testsParamGenerator) { final Map<String,String> allParamsGeneratorThisTest = InputParameter.getDefaultParameters(generator.getParameters()); allParamsGeneratorThisTest.putAll(paramsGeneratorChangingThisTest); final Map<String,List<String>> processorParameters = new HashMap <>(); processorParameters.put("wdmNumFrequencySlotsPerFiber" , Arrays.asList("" + WDMUtils.getFiberNumFrequencySlots(np.getLink(0 , np.getNetworkLayer(wdmLayerIndex))))); processorParameters.put("wdmRwaType" , Arrays.asList("srg-disjointness-aware-route-first-fit" , "alternate-routing" , "least-congested-routing" , "load-sharing")); processorParameters.put("wdmK" , Arrays.asList("5")); processorParameters.put("wdmRemovePreviousLightpaths" , Arrays.asList("false")); processorParameters.put("wdmTransponderTypesInfo" , Arrays.asList("10 1 1 9600 1 ; 20 1.5 2 9600 1")); processorParameters.put("wdmDefaultAndNewRouteRevoveryType" , Arrays.asList("restoration" , "1+1-link-disjoint")); final List<Map<String,String>> testsParamProcessor = InputParameter.getCartesianProductOfParameters (processorParameters); for (Map<String,String> paramsProcessorChangingThisTest : testsParamProcessor) { final Map<String,String> allParamsProcessorThisTest = InputParameter.getDefaultParameters(processor.getParameters()); allParamsProcessorThisTest.putAll(paramsProcessorChangingThisTest); System.out.println(allParamsProcessorThisTest); final NetPlan npInput = np.copy (); final NetPlan npOutput = np.copy (); new OnlineTestUtils().runSimulation(npOutput , generator , processor , simulationParameters , net2planParameters , allParamsGeneratorThisTest , allParamsProcessorThisTest , TIMEPERSIMULATIONINSECONDS); checkValidity (npInput , npOutput , allParamsGeneratorThisTest); } } }