Add a DisjunctionError exception and use it

in case there is no possible disjoint path with the added constraints
(most of the time due to an inconsistant user request)

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
This commit is contained in:
EstherLerouzic
2019-09-13 19:07:51 +01:00
parent 66bdeb0e4d
commit b15c8c60ab
3 changed files with 9 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ from gnpy.core.service_sheet import convert_service_sheet, Request_element, Elem
from gnpy.core.elements import Transceiver, Roadm, Edfa, Fused
from gnpy.core.utils import db2lin, lin2db
from gnpy.core.info import create_input_spectral_information, SpectralInformation, Channel, Power
from gnpy.core.exceptions import ServiceError
from gnpy.core.exceptions import ServiceError, DisjunctionError
from copy import copy, deepcopy
from csv import writer
from math import ceil
@@ -878,7 +878,7 @@ def compute_path_dsjctn(network, equipment, pathreqlist, disjunctions_list):
LOGGER.critical(msg)
print(f'{msg}\nComputation stopped.')
# TODO in this case: replay step 5 with the candidate without constraints
exit()
raise DisjunctionError(msg)
# for i in disjunctions_list:
# print(i.disjunction_id)