openoptics.OpticalRouting.extend_paths_to_all_time_slice

openoptics.OpticalRouting.extend_paths_to_all_time_slice#

openoptics.OpticalRouting.extend_paths_to_all_time_slice(paths: List[Path], nb_ts: int)[source]#

Helper function used by opera and hoho routing. These routings do not provide paths for all arrival time slices. This function fills the missing ones by letting packets wait for the nearest available path.

Parameters:
  • paths – A list of paths whose arrive time slices may be not continuous

  • nb_ts – Number of total time slices

Returns:

The list of paths whose arrive time slices cover all time slices

Raises:

AssertionError – If no paths are provided