- if (penaltiesMap != null) {
- penalty = getRxTspPenalty(calcCd, ImpairmentType.CDPsNm, penaltiesMap);
- impairments.put("CDpenalty", penalty);
- totalPenalty = totalPenalty + penalty;
- penalty = getRxTspPenalty(calcPmd, ImpairmentType.PMDPs, penaltiesMap);
- impairments.put("PMD Penalty", penalty);
- totalPenalty = totalPenalty + penalty;
- penalty = getRxTspPenalty(calcPdl, ImpairmentType.PDLDB, penaltiesMap);
- impairments.put("PDL penalty", penalty);
- totalPenalty = totalPenalty + penalty;
- // For Future work since at that time we have no way to calculate the following
- // parameters,even if penalties are defined in the OpenROADM specifications
- //
- // impairments.put("Colorless Drop Adjacent Xtalk Penalty", getRxTspPenalty(TBD,
- // ImpairmentType.ColorlessDropAdjacentChannelCrosstalkGHz, penalitiesMap));
- // impairments.put("XTalk total Power Penalty", getRxTspPenalty(TBD,
- // ImpairmentType.CrossTalkTotalPowerDB, penalitiesMap));
- // impairments.put("Power penalty", getRxTspPenalty(TBD,
- // ImpairmentType.PowerDBm, penalitiesMap));
- LOG.info("Penalty resulting from CD, PMD and PDL is {} dB with following contributions {}",
- totalPenalty, impairments);
- margin = calcOsnrdB - totalPenalty - rxOsnrdB;
- LOG.info("According to RX TSP Specification and calculated impairments Margin is {} dB ", margin);
- if (margin < 0) {
- LOG.info("Negative margin shall result in PCE rejecting the analyzed path");
- }
- } else {
- LOG.info("Unable to calculate margin as penaltyMap can not be retrieved : Operational mode not populated");
+ if (penaltiesMap == null) {
+ LOG.error("Unable to calculate margin as penaltyMap can not be retrieved : Operational mode not populated");
+ return -9999.9;
+ }
+ HashMap<String, Double> impairments = new HashMap<>();
+ double penalty = getRxTspPenalty(calcCd, ImpairmentType.CDPsNm, penaltiesMap);
+ impairments.put("CDpenalty", penalty);
+ double totalPenalty = penalty;
+ penalty = getRxTspPenalty(calcPmd, ImpairmentType.PMDPs, penaltiesMap);
+ impairments.put("PMD Penalty", penalty);
+ totalPenalty += penalty;
+ penalty = getRxTspPenalty(calcPdl, ImpairmentType.PDLDB, penaltiesMap);
+ impairments.put("PDL penalty", penalty);
+ totalPenalty += penalty;
+ // TODO for Future work since at that time we have no way to calculate the following
+ // parameters,even if penalties are defined in the OpenROADM specifications
+ //
+ // impairments.put("Colorless Drop Adjacent Xtalk Penalty", getRxTspPenalty(TBD,
+ // ImpairmentType.ColorlessDropAdjacentChannelCrosstalkGHz, penalitiesMap));
+ // impairments.put("XTalk total Power Penalty", getRxTspPenalty(TBD,
+ // ImpairmentType.CrossTalkTotalPowerDB, penalitiesMap));
+ // impairments.put("Power penalty", getRxTspPenalty(TBD,
+ // ImpairmentType.PowerDBm, penalitiesMap));
+ LOG.info("Penalty resulting from CD, PMD and PDL is {} dB with following contributions {}",
+ totalPenalty, impairments);
+ double margin = calcOsnrdB - totalPenalty - rxOsnrdB;
+ LOG.info("According to RX TSP Specification and calculated impairments Margin is {} dB ", margin);
+ if (margin < 0) {
+ LOG.warn("Negative margin shall result in PCE rejecting the analyzed path");