Environments
EnvParams
Dataclass to hold environment parameters. Parameters are immutable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_requests
|
Scalar
|
Maximum number of requests in an episode |
required |
incremental_loading
|
Scalar
|
Incremental increase in traffic load (non-expiring requests) |
required |
end_first_blocking
|
Scalar
|
End episode on first blocking event |
required |
continuous_operation
|
Scalar
|
If True, do not reset the environment at the end of an episode |
required |
edges
|
Array
|
Two column array defining source-dest node-pair edges of the graph |
required |
slot_size
|
Scalar
|
Spectral width of frequency slot in GHz |
required |
consider_modulation_format
|
Scalar
|
If True, consider modulation format to determine required slots |
required |
link_length_array
|
Array
|
Array of link lengths |
required |
aggregate_slots
|
Scalar
|
Number of slots to aggregate into a single action (First-Fit with aggregation) |
required |
guardband
|
Scalar
|
Guard band in slots |
required |
directed_graph
|
bool
|
Whether graph is directed (one fibre per link per transmission direction) |
required |
Source code in xlron/environments/dataclasses.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
EnvState
Dataclass to hold environment state. State is mutable and arrays are traced on JIT compilation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
current_time
|
Scalar
|
Current time in environment |
required |
holding_time
|
Scalar
|
Holding time of current request |
required |
total_timesteps
|
Scalar
|
Total timesteps in environment |
required |
total_requests
|
Scalar
|
Total requests in environment |
required |
graph
|
GraphsTuple
|
Graph tuple representing network state |
required |
full_link_slot_mask
|
Array
|
Action mask for link slot action (including if slot actions are aggregated) |
required |
accepted_services
|
Array
|
Number of accepted services |
required |
accepted_bitrate
|
Array
|
Accepted bitrate |
required |
Source code in xlron/environments/dataclasses.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
RMSAGNModelEnv
Bases: RSAEnv
RMSA + GNN model environment.
Source code in xlron/environments/gn_model/rmsa_gn_model.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
__init__(key, params, traffic_matrix=None, launch_power_array=None, list_of_requests=None, laplacian_matrix=None)
Initialise the environment state and set as initial state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
PRNGKey
|
PRNG key |
required |
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
traffic_matrix
|
optional
|
Traffic matrix |
None
|
launch_power_array
|
optional
|
Launch power array |
None
|
Returns:
Type | Description |
---|---|
None |
Source code in xlron/environments/gn_model/rmsa_gn_model.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
action_mask(state, params)
Returns mask of valid actions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
RSAEnvState
|
Environment state |
required |
params
|
RSAEnvParams
|
Environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
RSAEnvState
|
Environment state with action mask |
Source code in xlron/environments/gn_model/rmsa_gn_model.py
66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
num_actions(params)
staticmethod
Number of actions possible in environment.
Source code in xlron/environments/gn_model/rmsa_gn_model.py
84 85 86 87 |
|
observation_space(params)
Observation space of the environment.
Source code in xlron/environments/gn_model/rmsa_gn_model.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
RMSAGNModelEnvParams
Bases: GNModelEnvParams
Dataclass to hold environment params for RMSA with GN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_snr_array
|
Array
|
Link SNR array |
required |
Source code in xlron/environments/dataclasses.py
306 307 308 309 310 311 312 313 |
|
RMSAGNModelEnvState
Bases: GNModelEnvState
Dataclass to hold environment state for RMSA with GN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_snr_array
|
Array
|
Link SNR array |
required |
Source code in xlron/environments/dataclasses.py
316 317 318 319 320 321 322 323 324 325 |
|
RSAGNModelEnv
Bases: RSAEnv
RMSA + GNN model environment.
Source code in xlron/environments/gn_model/rsa_gn_model.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
__init__(key, params, traffic_matrix=None, launch_power_array=None, list_of_requests=None, laplacian_matrix=None)
Initialise the environment state and set as initial state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
PRNGKey
|
PRNG key |
required |
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
traffic_matrix
|
optional
|
Traffic matrix |
None
|
launch_power_array
|
optional
|
Launch power array |
None
|
Returns:
Type | Description |
---|---|
None |
Source code in xlron/environments/gn_model/rsa_gn_model.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
num_actions(params)
staticmethod
Number of actions possible in environment.
Source code in xlron/environments/gn_model/rsa_gn_model.py
70 71 72 73 |
|
observation_space(params)
Observation space of the environment.
Source code in xlron/environments/gn_model/rsa_gn_model.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
RSAGNModelEnvParams
Bases: GNModelEnvParams
Dataclass to hold environment params for RSA with GN model.
Source code in xlron/environments/dataclasses.py
290 291 292 293 294 |
|
RSAGNModelEnvState
Bases: GNModelEnvState
Dataclass to hold environment state for RSA with GN model.
Source code in xlron/environments/dataclasses.py
297 298 299 300 301 302 303 |
|
Dataclasses
DeepRMSAEnvState
Bases: RSAEnvState
Dataclass to hold environment state for DeepRMSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_stats
|
Array
|
Path stats array containing |
required |
Source code in xlron/environments/dataclasses.py
191 192 193 194 195 196 197 198 199 200 201 202 |
|
EnvParams
Dataclass to hold environment parameters. Parameters are immutable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_requests
|
Scalar
|
Maximum number of requests in an episode |
required |
incremental_loading
|
Scalar
|
Incremental increase in traffic load (non-expiring requests) |
required |
end_first_blocking
|
Scalar
|
End episode on first blocking event |
required |
continuous_operation
|
Scalar
|
If True, do not reset the environment at the end of an episode |
required |
edges
|
Array
|
Two column array defining source-dest node-pair edges of the graph |
required |
slot_size
|
Scalar
|
Spectral width of frequency slot in GHz |
required |
consider_modulation_format
|
Scalar
|
If True, consider modulation format to determine required slots |
required |
link_length_array
|
Array
|
Array of link lengths |
required |
aggregate_slots
|
Scalar
|
Number of slots to aggregate into a single action (First-Fit with aggregation) |
required |
guardband
|
Scalar
|
Guard band in slots |
required |
directed_graph
|
bool
|
Whether graph is directed (one fibre per link per transmission direction) |
required |
Source code in xlron/environments/dataclasses.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
EnvState
Dataclass to hold environment state. State is mutable and arrays are traced on JIT compilation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
current_time
|
Scalar
|
Current time in environment |
required |
holding_time
|
Scalar
|
Holding time of current request |
required |
total_timesteps
|
Scalar
|
Total timesteps in environment |
required |
total_requests
|
Scalar
|
Total requests in environment |
required |
graph
|
GraphsTuple
|
Graph tuple representing network state |
required |
full_link_slot_mask
|
Array
|
Action mask for link slot action (including if slot actions are aggregated) |
required |
accepted_services
|
Array
|
Number of accepted services |
required |
accepted_bitrate
|
Array
|
Accepted bitrate |
required |
Source code in xlron/environments/dataclasses.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
GNModelEnvParams
Bases: RSAEnvParams
Dataclass to hold environment state for GN model environments.
Source code in xlron/environments/dataclasses.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
GNModelEnvState
Bases: RSAEnvState
Dataclass to hold environment state for RSA with GN model.
Source code in xlron/environments/dataclasses.py
276 277 278 279 280 281 282 283 284 285 286 287 |
|
LogEnvState
Dataclass to hold environment state for logging.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
env_state
|
EnvState
|
Environment state |
required |
lengths
|
Scalar
|
Lengths |
required |
returns
|
Scalar
|
Returns |
required |
cum_returns
|
Scalar
|
Cumulative returns |
required |
episode_lengths
|
Scalar
|
Episode lengths |
required |
episode_returns
|
Scalar
|
Episode returns |
required |
accepted_services
|
Scalar
|
Accepted services |
required |
accepted_bitrate
|
Scalar
|
Accepted bitrate |
required |
done
|
Scalar
|
Done |
required |
Source code in xlron/environments/dataclasses.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
MultiBandRSAEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
237 238 239 240 241 242 |
|
MultiBandRSAEnvState
Bases: RSAEnvState
Dataclass to hold environment state for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
230 231 232 233 234 |
|
RMSAGNModelEnvParams
Bases: GNModelEnvParams
Dataclass to hold environment params for RMSA with GN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_snr_array
|
Array
|
Link SNR array |
required |
Source code in xlron/environments/dataclasses.py
306 307 308 309 310 311 312 313 |
|
RMSAGNModelEnvState
Bases: GNModelEnvState
Dataclass to hold environment state for RMSA with GN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_snr_array
|
Array
|
Link SNR array |
required |
Source code in xlron/environments/dataclasses.py
316 317 318 319 320 321 322 323 324 325 |
|
RSAEnvParams
Bases: EnvParams
Dataclass to hold environment parameters for RSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_nodes
|
Scalar
|
Number of nodes |
required |
num_links
|
Scalar
|
Number of links |
required |
link_resources
|
Scalar
|
Number of link resources |
required |
k_paths
|
Scalar
|
Number of paths |
required |
mean_service_holding_time
|
Scalar
|
Mean service holding time |
required |
load
|
Scalar
|
Load |
required |
arrival_rate
|
Scalar
|
Arrival rate |
required |
path_link_array
|
Array
|
Path link array |
required |
random_traffic
|
bool
|
Random traffic matrix for RSA on each reset (else uniform or custom) |
required |
max_slots
|
Scalar
|
Maximum number of slots |
required |
path_se_array
|
Array
|
Path spectral efficiency array |
required |
deterministic_requests
|
bool
|
If True, use deterministic requests |
required |
multiple_topologies
|
bool
|
If True, use multiple topologies |
required |
Source code in xlron/environments/dataclasses.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
RSAEnvState
Bases: EnvState
Dataclass to hold environment state for RSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Array
|
Link slot array |
required |
request_array
|
Array
|
Request array |
required |
link_slot_departure_array
|
Array
|
Link slot departure array |
required |
link_slot_mask
|
Array
|
Link slot mask |
required |
traffic_matrix
|
Array
|
Traffic matrix |
required |
Source code in xlron/environments/dataclasses.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
RSAGNModelEnvParams
Bases: GNModelEnvParams
Dataclass to hold environment params for RSA with GN model.
Source code in xlron/environments/dataclasses.py
290 291 292 293 294 |
|
RSAGNModelEnvState
Bases: GNModelEnvState
Dataclass to hold environment state for RSA with GN model.
Source code in xlron/environments/dataclasses.py
297 298 299 300 301 302 303 |
|
RSAMultibandEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
335 336 337 338 339 340 |
|
RSAMultibandEnvState
Bases: RSAEnvState
Dataclass to hold environment state for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
328 329 330 331 332 |
|
RWALightpathReuseEnvState
Bases: RSAEnvState
Dataclass to hold environment state for RWA with lightpath reuse.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_index_array
|
Array
|
Contains indices of lightpaths in use on slots |
required |
path_capacity_array
|
Array
|
Contains remaining capacity of each lightpath |
required |
link_capacity_array
|
Array
|
Contains remaining capacity of lightpath on each link-slot |
required |
Source code in xlron/environments/dataclasses.py
210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
VONEEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for VONE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_resources
|
Scalar
|
Number of node resources |
required |
max_edges
|
Scalar
|
Maximum number of edges |
required |
min_node_resources
|
Scalar
|
Minimum number of node resources |
required |
max_node_resources
|
Scalar
|
Maximum number of node resources |
required |
Source code in xlron/environments/dataclasses.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
|
VONEEnvState
Bases: RSAEnvState
Dataclass to hold environment state for VONE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_capacity_array
|
Array
|
Node capacity array |
required |
node_resource_array
|
Array
|
Node resource array |
required |
node_departure_array
|
Array
|
Node departure array |
required |
action_counter
|
Array
|
Action counter |
required |
action_history
|
Array
|
Action history |
required |
node_mask_s
|
Array
|
Node mask for source node |
required |
node_mask_d
|
Array
|
Node mask for destination node |
required |
virtual_topology_patterns
|
Array
|
Virtual topology patterns |
required |
values_nodes
|
Array
|
Values for nodes |
required |
Source code in xlron/environments/dataclasses.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
|
Environment wrappers
DeepRMSAEnvState
Bases: RSAEnvState
Dataclass to hold environment state for DeepRMSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_stats
|
Array
|
Path stats array containing |
required |
Source code in xlron/environments/dataclasses.py
191 192 193 194 195 196 197 198 199 200 201 202 |
|
EnvParams
Dataclass to hold environment parameters. Parameters are immutable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_requests
|
Scalar
|
Maximum number of requests in an episode |
required |
incremental_loading
|
Scalar
|
Incremental increase in traffic load (non-expiring requests) |
required |
end_first_blocking
|
Scalar
|
End episode on first blocking event |
required |
continuous_operation
|
Scalar
|
If True, do not reset the environment at the end of an episode |
required |
edges
|
Array
|
Two column array defining source-dest node-pair edges of the graph |
required |
slot_size
|
Scalar
|
Spectral width of frequency slot in GHz |
required |
consider_modulation_format
|
Scalar
|
If True, consider modulation format to determine required slots |
required |
link_length_array
|
Array
|
Array of link lengths |
required |
aggregate_slots
|
Scalar
|
Number of slots to aggregate into a single action (First-Fit with aggregation) |
required |
guardband
|
Scalar
|
Guard band in slots |
required |
directed_graph
|
bool
|
Whether graph is directed (one fibre per link per transmission direction) |
required |
Source code in xlron/environments/dataclasses.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
EnvState
Dataclass to hold environment state. State is mutable and arrays are traced on JIT compilation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
current_time
|
Scalar
|
Current time in environment |
required |
holding_time
|
Scalar
|
Holding time of current request |
required |
total_timesteps
|
Scalar
|
Total timesteps in environment |
required |
total_requests
|
Scalar
|
Total requests in environment |
required |
graph
|
GraphsTuple
|
Graph tuple representing network state |
required |
full_link_slot_mask
|
Array
|
Action mask for link slot action (including if slot actions are aggregated) |
required |
accepted_services
|
Array
|
Number of accepted services |
required |
accepted_bitrate
|
Array
|
Accepted bitrate |
required |
Source code in xlron/environments/dataclasses.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
GNModelEnvParams
Bases: RSAEnvParams
Dataclass to hold environment state for GN model environments.
Source code in xlron/environments/dataclasses.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
GNModelEnvState
Bases: RSAEnvState
Dataclass to hold environment state for RSA with GN model.
Source code in xlron/environments/dataclasses.py
276 277 278 279 280 281 282 283 284 285 286 287 |
|
HashableArrayWrapper
Bases: Generic[T]
Wrapper for making arrays hashable. In order to access pre-computed data, such as shortest paths between node-pairs or the constituent links of a path, within a jitted function, we need to make the arrays containing this data hashable. By defining this wrapper, we can define a hash method that returns a hash of the array's bytes, thus making the array hashable. From: https://github.com/google/jax/issues/4572#issuecomment-709677518
Source code in xlron/environments/wrappers.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
LogEnvState
Dataclass to hold environment state for logging.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
env_state
|
EnvState
|
Environment state |
required |
lengths
|
Scalar
|
Lengths |
required |
returns
|
Scalar
|
Returns |
required |
cum_returns
|
Scalar
|
Cumulative returns |
required |
episode_lengths
|
Scalar
|
Episode lengths |
required |
episode_returns
|
Scalar
|
Episode returns |
required |
accepted_services
|
Scalar
|
Accepted services |
required |
accepted_bitrate
|
Scalar
|
Accepted bitrate |
required |
done
|
Scalar
|
Done |
required |
Source code in xlron/environments/dataclasses.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
LogWrapper
Bases: GymnaxWrapper
Log the episode returns and lengths. Modified from: https://github.com/RobertTLange/gymnax/blob/master/gymnax/wrappers/purerl.py
Source code in xlron/environments/wrappers.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
MultiBandRSAEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
237 238 239 240 241 242 |
|
MultiBandRSAEnvState
Bases: RSAEnvState
Dataclass to hold environment state for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
230 231 232 233 234 |
|
RMSAGNModelEnvParams
Bases: GNModelEnvParams
Dataclass to hold environment params for RMSA with GN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_snr_array
|
Array
|
Link SNR array |
required |
Source code in xlron/environments/dataclasses.py
306 307 308 309 310 311 312 313 |
|
RMSAGNModelEnvState
Bases: GNModelEnvState
Dataclass to hold environment state for RMSA with GN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_snr_array
|
Array
|
Link SNR array |
required |
Source code in xlron/environments/dataclasses.py
316 317 318 319 320 321 322 323 324 325 |
|
RSAEnvParams
Bases: EnvParams
Dataclass to hold environment parameters for RSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_nodes
|
Scalar
|
Number of nodes |
required |
num_links
|
Scalar
|
Number of links |
required |
link_resources
|
Scalar
|
Number of link resources |
required |
k_paths
|
Scalar
|
Number of paths |
required |
mean_service_holding_time
|
Scalar
|
Mean service holding time |
required |
load
|
Scalar
|
Load |
required |
arrival_rate
|
Scalar
|
Arrival rate |
required |
path_link_array
|
Array
|
Path link array |
required |
random_traffic
|
bool
|
Random traffic matrix for RSA on each reset (else uniform or custom) |
required |
max_slots
|
Scalar
|
Maximum number of slots |
required |
path_se_array
|
Array
|
Path spectral efficiency array |
required |
deterministic_requests
|
bool
|
If True, use deterministic requests |
required |
multiple_topologies
|
bool
|
If True, use multiple topologies |
required |
Source code in xlron/environments/dataclasses.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
RSAEnvState
Bases: EnvState
Dataclass to hold environment state for RSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Array
|
Link slot array |
required |
request_array
|
Array
|
Request array |
required |
link_slot_departure_array
|
Array
|
Link slot departure array |
required |
link_slot_mask
|
Array
|
Link slot mask |
required |
traffic_matrix
|
Array
|
Traffic matrix |
required |
Source code in xlron/environments/dataclasses.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
RSAGNModelEnvParams
Bases: GNModelEnvParams
Dataclass to hold environment params for RSA with GN model.
Source code in xlron/environments/dataclasses.py
290 291 292 293 294 |
|
RSAGNModelEnvState
Bases: GNModelEnvState
Dataclass to hold environment state for RSA with GN model.
Source code in xlron/environments/dataclasses.py
297 298 299 300 301 302 303 |
|
RSAMultibandEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
335 336 337 338 339 340 |
|
RSAMultibandEnvState
Bases: RSAEnvState
Dataclass to hold environment state for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
328 329 330 331 332 |
|
RWALightpathReuseEnvState
Bases: RSAEnvState
Dataclass to hold environment state for RWA with lightpath reuse.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_index_array
|
Array
|
Contains indices of lightpaths in use on slots |
required |
path_capacity_array
|
Array
|
Contains remaining capacity of each lightpath |
required |
link_capacity_array
|
Array
|
Contains remaining capacity of lightpath on each link-slot |
required |
Source code in xlron/environments/dataclasses.py
210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
RolloutWrapper
Wrapper to define batch evaluation for generation parameters. Used for genetic algorithm. From: https://github.com/RobertTLange/gymnax/
Source code in xlron/environments/wrappers.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
|
input_shape
property
Get the shape of the observation.
__init__(model_forward=None, env=None, num_env_steps=None, env_params=None)
Wrapper to define batch evaluation for generation parameters.
Source code in xlron/environments/wrappers.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
batch_rollout(rng_eval, policy_params)
Evaluate a generation of networks on RL/Supervised/etc. task.
Source code in xlron/environments/wrappers.py
183 184 185 186 187 188 |
|
population_rollout(rng_eval, policy_params)
Reshape parameter vector and evaluate the generation.
Source code in xlron/environments/wrappers.py
176 177 178 179 180 181 |
|
single_rollout(rng_input, policy_params)
Rollout a pendulum episode with lax.scan.
Source code in xlron/environments/wrappers.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
TimeIt
Context manager for timing execution of code blocks.
Source code in xlron/environments/wrappers.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
|
VONEEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for VONE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_resources
|
Scalar
|
Number of node resources |
required |
max_edges
|
Scalar
|
Maximum number of edges |
required |
min_node_resources
|
Scalar
|
Minimum number of node resources |
required |
max_node_resources
|
Scalar
|
Maximum number of node resources |
required |
Source code in xlron/environments/dataclasses.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
|
VONEEnvState
Bases: RSAEnvState
Dataclass to hold environment state for VONE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_capacity_array
|
Array
|
Node capacity array |
required |
node_resource_array
|
Array
|
Node resource array |
required |
node_departure_array
|
Array
|
Node departure array |
required |
action_counter
|
Array
|
Action counter |
required |
action_history
|
Array
|
Action history |
required |
node_mask_s
|
Array
|
Node mask for source node |
required |
node_mask_d
|
Array
|
Node mask for destination node |
required |
virtual_topology_patterns
|
Array
|
Virtual topology patterns |
required |
values_nodes
|
Array
|
Values for nodes |
required |
Source code in xlron/environments/dataclasses.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
|
Constituent functions of environments
DeepRMSAEnvState
Bases: RSAEnvState
Dataclass to hold environment state for DeepRMSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_stats
|
Array
|
Path stats array containing |
required |
Source code in xlron/environments/dataclasses.py
191 192 193 194 195 196 197 198 199 200 201 202 |
|
EnvParams
Dataclass to hold environment parameters. Parameters are immutable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_requests
|
Scalar
|
Maximum number of requests in an episode |
required |
incremental_loading
|
Scalar
|
Incremental increase in traffic load (non-expiring requests) |
required |
end_first_blocking
|
Scalar
|
End episode on first blocking event |
required |
continuous_operation
|
Scalar
|
If True, do not reset the environment at the end of an episode |
required |
edges
|
Array
|
Two column array defining source-dest node-pair edges of the graph |
required |
slot_size
|
Scalar
|
Spectral width of frequency slot in GHz |
required |
consider_modulation_format
|
Scalar
|
If True, consider modulation format to determine required slots |
required |
link_length_array
|
Array
|
Array of link lengths |
required |
aggregate_slots
|
Scalar
|
Number of slots to aggregate into a single action (First-Fit with aggregation) |
required |
guardband
|
Scalar
|
Guard band in slots |
required |
directed_graph
|
bool
|
Whether graph is directed (one fibre per link per transmission direction) |
required |
Source code in xlron/environments/dataclasses.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
EnvState
Dataclass to hold environment state. State is mutable and arrays are traced on JIT compilation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
current_time
|
Scalar
|
Current time in environment |
required |
holding_time
|
Scalar
|
Holding time of current request |
required |
total_timesteps
|
Scalar
|
Total timesteps in environment |
required |
total_requests
|
Scalar
|
Total requests in environment |
required |
graph
|
GraphsTuple
|
Graph tuple representing network state |
required |
full_link_slot_mask
|
Array
|
Action mask for link slot action (including if slot actions are aggregated) |
required |
accepted_services
|
Array
|
Number of accepted services |
required |
accepted_bitrate
|
Array
|
Accepted bitrate |
required |
Source code in xlron/environments/dataclasses.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
GNModelEnvParams
Bases: RSAEnvParams
Dataclass to hold environment state for GN model environments.
Source code in xlron/environments/dataclasses.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
GNModelEnvState
Bases: RSAEnvState
Dataclass to hold environment state for RSA with GN model.
Source code in xlron/environments/dataclasses.py
276 277 278 279 280 281 282 283 284 285 286 287 |
|
LogEnvState
Dataclass to hold environment state for logging.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
env_state
|
EnvState
|
Environment state |
required |
lengths
|
Scalar
|
Lengths |
required |
returns
|
Scalar
|
Returns |
required |
cum_returns
|
Scalar
|
Cumulative returns |
required |
episode_lengths
|
Scalar
|
Episode lengths |
required |
episode_returns
|
Scalar
|
Episode returns |
required |
accepted_services
|
Scalar
|
Accepted services |
required |
accepted_bitrate
|
Scalar
|
Accepted bitrate |
required |
done
|
Scalar
|
Done |
required |
Source code in xlron/environments/dataclasses.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
MultiBandRSAEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
237 238 239 240 241 242 |
|
MultiBandRSAEnvState
Bases: RSAEnvState
Dataclass to hold environment state for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
230 231 232 233 234 |
|
RMSAGNModelEnvParams
Bases: GNModelEnvParams
Dataclass to hold environment params for RMSA with GN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_snr_array
|
Array
|
Link SNR array |
required |
Source code in xlron/environments/dataclasses.py
306 307 308 309 310 311 312 313 |
|
RMSAGNModelEnvState
Bases: GNModelEnvState
Dataclass to hold environment state for RMSA with GN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_snr_array
|
Array
|
Link SNR array |
required |
Source code in xlron/environments/dataclasses.py
316 317 318 319 320 321 322 323 324 325 |
|
RSAEnvParams
Bases: EnvParams
Dataclass to hold environment parameters for RSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_nodes
|
Scalar
|
Number of nodes |
required |
num_links
|
Scalar
|
Number of links |
required |
link_resources
|
Scalar
|
Number of link resources |
required |
k_paths
|
Scalar
|
Number of paths |
required |
mean_service_holding_time
|
Scalar
|
Mean service holding time |
required |
load
|
Scalar
|
Load |
required |
arrival_rate
|
Scalar
|
Arrival rate |
required |
path_link_array
|
Array
|
Path link array |
required |
random_traffic
|
bool
|
Random traffic matrix for RSA on each reset (else uniform or custom) |
required |
max_slots
|
Scalar
|
Maximum number of slots |
required |
path_se_array
|
Array
|
Path spectral efficiency array |
required |
deterministic_requests
|
bool
|
If True, use deterministic requests |
required |
multiple_topologies
|
bool
|
If True, use multiple topologies |
required |
Source code in xlron/environments/dataclasses.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
RSAEnvState
Bases: EnvState
Dataclass to hold environment state for RSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Array
|
Link slot array |
required |
request_array
|
Array
|
Request array |
required |
link_slot_departure_array
|
Array
|
Link slot departure array |
required |
link_slot_mask
|
Array
|
Link slot mask |
required |
traffic_matrix
|
Array
|
Traffic matrix |
required |
Source code in xlron/environments/dataclasses.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
RSAGNModelEnvParams
Bases: GNModelEnvParams
Dataclass to hold environment params for RSA with GN model.
Source code in xlron/environments/dataclasses.py
290 291 292 293 294 |
|
RSAGNModelEnvState
Bases: GNModelEnvState
Dataclass to hold environment state for RSA with GN model.
Source code in xlron/environments/dataclasses.py
297 298 299 300 301 302 303 |
|
RSAMultibandEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
335 336 337 338 339 340 |
|
RSAMultibandEnvState
Bases: RSAEnvState
Dataclass to hold environment state for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
328 329 330 331 332 |
|
RWALightpathReuseEnvState
Bases: RSAEnvState
Dataclass to hold environment state for RWA with lightpath reuse.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_index_array
|
Array
|
Contains indices of lightpaths in use on slots |
required |
path_capacity_array
|
Array
|
Contains remaining capacity of each lightpath |
required |
link_capacity_array
|
Array
|
Contains remaining capacity of lightpath on each link-slot |
required |
Source code in xlron/environments/dataclasses.py
210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
VONEEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for VONE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_resources
|
Scalar
|
Number of node resources |
required |
max_edges
|
Scalar
|
Maximum number of edges |
required |
min_node_resources
|
Scalar
|
Minimum number of node resources |
required |
max_node_resources
|
Scalar
|
Maximum number of node resources |
required |
Source code in xlron/environments/dataclasses.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
|
VONEEnvState
Bases: RSAEnvState
Dataclass to hold environment state for VONE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_capacity_array
|
Array
|
Node capacity array |
required |
node_resource_array
|
Array
|
Node resource array |
required |
node_departure_array
|
Array
|
Node departure array |
required |
action_counter
|
Array
|
Action counter |
required |
action_history
|
Array
|
Action history |
required |
node_mask_s
|
Array
|
Node mask for source node |
required |
node_mask_d
|
Array
|
Node mask for destination node |
required |
virtual_topology_patterns
|
Array
|
Virtual topology patterns |
required |
values_nodes
|
Array
|
Values for nodes |
required |
Source code in xlron/environments/dataclasses.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
|
aggregate_slots(full_mask, params)
Aggregate slot mask to reduce action space. Only used if the --aggregate_slots flag is set to > 1. Aggregated action is valid if there is one valid slot action within the aggregated action window.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
full_mask
|
Array
|
slot mask |
required |
params
|
EnvParams
|
environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
agg_mask |
Array
|
aggregated slot mask |
Source code in xlron/environments/env_funcs.py
1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 |
|
calculate_path_capacity(path_length, min_request=100, scale_factor=1.0, alpha=0.0002, NF=4.5, B=10000000000000.0, R_s=100000000000.0, beta_2=-2.17e-26, gamma=0.0012, L_s=100000.0, lambda0=1.55e-06)
From Nevin JOCN paper 2022: https://discovery.ucl.ac.uk/id/eprint/10175456/1/RL_JOCN_accepted.pdf
Source code in xlron/environments/env_funcs.py
2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 |
|
calculate_path_stats(state, params, request)
For use in DeepRMSA agent observation space. Calculate: 1. Size of 1st suitable free spectrum block 2. Index of 1st suitable free spectrum block 3. Required slots on path 4. Avg. free block size 5. Free slots
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
request
|
Array
|
Request array in format [source_node, data-rate, destination_node] |
required |
Returns:
Name | Type | Description |
---|---|---|
stats |
Array
|
Array of calculated path statistics |
Source code in xlron/environments/env_funcs.py
2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 |
|
check_action_rmsa_gn_model(state, action, params)
Check if action is valid for RSA GN model Args: state (EnvState): Environment state params (EnvParams): Environment parameters action (chex.Array): Action array Returns: bool: True if action is invalid, False if action is valid
Source code in xlron/environments/env_funcs.py
2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 |
|
check_action_rsa(state)
Check if action is valid. Combines checks for: - no spectrum reuse
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
current state |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 |
|
check_action_rwalr(state, action, params)
Combines checks for: - no spectrum reuse - lightpath available and existing
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 |
|
check_all_nodes_assigned(node_departure_array, total_requested_nodes)
Count negative values on each node (row) in node departure array, sum them, must equal total requested_nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_departure_array
|
Array
|
Node departure array (N x R) where N is number of nodes and R is number of resources |
required |
total_requested_nodes
|
int
|
Total requested nodes (int) |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 |
|
check_lightpath_available_and_existing(state, params, action)
Check if lightpath is available and existing. Available means that the lightpath does not use slots occupied by a different lightpath. Existing means that the lightpath has already been established.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
lightpath_available_check |
Tuple[Array, Array, Array, Array]
|
True if lightpath is available |
Source code in xlron/environments/env_funcs.py
2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 |
|
check_min_two_nodes_assigned(node_departure_array)
Count negative values on each node (row) in node departure array, sum them, must be 2 or greater. This check is important if e.g. an action contains 2 nodes the same therefore only assigns 1 node. Return False if check passed, True if check failed
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_departure_array
|
Array
|
Node departure array (N x R) where N is number of nodes and R is number of resources |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 |
|
check_no_spectrum_reuse(link_slot_array)
slot-=1 when used, should be zero when unoccupied, so check if any < -1 in slot array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Link slot array (L x S) where L is number of links and S is number of slots |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 |
|
check_node_capacities(capacity_array)
Sum selected nodes array and check less than node resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
capacity_array
|
Array
|
Node capacity array (N x 1) where N is number of nodes |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 |
|
check_snr_sufficient(state, params)
Check if SNR is sufficient for all connections Args: state (EnvState): Environment state params (EnvParams): Environment parameters Returns: jnp.array: 1 if SNR is sufficient for connection else 0
Source code in xlron/environments/env_funcs.py
2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 |
|
check_topology(action_history, topology_pattern)
Check that each unique virtual node (as indicated by topology pattern) is assigned to a consistent physical node i.e. start and end node of ring is same physical node. Method: For each node index in topology pattern, mask action history with that index, then find max value in masked array. If max value is not the same for all values for that virtual node in action history, then return 1, else 0. Array should be all zeroes at the end, so do an any() check on that. e.g. virtual topology pattern = [2,1,3,1,4,1,2] 3 node ring action history = [0,34,4,0,3,1,0] meaning v node "2" goes p node 0, v node "3" goes p node 4, v node "4" goes p node 3 The numbers in-between relate to the slot action. If any value in the array is 1, a virtual node is assigned to multiple different physical nodes. Need to check from both perspectives: 1. For each virtual node, check that all physical nodes are the same 2. For each physical node, check that all virtual nodes are the same
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action_history
|
Action history |
required | |
topology_pattern
|
Topology pattern |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 |
|
check_unique_nodes(node_departure_array)
Count negative values on each node (row) in node departure array, must not exceed 1.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_departure_array
|
Array
|
Node departure array (N x R) where N is number of nodes and R is number of resources |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 |
|
check_vone_action(state, remaining_actions, total_requested_nodes)
Check if action is valid. Combines checks for: - sufficient node capacities - unique nodes assigned - minimum two nodes assigned - all requested nodes assigned - correct topology pattern - no spectrum reuse
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
current state |
required | |
remaining_actions
|
remaining actions |
required | |
total_requested_nodes
|
total requested nodes |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 |
|
convert_node_probs_to_traffic_matrix(node_probs)
Convert list of node probabilities to symmetric traffic matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_probs
|
list
|
node probabilities |
required |
Returns:
Name | Type | Description |
---|---|---|
traffic_matrix |
Array
|
traffic matrix |
Source code in xlron/environments/env_funcs.py
1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 |
|
create_run_name(config)
Create name for run based on config flags
Source code in xlron/environments/env_funcs.py
2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 |
|
decrement_action_counter(state)
Decrement action counter in-place. Used in VONE environments.
Source code in xlron/environments/env_funcs.py
547 548 549 550 |
|
finalise_action_rsa(state, params)
Turn departure times positive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
current state |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
updated state |
Source code in xlron/environments/env_funcs.py
1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 |
|
finalise_action_rwalr(state, params)
Turn departure times positive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
current state |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
updated state |
Source code in xlron/environments/env_funcs.py
1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 |
|
finalise_vone_action(state)
Turn departure times positive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
current state |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
updated state |
Source code in xlron/environments/env_funcs.py
1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 |
|
format_vone_slot_request(state, action)
Format slot request for VONE action into format (source-node, slot, destination-node).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
current state |
required |
action
|
Array
|
action to format |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: formatted request |
Source code in xlron/environments/env_funcs.py
1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 |
|
generate_arrival_holding_times(key, params)
Generate arrival and holding times based on Poisson distributed events. To understand how sampling from e^-x can be transformed to sample from lambdae^-(x/lambda) see: https://en.wikipedia.org/wiki/Inverse_transform_sampling#Examples Basically, inverse transform sampling is used to sample from a distribution with CDF F(x). The CDF of the exponential distribution (lambdae^-{lambdax}) is F(x) = 1 - e^-{lambdax}. Therefore, the inverse CDF is x = -ln(1-u)/lambda, where u is sample from uniform distribution. Therefore, we need to divide jax.random.exponential() by lambda in order to scale the standard exponential CDF. Experimental histograms of this method compared to random.expovariate() in Python's random library show that the two methods are equivalent. Also see: https://numpy.org/doc/stable/reference/random/generated/numpy.random.exponential.html https://jax.readthedocs.io/en/latest/_autosummary/jax.random.exponential.html
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
PRNG key |
required | |
params
|
Environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
arrival_time |
Arrival time |
|
holding_time |
Holding time |
Source code in xlron/environments/env_funcs.py
809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 |
|
generate_vone_request(key, state, params)
Generate a new request for the VONE environment. The request has two rows. The first row shows the node and slot values. The first three elements of the second row show the number of unique nodes, the total number of steps, and the remaining steps. These first three elements comprise the action counter. The remaining elements of the second row show the virtual topology pattern, i.e. the connectivity of the virtual topology.
Source code in xlron/environments/env_funcs.py
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 |
|
get_best_modulation_format(state, path, initial_slot_index, launch_power, params)
Get best modulation format for lightpath. "Best" is the highest order that has SNR requirements below available. Try each modulation format, calculate SNR for each, then return the highest order possible. Args: state (EnvState): Environment state path (chex.Array): Path array initial_slot_index (int): Initial slot index params (EnvParams): Environment parameters Returns: jnp.array: Acceptable modulation format indices
Source code in xlron/environments/env_funcs.py
2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 |
|
get_best_modulation_format_simple(state, path, initial_slot_index, params)
Get modulation format for lightpath. Assume worst case (least Gaussian) modulation format when calculating SNR. Args: state (EnvState): Environment state path (chex.Array): Path array initial_slot_index (int): Initial slot index params (EnvParams): Environment parameters Returns: jnp.array: Acceptable modulation format indices
Source code in xlron/environments/env_funcs.py
2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 |
|
get_centre_frequency(initial_slot_index, num_slots, params)
Get centre frequency for new lightpath
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_slot_index
|
Array
|
Centre frequency of first slot |
required |
num_slots
|
float
|
Number of slots |
required |
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Centre frequency for new lightpath |
Source code in xlron/environments/env_funcs.py
2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 |
|
get_edge_disjoint_paths(graph)
Get edge disjoint paths between all nodes in graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
Graph
|
graph |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
edge disjoint paths (path is list of edges) |
Source code in xlron/environments/env_funcs.py
1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 |
|
get_launch_power(state, path_action, power_action, params)
Get launch power for new lightpath. N.B. launch power is specified in dBm but is converted to linear units when stored in channel_power_array. This func returns linear units (mW). Path action is used to determine the launch power in the case of tabular launch power type. Power action is used to determine the launch power in the case of RL launch power type. During masking, power action is set as state.launch_power_array[0], which is set by the RL agent. Args: state (EnvState): Environment state path_action (chex.Array): Action specifying path index (0 to k_paths-1) power_action (chex.Array): Action specifying launch power in dBm params (EnvParams): Environment parameters Returns: chex.Array: Launch power for new lightpath
Source code in xlron/environments/env_funcs.py
3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 |
|
get_lightpath_snr(state, params)
Get SNR for each link on path. N.B. that in most cases it is more efficient to calculate the SNR for every possible path, rather than a slot-by-slot basis. But in some cases slot-by-slot is better i.e. when kN(N-1)/2 > LS Args: state (RSAGNModelEnvState): Environment state params (RSAGNModelEnvParams): Environment parameters
Returns:
Type | Description |
---|---|
Array
|
chex.array: SNR for each link on path |
Source code in xlron/environments/env_funcs.py
2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 |
|
get_minimum_snr_of_channels_on_path(state, path, slot_index, req_slots, params)
Get the minimum value of the SNR on newly assigned channels. N.B. this requires the link_snr_array to have already been calculated and present in state.
Source code in xlron/environments/env_funcs.py
3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 |
|
get_num_spectral_features(n_nodes)
Heuristic for number of spectral features based on graph size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_nodes
|
int
|
Number of nodes in the graph |
required |
Returns:
Type | Description |
---|---|
int
|
Number of spectral features to use, clamped between 3 and 15. |
int
|
Follows log2(n_nodes) scaling as reasonable default. |
Source code in xlron/environments/env_funcs.py
35 36 37 38 39 40 41 42 43 44 45 46 |
|
get_path_from_path_index_array(path_index_array, path_link_array)
Get path from path index array. Args: path_index_array (chex.Array): Path index array path_link_array (chex.Array): Path link array
Returns:
Type | Description |
---|---|
Array
|
jnp.array: path index values replaced with binary path-link arrays |
Source code in xlron/environments/env_funcs.py
2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 |
|
get_path_index_array(params, nodes)
Indices of paths between source and destination from path array
Source code in xlron/environments/env_funcs.py
742 743 744 745 746 747 748 749 |
|
get_path_indices(s, d, k, N, directed=False)
Get path indices for a given source, destination and number of paths. If source > destination and the graph is directed (two fibres per link, one in each direction) then an offset is added to the index to get the path in the other direction (the offset is the total number source-dest pairs).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
int
|
Source node index |
required |
d
|
int
|
Destination node index |
required |
k
|
int
|
Number of paths |
required |
N
|
int
|
Number of nodes |
required |
directed
|
bool
|
Whether graph is directed. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
Array
|
jnp.array: Start index on path-link array for candidate paths |
Source code in xlron/environments/env_funcs.py
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 |
|
get_path_slots(link_slot_array, params, nodes_sd, i, agg_func='max')
Get slots on each constitutent link of path from link_slot_array (L x S), then aggregate to get (S x 1) representation of slots on path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Array
|
link-slot array |
required |
params
|
EnvParams
|
environment parameters |
required |
nodes_sd
|
Array
|
source-destination nodes |
required |
i
|
int
|
path index |
required |
agg_func
|
str
|
aggregation function (max or sum). If max, result will be available slots on path. If sum, result will contain information on edge features. |
'max'
|
Returns:
Name | Type | Description |
---|---|---|
slots |
Array
|
slots on path |
Source code in xlron/environments/env_funcs.py
1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 |
|
get_paths(params, nodes)
Get k paths between source and destination
Source code in xlron/environments/env_funcs.py
752 753 754 755 756 |
|
get_paths_obs_gn_model(state, params)
Get observation space for launch power optimization (with numerical stability).
Source code in xlron/environments/env_funcs.py
3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 |
|
get_paths_se(params, nodes)
Get max. spectral efficiency of modulation format on k paths between source and destination
Source code in xlron/environments/env_funcs.py
759 760 761 762 763 764 |
|
get_required_snr_se_kurtosis_array(modulation_format_index_array, col_index, params)
Convert modulation format index to required SNR or spectral efficiency. Modulation format index array contains the index of the modulation format used by the channel. The modulation index references a row in the modulations array, which contains SNR and SE values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
modulation_format_index_array
|
Array
|
Modulation format index array |
required |
col_index
|
int
|
Column index for required SNR or spectral efficiency |
required |
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
Array
|
jnp.array: Required SNR for each channel (min. SNR for empty channel (mod. index 0)) |
Source code in xlron/environments/env_funcs.py
2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 |
|
get_snr_link_array(state, params)
Get SNR per link Args: state (EnvState): Environment state params (EnvParams): Environment parameters Returns: jnp.array: SNR per link
Source code in xlron/environments/env_funcs.py
2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 |
|
get_spectral_features(laplacian, num_features)
Compute spectral node features from symmetric normalized graph Laplacian.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adj
|
Adjacency matrix of the graph |
required | |
num_features
|
int
|
Number of eigenvector features to extract |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Array of shape (n_nodes, num_features) containing eigenvectors corresponding |
ndarray
|
to the smallest non-zero eigenvalues of the graph Laplacian. |
Notes
- Skips trivial eigenvectors (those with near-zero eigenvalues)
- Eigenvectors are ordered by ascending eigenvalue magnitude
- Runtime is O(n^3) - use only for small/medium graphs
- Eigenvector signs are arbitrary (may vary between runs)
Source code in xlron/environments/env_funcs.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
implement_action_rmsa_gn_model(state, action, params)
Implement action for RSA GN model. Update following arrays: - link_slot_array - link_slot_departure_array - link_snr_array - modulation_format_index_array - channel_power_array - active_path_array Args: state (EnvState): Environment state action (chex.Array): Action tuple (first is path action, second is launch_power) params (EnvParams): Environment parameters Returns: EnvState: Updated environment state
Source code in xlron/environments/env_funcs.py
2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 |
|
implement_action_rsa(state, action, params)
Implement action to assign slots on links.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
current state |
required |
action
|
Array
|
action to implement |
required |
params
|
EnvParams
|
environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
updated state |
Source code in xlron/environments/env_funcs.py
1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 |
|
implement_action_rsa_gn_model(state, action, params)
Implement action for RSA GN model. Update following arrays: - link_slot_array - link_slot_departure_array - link_snr_array - modulation_format_index_array - channel_power_array - active_path_array Args: state (EnvState): Environment state action (chex.Array): Action tuple (first is path action, second is launch_power) params (EnvParams): Environment parameters Returns: EnvState: Updated environment state
Source code in xlron/environments/env_funcs.py
2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 |
|
implement_action_rwalr(state, action, params)
For use in RWALightpathReuseEnv. Update link_slot_array and link_slot_departure_array to reflect new lightpath assignment. Update link_capacity_array with new capacity if lightpath is available. Undo link_capacity_update if over capacity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
action
|
Array
|
Action array |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 |
|
implement_node_action(state, s_node, d_node, s_request, d_request, n=2)
Update node capacity, node resource and node departure arrays
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
State
|
current state |
required |
s_node
|
int
|
source node |
required |
d_node
|
int
|
destination node |
required |
s_request
|
int
|
source node request |
required |
d_request
|
int
|
destination node request |
required |
n
|
int
|
number of nodes to implement. Defaults to 2. |
2
|
Returns:
Name | Type | Description |
---|---|---|
State |
EnvState
|
updated state |
Source code in xlron/environments/env_funcs.py
1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 |
|
implement_path_action(state, path, initial_slot_index, num_slots)
Update link-slot and link-slot departure arrays. Times are set to negative until turned positive by finalisation (after checks).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
State
|
current state |
required |
path
|
int
|
path to implement |
required |
initial_slot_index
|
int
|
initial slot index |
required |
num_slots
|
int
|
number of slots to implement |
required |
Source code in xlron/environments/env_funcs.py
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 |
|
implement_vone_action(state, action, total_actions, remaining_actions, params)
Implement action to assign nodes (1, 2, or 0 nodes assigned per action) and assign slots and links for lightpath.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
current state |
required |
action
|
Array
|
action to implement (node, node, path_slot_action) |
required |
total_actions
|
Scalar
|
total number of actions to implement for current request |
required |
remaining_actions
|
Scalar
|
remaining actions to implement |
required |
k
|
number of paths to consider |
required | |
N
|
number of nodes to assign |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
updated state |
Source code in xlron/environments/env_funcs.py
1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 |
|
init_action_counter()
Initialize action counter. First index is num unique nodes, second index is total steps, final is remaining steps until completion of request. Only used in VONE environments.
Source code in xlron/environments/env_funcs.py
539 540 541 542 543 544 |
|
init_action_history(params)
Initialize action history
Source code in xlron/environments/env_funcs.py
574 575 576 577 |
|
init_active_lightpaths_array(params)
Initialise active lightpath array. Stores path indices of all active paths on the network in a 1 x M array. M is MIN(max_requests, num_links * link_resources / min_slots). min_slots is the minimum number of slots required for a lightpath i.e. max(values_bw)/ slot_size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
Returns: jnp.array: Active path array (default value -1, empty path)
Source code in xlron/environments/env_funcs.py
2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 |
|
init_active_lightpaths_array_departure(params)
Initialise active lightpath array. Stores path indices of all active paths on the network in a 1 x M array. M is MIN(max_requests, num_links * link_resources / min_slots). min_slots is the minimum number of slots required for a lightpath i.e. max(values_bw)/ slot_size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
Returns: jnp.array: Active path array (default value -1, empty path)
Source code in xlron/environments/env_funcs.py
2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 |
|
init_active_path_array(params)
Initialise active path array. Stores details of full path utilised by lightpath on each frequency slot. Args: params (EnvParams): Environment parameters Returns: jnp.array: Active path array
Source code in xlron/environments/env_funcs.py
2569 2570 2571 2572 2573 2574 2575 2576 |
|
init_channel_centre_bw_array(params)
Initialise channel centre array. Args: params (EnvParams): Environment parameters Returns: jnp.array: Channel centre array
Source code in xlron/environments/env_funcs.py
2549 2550 2551 2552 2553 2554 2555 2556 |
|
init_channel_power_array(params)
Initialise channel power array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params
|
EnvParams
|
Environment parameters |
required |
Returns: jnp.array: Channel power array
Source code in xlron/environments/env_funcs.py
2538 2539 2540 2541 2542 2543 2544 2545 2546 |
|
init_graph_tuple(state, params, adj, exclude_source_dest=False)
Initialise graph tuple for use with Jraph GNNs. Args: state (EnvState): Environment state params (EnvParams): Environment parameters adj (jnp.array): Adjacency matrix of the graph Returns: jraph.GraphsTuple: Graph tuple
Source code in xlron/environments/env_funcs.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
init_link_capacity_array(params)
Initialise link capacity array. Represents available data rate for lightpath on each link. Default is high value (1e6) for unoccupied slots. Once lightpath established, capacity is determined by corresponding entry in path capacity array.
Source code in xlron/environments/env_funcs.py
2170 2171 2172 2173 2174 |
|
init_link_length_array(graph)
Initialise link length array. Args: graph (nx.Graph): NetworkX graph Returns:
Source code in xlron/environments/env_funcs.py
185 186 187 188 189 190 191 192 193 194 195 |
|
init_link_length_array_gn_model(graph, max_span_length, max_spans)
Initialise link length array for environements that use GN model of physical layer. We assume each link has spans of equal length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
Graph
|
NetworkX graph |
required |
Returns: jnp.array: Link length array (L x max_spans)
Source code in xlron/environments/env_funcs.py
2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 |
|
init_link_slot_array(params)
Initialize empty (all zeroes) link-slot array. 0 means slot is free, -1 means occupied. Args: params (EnvParams): Environment parameters Returns: jnp.array: Link slot array (E x S) where E is number of edges and S is number of slots
Source code in xlron/environments/env_funcs.py
500 501 502 503 504 505 506 507 |
|
init_link_slot_mask(params, agg=1)
Initialize link mask
Source code in xlron/environments/env_funcs.py
527 528 529 530 |
|
init_link_snr_array(params)
Initialise signal-to-noise ratio (SNR) array. Args: params (EnvParams): Environment parameters Returns: jnp.array: SNR array
Source code in xlron/environments/env_funcs.py
2527 2528 2529 2530 2531 2532 2533 2534 2535 |
|
init_mod_format_mask(params)
Initialize link mask
Source code in xlron/environments/env_funcs.py
533 534 535 536 |
|
init_modulation_format_index_array(params)
Initialise modulation format index array. Args: params (EnvParams): Environment parameters Returns: jnp.array: Modulation format index array
Source code in xlron/environments/env_funcs.py
2559 2560 2561 2562 2563 2564 2565 2566 |
|
init_modulations_array(modulations_filepath=None)
Initialise array of maximum spectral efficiency for modulation format on path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
modulations_filepath
|
str
|
Path to CSV file containing modulation formats. Defaults to None. |
None
|
Returns: jnp.array: Array of maximum spectral efficiency for modulation format on path. First two columns are maximum path length and spectral efficiency.
Source code in xlron/environments/env_funcs.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
|
init_node_capacity_array(params)
Initialize node array with uniform resources. Args: params (EnvParams): Environment parameters Returns: jnp.array: Node capacity array (N x 1) where N is number of nodes
Source code in xlron/environments/env_funcs.py
490 491 492 493 494 495 496 497 |
|
init_node_mask(params)
Initialize node mask
Source code in xlron/environments/env_funcs.py
521 522 523 524 |
|
init_node_resource_array(params)
Array to track node resources occupied by virtual nodes
Source code in xlron/environments/env_funcs.py
568 569 570 571 |
|
init_path_capacity_array(link_length_array, path_link_array, min_request=1, scale_factor=1.0, alpha=0.0002, NF=4.5, B=10000000000000.0, R_s=100000000000.0, beta_2=-2.17e-26, gamma=0.0012, L_s=100000.0, lambda0=1.55e-06)
Calculated from Nevin paper: https://api.repository.cam.ac.uk/server/api/core/bitstreams/b80e7a9c-a86b-4b30-a6d6-05017c60b0c8/content
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_length_array
|
Array
|
Array of link lengths |
required |
path_link_array
|
Array
|
Array of links on paths |
required |
min_request
|
int
|
Minimum data rate request size. Defaults to 100 GBps. |
1
|
scale_factor
|
float
|
Scale factor for link capacity. Defaults to 1.0. |
1.0
|
alpha
|
float
|
Fibre attenuation coefficient. Defaults to 0.2e-3 /m |
0.0002
|
NF
|
float
|
Amplifier noise figure. Defaults to 4.5 dB. |
4.5
|
B
|
float
|
Total modulated bandwidth. Defaults to 10e12 Hz. |
10000000000000.0
|
R_s
|
float
|
Symbol rate. Defaults to 100e9 Baud. |
100000000000.0
|
beta_2
|
float
|
Dispersion parameter. Defaults to -21.7e-27 s^2/m. |
-2.17e-26
|
gamma
|
float
|
Nonlinear coefficient. Defaults to 1.2e-3 /W/m. |
0.0012
|
L_s
|
float
|
Span length. Defaults to 100e3 m. |
100000.0
|
lambda0
|
float
|
Wavelength. Defaults to 1550e-9 m. |
1.55e-06
|
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Array of link capacities in Gbps |
Source code in xlron/environments/env_funcs.py
2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 |
|
init_path_index_array(params)
Initialise path index array. Represents index of lightpath occupying each slot.
Source code in xlron/environments/env_funcs.py
2177 2178 2179 |
|
init_path_length_array(path_link_array, graph)
Initialise path length array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_link_array
|
Array
|
Path-link array |
required |
graph
|
Graph
|
NetworkX graph |
required |
Returns: chex.Array: Path length array
Source code in xlron/environments/env_funcs.py
331 332 333 334 335 336 337 338 339 340 341 342 |
|
init_path_link_array(graph, k, disjoint=False, weight='weight', directed=False, modulations_array=None, rwa_lr=False, scale_factor=1.0, path_snr=False)
Initialise path-link array. Each path is defined by a link utilisation array (one row in the path-link array). 1 indicates link corresponding to index is used, 0 indicates not used.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
Graph
|
NetworkX graph |
required |
k
|
int
|
Number of paths |
required |
disjoint
|
bool
|
Whether to use edge-disjoint paths. Defaults to False. |
False
|
weight
|
str
|
Sort paths by edge attribute. Defaults to "weight". |
'weight'
|
directed
|
bool
|
Whether graph is directed. Defaults to False. |
False
|
modulations_array
|
Array
|
Array of maximum spectral efficiency for modulation format on path. Defaults to None. |
None
|
rwa_lr
|
bool
|
Whether the environment is RWA with lightpath reuse (affects path ordering). |
False
|
path_snr
|
bool
|
If GN model is used, include extra row of zeroes for unutilised paths |
False
|
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Path-link array (N(N-1)*k x E) where N is number of nodes, E is number of edges, k is number of shortest paths |
Source code in xlron/environments/env_funcs.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
|
init_path_se_array(path_length_array, modulations_array)
Initialise array of maximum spectral efficiency for highest-order modulation format on path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_length_array
|
array
|
Array of path lengths |
required |
modulations_array
|
array
|
Array of maximum spectral efficiency for modulation format on path |
required |
Returns:
Type | Description |
---|---|
jnp.array: Array of maximum spectral efficiency for on path |
Source code in xlron/environments/env_funcs.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
|
init_rsa_request_array()
Initialize request array
Source code in xlron/environments/env_funcs.py
516 517 518 |
|
init_traffic_matrix(key, params)
Initialize traffic matrix. Allows for random traffic matrix or uniform traffic matrix. Source-dest traffic requests are sampled probabilistically from the resulting traffic matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
PRNGKey
|
PRNG key |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
jnp.array: Traffic matrix |
Source code in xlron/environments/env_funcs.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
|
init_virtual_topology_patterns(pattern_names)
Initialise virtual topology patterns. First 3 digits comprise the "action counter": first index is num unique nodes, second index is total steps, final is remaining steps until completion of request. Remaining digits define the topology pattern, with 1 to indicate links and other positive integers are node indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pattern_names
|
list
|
List of virtual topology pattern names |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Array of virtual topology patterns |
Source code in xlron/environments/env_funcs.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
|
init_vone_request_array(params)
Initialize request array either with uniform resources
Source code in xlron/environments/env_funcs.py
510 511 512 513 |
|
make_graph(topology_name='conus', topology_directory=None)
Create graph from topology definition. Topologies must be defined in JSON format in the topologies directory and named as the topology name with .json extension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topology_name
|
str
|
topology name |
'conus'
|
topology_directory
|
str
|
topology directory |
None
|
Returns:
Name | Type | Description |
---|---|---|
graph |
graph |
Source code in xlron/environments/env_funcs.py
1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 |
|
mask_nodes(state, num_nodes)
Returns mask of valid actions for node selection. 1 for valid action, 0 for invalid action.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
num_nodes
|
Scalar
|
Number of nodes |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 |
|
mask_slots(state, params, request)
Returns binary mask of valid actions. 1 for valid action, 0 for invalid action.
- Check request for source and destination nodes
- For each path:
- Get current slots on path (with padding on end to avoid out of bounds)
- Get mask for required slots on path
- Multiply through current slots with required slots mask to check if slots available on path
- Remove padding from mask
- Return path mask
- Update total mask with path mask
- If aggregate_slots > 1, aggregate slot mask to reduce action space
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
request
|
Array
|
Request array in format [source_node, data-rate, destination_node] |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 |
|
mask_slots_rmsa_gn_model(state, params, request)
For use in RSAGNModelEnv. 1. For each path: 1.1 Get path slots 1.2 Get launch power
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
RSAGNModelEnvState
|
Environment state |
required |
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
request
|
Array
|
Request array in format [source_node, data-rate, destination_node] |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 |
|
mask_slots_rwalr(state, params, request)
For use in RWALightpathReuseEnv. Each lightpath has a maximum capacity defined in path_capacity_array. This is updated when a lightpath is assigned. If remaining path capacity is less than current request, corresponding link-slots are masked out. If link-slot is in use by another lightpath for a different source and destination node (even if not full) it is masked out. Step 1: - Mask out slots that are not valid based on path capacity (check link_capacity_array) Step 2: - Mask out slots that are not valid based on lightpath reuse (check path_index_array)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
request
|
Array
|
Request array in format [source_node, data-rate, destination_node] |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 |
|
normalise_traffic_matrix(traffic_matrix)
Normalise traffic matrix to sum to 1
Source code in xlron/environments/env_funcs.py
580 581 582 583 |
|
pad_array(array, fill_value)
Pad a ragged multidimensional array to rectangular shape. Used for training on multiple topologies. Source: https://codereview.stackexchange.com/questions/222623/pad-a-ragged-multidimensional-array-to-rectangular-shape
Parameters:
Name | Type | Description | Default |
---|---|---|---|
array
|
array to pad |
required | |
fill_value
|
value to fill with |
required |
Returns:
Name | Type | Description |
---|---|---|
result |
padded array |
Source code in xlron/environments/env_funcs.py
2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 |
|
path_action_only(topology_pattern, action_counter, remaining_actions)
This is to check if node has already been assigned, therefore just need to assign slots (n=0)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topology_pattern
|
Array
|
Topology pattern |
required |
action_counter
|
Array
|
Action counter |
required |
remaining_actions
|
Scalar
|
Remaining actions |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if only path action, False if node action |
Source code in xlron/environments/env_funcs.py
1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 |
|
poisson(key, lam, shape=(), dtype=dtypes.float_)
Sample Exponential random values with given shape and float dtype.
The values are distributed according to the probability density function:
.. math:: f(x) = \lambda e^{-\lambda x}
on the domain :math:0 \le x < \infty
.
Args:
key: a PRNG key used as the random key.
lam: a positive float32 or float64 Tensor
indicating the rate parameter
shape: optional, a tuple of nonnegative integers representing the result
shape. Default ().
dtype: optional, a float dtype for the returned values (default float64 if
jax_enable_x64 is true, otherwise float32).
Returns: A random array with the specified shape and dtype.
Source code in xlron/environments/env_funcs.py
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 |
|
process_path_action(state, params, path_action)
Process path action to get path index and initial slot index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
State
|
current state |
required |
params
|
Params
|
environment parameters |
required |
path_action
|
int
|
path action |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
(Array, Array)
|
path index |
int |
(Array, Array)
|
initial slot index |
Source code in xlron/environments/env_funcs.py
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 |
|
read_rsa_request(request_array)
Read RSA request from request array. Return source-destination nodes and bandwidth request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request_array
|
Array
|
request array |
required |
Returns:
Type | Description |
---|---|
Tuple[Array, Array]
|
Tuple[chex.Array, chex.Array]: source-destination nodes and bandwidth request |
Source code in xlron/environments/env_funcs.py
1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 |
|
remove_expired_node_requests(state)
Check for values in node_departure_array that are less than the current time but greater than zero (negative time indicates the request is not yet finalised). If found, set to infinity in node_departure_array, set to zero in node_resource_array, and increase node_capacity_array by expired resources on each node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 |
|
remove_expired_services_rmsa_gn_model(state)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 |
|
remove_expired_services_rsa(state)
Check for values in link_slot_departure_array that are less than the current time but greater than zero (negative time indicates the request is not yet finalised). If found, set to zero in link_slot_array and link_slot_departure_array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 |
|
remove_expired_services_rsa_gn_model(state)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 |
|
remove_expired_services_rwalr(state)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 |
|
required_slots(bitrate, se, channel_width, guardband=1)
Calculate required slots for a given bitrate and spectral efficiency.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bit_rate
|
float
|
Bit rate in Gbps |
required |
se
|
float
|
Spectral efficiency in bps/Hz |
required |
channel_width
|
float
|
Channel width in GHz |
required |
guardband
|
int
|
Guard band. Defaults to 1. |
1
|
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
Required slots |
Source code in xlron/environments/env_funcs.py
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 |
|
set_c_l_band_gap(link_slot_array, params, val)
Set C+L band gap in link slot array Args: link_slot_array (chex.Array): Link slot array params (RSAGNModelEnvParams): Environment parameters val (int): Value to set Returns: chex.Array: Link slot array with C+L band gap
Source code in xlron/environments/env_funcs.py
2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 |
|
undo_action_rmsa_gn_model(state, params)
Undo action for RMSA GN model Args: state (EnvState): Environment state action (chex.Array): Action array params (EnvParams): Environment parameters Returns: EnvState: Updated environment state
Source code in xlron/environments/env_funcs.py
3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 |
|
undo_action_rsa(state, params)
If the request is unsuccessful i.e. checks fail, then remove the partial (unfinalised) resource allocation. Partial resource allocation is indicated by negative time in link slot departure array. Check for values in link_slot_departure_array that are less than zero. If found, increase link_slot_array by +1 and link_slot_departure_array by current_time + holding_time of current request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 |
|
undo_action_rsa_gn_model(state, params)
Undo action for RSA GN model Args: state (EnvState): Environment state action (chex.Array): Action array params (EnvParams): Environment parameters Returns: EnvState: Updated environment state
Source code in xlron/environments/env_funcs.py
3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 |
|
undo_action_rwalr(state, params)
If the request is unsuccessful i.e. checks fail, then remove the partial (unfinalised) resource allocation. Partial resource allocation is indicated by negative time in link slot departure array. Check for values in link_slot_departure_array that are less than zero. If found, increase link_slot_array by +1 and link_slot_departure_array by current_time + holding_time of current request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 |
|
undo_node_action(state)
If the request is unsuccessful i.e. checks fail, then remove the partial (unfinalised) resource allocation. Partial resource allocation is indicated by negative time in node departure array. Check for values in node_departure_array that are less than zero. If found, set to infinity in node_departure_array, set to zero in node_resource_array, and increase node_capacity_array by expired resources on each node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 |
|
update_action_history(action_history, action_counter, action)
Update action history by adding action to first available index starting from the end.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action_history
|
Array
|
Action history |
required |
action_counter
|
Array
|
Action counter |
required |
action
|
Array
|
Action to add to history |
required |
Returns:
Type | Description |
---|---|
Array
|
Updated action_history |
Source code in xlron/environments/env_funcs.py
850 851 852 853 854 855 856 857 858 859 860 861 |
|
update_active_lightpaths_array(state, path_index)
Update active lightpaths array with new path index. Find the first index of the array with value -1 and replace with path index. Args: state (RSAGNModelEnvState): Environment state path_index (int): Path index to add to active lightpaths array Returns: jnp.array: Updated active lightpaths array
Source code in xlron/environments/env_funcs.py
2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 |
|
update_active_lightpaths_array_departure(state, time)
Update active lightpaths array with new path index. Find the first index of the array with value -1 and replace with path index. Args: state (RSAGNModelEnvState): Environment state time (float): Departure time Returns: jnp.array: Updated active lightpaths array
Source code in xlron/environments/env_funcs.py
2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 |
|
update_graph_tuple(state, params)
Update graph tuple for use with Jraph GNNs. Edge and node features are updated from link_slot_array and node_capacity_array respectively. Global features are updated as request_array. Args: state (EnvState): Environment state params (EnvParams): Environment parameters Returns: state (EnvState): Environment state with updated graph tuple
Source code in xlron/environments/env_funcs.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
|
update_node_array(node_indices, array, node, request)
Used to udated selected_nodes array with new requested resources on each node, for use in
Source code in xlron/environments/env_funcs.py
973 974 975 |
|
vmap_set_path_links(link_slot_array, path, initial_slot, num_slots, value)
Set relevant slots along links in path to val.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Array
|
Link slot array |
required |
path
|
Array
|
Path (row from path-link array that indicates links used by path) |
required |
initial_slot
|
int
|
Initial slot |
required |
num_slots
|
int
|
Number of slots |
required |
value
|
int
|
Value to set on link slot array |
required |
Returns:
Type | Description |
---|---|
Array
|
Updated link slot array |
Source code in xlron/environments/env_funcs.py
904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 |
|
vmap_update_node_departure(node_departure_array, selected_nodes, value)
Called when implementing node action. Sets request departure time ("value") in place of first "inf" i.e. unoccupied index on node departure array for selected nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_departure_array
|
Array
|
(N x R) Node departure array |
required |
selected_nodes
|
Array
|
(N x 1) Selected nodes (non-zero value on selected node indices) |
required |
value
|
int
|
Value to set on node departure array |
required |
Returns:
Type | Description |
---|---|
Array
|
Updated node departure array |
Source code in xlron/environments/env_funcs.py
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 |
|
vmap_update_node_resources(node_resource_array, selected_nodes)
Called when implementing node action. Sets requested node resources on selected nodes in place of first "zero" i.e. unoccupied index on node resource array for selected nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_resource_array
|
(N x R) Node resource array |
required | |
selected_nodes
|
(N x 1) Requested resources on selected nodes |
required |
Returns:
Type | Description |
---|---|
Updated node resource array |
Source code in xlron/environments/env_funcs.py
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 |
|
vmap_update_path_links(link_slot_array, path, initial_slot, num_slots, value)
Update relevant slots along links in path to current_val - val.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Array
|
Link slot array |
required |
path
|
Array
|
Path (row from path-link array that indicates links used by path) |
required |
initial_slot
|
int
|
Initial slot |
required |
num_slots
|
int
|
Number of slots |
required |
value
|
int
|
Value to subtract from link slot array |
required |
Returns:
Type | Description |
---|---|
Array
|
Updated link slot array |
Source code in xlron/environments/env_funcs.py
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 |
|
Models
ActorCriticGNN
Bases: Module
Combine the GNN actor and critic networks into a single class
Source code in xlron/models/models.py
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 |
|
num_power_levels
property
Calculate number of power levels dynamically
power_levels
property
Calculate power levels dynamically
sample_action(seed, dist, log_prob=False, deterministic=False)
Sample an action from the distributions. This assumes dist is a tuple of path and power distributions OR just the appropriate distribution.
Source code in xlron/models/models.py
708 709 710 711 712 713 714 715 716 717 718 |
|
sample_action_path(seed, dist, log_prob=False, deterministic=False)
Sample an action from the distribution.
Source code in xlron/models/models.py
668 669 670 671 672 673 |
|
sample_action_path_power(seed, dist, log_prob=False, deterministic=False)
Sample an action from the distributions. This assumes dist is a tuple of path and power distributions.
Source code in xlron/models/models.py
699 700 701 702 703 704 705 706 |
|
sample_action_power(seed, dist, log_prob=False, deterministic=False)
Sample an action and convert to power level
Source code in xlron/models/models.py
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 |
|
ActorCriticMLP
Bases: Module
Source code in xlron/models/models.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
sample_action(seed, dist, log_prob=False, deterministic=False)
Sample an action from the distribution
Source code in xlron/models/models.py
117 118 119 120 121 122 |
|
ActorGNN
Bases: Module
Actor network for PPO algorithm. Takes the current state and returns a distrax.Categorical distribution over actions.
Source code in xlron/models/models.py
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
|
num_power_levels
property
Calculate number of power levels dynamically
power_levels
property
Calculate power levels dynamically
__call__(state, params)
The ActorGNN network takes the current network state in the form of a GraphTuple and returns a distrax.Categorical distribution over actions. The graph is processed by a GraphNet module, and the resulting graph is indexed to construct a matrix of the edge features. The edge features are then normalised by the link length from the environment parameters, and the current request is read from the request array. The request is used to retrieve the edge features from the edge_features array for the corresponding shortest k-paths. The edge features are aggregated for each path according to the "agg_func" e.g. sum, and the action distribution array is updated. Returns a distrax.Categorical distribution, from which actions can be sampled.
:param state: EnvState :param params: EnvParams
:return: distrax.Categorical distribution over actions
Source code in xlron/models/models.py
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
|
GraphNet
Bases: Module
A complete Graph Network model defined with Jraph.
Source code in xlron/models/models.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
|
LaunchPowerActorCriticMLP
Bases: Module
In this implementation, we take an observation of th current request + statistics on each of the K candidate paths. We make K forward passes, one for each path, and output a distribution over power levels for each path. In action selection, we then sample from each distribution and use the sampled power levels to mask paths for the routing heuristic, which then determines the path taken. The selected path index is then used to select which output action, distribution, and value to use for the loss calculation.
Source code in xlron/models/models.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
|
num_power_levels
property
Calculate number of power levels dynamically
power_levels
property
Calculate power levels dynamically
get_action_probs(dist)
Get probabilities for discrete case or pdf for continuous case
Source code in xlron/models/models.py
275 276 277 278 279 280 281 |
|
sample_action(seed, dist, log_prob=False, deterministic=False)
Sample an action and convert to power level
Source code in xlron/models/models.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
MLP
Bases: Module
A multi-layer perceptron.
Source code in xlron/models/models.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
add_graphs_tuples(graphs, other_graphs)
Adds the nodes, edges and global features from other_graphs to graphs.
Source code in xlron/models/models.py
30 31 32 33 34 35 36 37 38 |
|
crelu(x)
Computes the Concatenated ReLU (CReLU) activation function.
Source code in xlron/models/models.py
24 25 26 27 |
|
Heuristics
DeepRMSAEnvState
Bases: RSAEnvState
Dataclass to hold environment state for DeepRMSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_stats
|
Array
|
Path stats array containing |
required |
Source code in xlron/environments/dataclasses.py
191 192 193 194 195 196 197 198 199 200 201 202 |
|
EnvParams
Dataclass to hold environment parameters. Parameters are immutable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_requests
|
Scalar
|
Maximum number of requests in an episode |
required |
incremental_loading
|
Scalar
|
Incremental increase in traffic load (non-expiring requests) |
required |
end_first_blocking
|
Scalar
|
End episode on first blocking event |
required |
continuous_operation
|
Scalar
|
If True, do not reset the environment at the end of an episode |
required |
edges
|
Array
|
Two column array defining source-dest node-pair edges of the graph |
required |
slot_size
|
Scalar
|
Spectral width of frequency slot in GHz |
required |
consider_modulation_format
|
Scalar
|
If True, consider modulation format to determine required slots |
required |
link_length_array
|
Array
|
Array of link lengths |
required |
aggregate_slots
|
Scalar
|
Number of slots to aggregate into a single action (First-Fit with aggregation) |
required |
guardband
|
Scalar
|
Guard band in slots |
required |
directed_graph
|
bool
|
Whether graph is directed (one fibre per link per transmission direction) |
required |
Source code in xlron/environments/dataclasses.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
EnvState
Dataclass to hold environment state. State is mutable and arrays are traced on JIT compilation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
current_time
|
Scalar
|
Current time in environment |
required |
holding_time
|
Scalar
|
Holding time of current request |
required |
total_timesteps
|
Scalar
|
Total timesteps in environment |
required |
total_requests
|
Scalar
|
Total requests in environment |
required |
graph
|
GraphsTuple
|
Graph tuple representing network state |
required |
full_link_slot_mask
|
Array
|
Action mask for link slot action (including if slot actions are aggregated) |
required |
accepted_services
|
Array
|
Number of accepted services |
required |
accepted_bitrate
|
Array
|
Accepted bitrate |
required |
Source code in xlron/environments/dataclasses.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
GNModelEnvParams
Bases: RSAEnvParams
Dataclass to hold environment state for GN model environments.
Source code in xlron/environments/dataclasses.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
GNModelEnvState
Bases: RSAEnvState
Dataclass to hold environment state for RSA with GN model.
Source code in xlron/environments/dataclasses.py
276 277 278 279 280 281 282 283 284 285 286 287 |
|
LogEnvState
Dataclass to hold environment state for logging.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
env_state
|
EnvState
|
Environment state |
required |
lengths
|
Scalar
|
Lengths |
required |
returns
|
Scalar
|
Returns |
required |
cum_returns
|
Scalar
|
Cumulative returns |
required |
episode_lengths
|
Scalar
|
Episode lengths |
required |
episode_returns
|
Scalar
|
Episode returns |
required |
accepted_services
|
Scalar
|
Accepted services |
required |
accepted_bitrate
|
Scalar
|
Accepted bitrate |
required |
done
|
Scalar
|
Done |
required |
Source code in xlron/environments/dataclasses.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
MultiBandRSAEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
237 238 239 240 241 242 |
|
MultiBandRSAEnvState
Bases: RSAEnvState
Dataclass to hold environment state for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
230 231 232 233 234 |
|
RMSAGNModelEnvParams
Bases: GNModelEnvParams
Dataclass to hold environment params for RMSA with GN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_snr_array
|
Array
|
Link SNR array |
required |
Source code in xlron/environments/dataclasses.py
306 307 308 309 310 311 312 313 |
|
RMSAGNModelEnvState
Bases: GNModelEnvState
Dataclass to hold environment state for RMSA with GN model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_snr_array
|
Array
|
Link SNR array |
required |
Source code in xlron/environments/dataclasses.py
316 317 318 319 320 321 322 323 324 325 |
|
RSAEnvParams
Bases: EnvParams
Dataclass to hold environment parameters for RSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_nodes
|
Scalar
|
Number of nodes |
required |
num_links
|
Scalar
|
Number of links |
required |
link_resources
|
Scalar
|
Number of link resources |
required |
k_paths
|
Scalar
|
Number of paths |
required |
mean_service_holding_time
|
Scalar
|
Mean service holding time |
required |
load
|
Scalar
|
Load |
required |
arrival_rate
|
Scalar
|
Arrival rate |
required |
path_link_array
|
Array
|
Path link array |
required |
random_traffic
|
bool
|
Random traffic matrix for RSA on each reset (else uniform or custom) |
required |
max_slots
|
Scalar
|
Maximum number of slots |
required |
path_se_array
|
Array
|
Path spectral efficiency array |
required |
deterministic_requests
|
bool
|
If True, use deterministic requests |
required |
multiple_topologies
|
bool
|
If True, use multiple topologies |
required |
Source code in xlron/environments/dataclasses.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
RSAEnvState
Bases: EnvState
Dataclass to hold environment state for RSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Array
|
Link slot array |
required |
request_array
|
Array
|
Request array |
required |
link_slot_departure_array
|
Array
|
Link slot departure array |
required |
link_slot_mask
|
Array
|
Link slot mask |
required |
traffic_matrix
|
Array
|
Traffic matrix |
required |
Source code in xlron/environments/dataclasses.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
RSAGNModelEnvParams
Bases: GNModelEnvParams
Dataclass to hold environment params for RSA with GN model.
Source code in xlron/environments/dataclasses.py
290 291 292 293 294 |
|
RSAGNModelEnvState
Bases: GNModelEnvState
Dataclass to hold environment state for RSA with GN model.
Source code in xlron/environments/dataclasses.py
297 298 299 300 301 302 303 |
|
RSAMultibandEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
335 336 337 338 339 340 |
|
RSAMultibandEnvState
Bases: RSAEnvState
Dataclass to hold environment state for MultiBandRSA (RBSA).
Source code in xlron/environments/dataclasses.py
328 329 330 331 332 |
|
RWALightpathReuseEnvState
Bases: RSAEnvState
Dataclass to hold environment state for RWA with lightpath reuse.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_index_array
|
Array
|
Contains indices of lightpaths in use on slots |
required |
path_capacity_array
|
Array
|
Contains remaining capacity of each lightpath |
required |
link_capacity_array
|
Array
|
Contains remaining capacity of lightpath on each link-slot |
required |
Source code in xlron/environments/dataclasses.py
210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
VONEEnvParams
Bases: RSAEnvParams
Dataclass to hold environment parameters for VONE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_resources
|
Scalar
|
Number of node resources |
required |
max_edges
|
Scalar
|
Maximum number of edges |
required |
min_node_resources
|
Scalar
|
Minimum number of node resources |
required |
max_node_resources
|
Scalar
|
Maximum number of node resources |
required |
Source code in xlron/environments/dataclasses.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
|
VONEEnvState
Bases: RSAEnvState
Dataclass to hold environment state for VONE.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_capacity_array
|
Array
|
Node capacity array |
required |
node_resource_array
|
Array
|
Node resource array |
required |
node_departure_array
|
Array
|
Node departure array |
required |
action_counter
|
Array
|
Action counter |
required |
action_history
|
Array
|
Action history |
required |
node_mask_s
|
Array
|
Node mask for source node |
required |
node_mask_d
|
Array
|
Node mask for destination node |
required |
virtual_topology_patterns
|
Array
|
Virtual topology patterns |
required |
values_nodes
|
Array
|
Values for nodes |
required |
Source code in xlron/environments/dataclasses.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
|
aggregate_slots(full_mask, params)
Aggregate slot mask to reduce action space. Only used if the --aggregate_slots flag is set to > 1. Aggregated action is valid if there is one valid slot action within the aggregated action window.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
full_mask
|
Array
|
slot mask |
required |
params
|
EnvParams
|
environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
agg_mask |
Array
|
aggregated slot mask |
Source code in xlron/environments/env_funcs.py
1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 |
|
best_fit(state, params)
Best-Fit Spectrum Allocation. Returns the best fit slot for each path.
Source code in xlron/heuristics/heuristics.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
|
bf_ksp(state, params)
Get the first available slot from the first k-shortest paths Method: Go through action mask and find the first available slot on all paths
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Action |
Source code in xlron/heuristics/heuristics.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
calculate_path_capacity(path_length, min_request=100, scale_factor=1.0, alpha=0.0002, NF=4.5, B=10000000000000.0, R_s=100000000000.0, beta_2=-2.17e-26, gamma=0.0012, L_s=100000.0, lambda0=1.55e-06)
From Nevin JOCN paper 2022: https://discovery.ucl.ac.uk/id/eprint/10175456/1/RL_JOCN_accepted.pdf
Source code in xlron/environments/env_funcs.py
2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 |
|
calculate_path_stats(state, params, request)
For use in DeepRMSA agent observation space. Calculate: 1. Size of 1st suitable free spectrum block 2. Index of 1st suitable free spectrum block 3. Required slots on path 4. Avg. free block size 5. Free slots
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
request
|
Array
|
Request array in format [source_node, data-rate, destination_node] |
required |
Returns:
Name | Type | Description |
---|---|---|
stats |
Array
|
Array of calculated path statistics |
Source code in xlron/environments/env_funcs.py
2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 |
|
check_action_rmsa_gn_model(state, action, params)
Check if action is valid for RSA GN model Args: state (EnvState): Environment state params (EnvParams): Environment parameters action (chex.Array): Action array Returns: bool: True if action is invalid, False if action is valid
Source code in xlron/environments/env_funcs.py
2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 |
|
check_action_rsa(state)
Check if action is valid. Combines checks for: - no spectrum reuse
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
current state |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 |
|
check_action_rwalr(state, action, params)
Combines checks for: - no spectrum reuse - lightpath available and existing
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 |
|
check_all_nodes_assigned(node_departure_array, total_requested_nodes)
Count negative values on each node (row) in node departure array, sum them, must equal total requested_nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_departure_array
|
Array
|
Node departure array (N x R) where N is number of nodes and R is number of resources |
required |
total_requested_nodes
|
int
|
Total requested nodes (int) |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 |
|
check_lightpath_available_and_existing(state, params, action)
Check if lightpath is available and existing. Available means that the lightpath does not use slots occupied by a different lightpath. Existing means that the lightpath has already been established.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
lightpath_available_check |
Tuple[Array, Array, Array, Array]
|
True if lightpath is available |
Source code in xlron/environments/env_funcs.py
2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 |
|
check_min_two_nodes_assigned(node_departure_array)
Count negative values on each node (row) in node departure array, sum them, must be 2 or greater. This check is important if e.g. an action contains 2 nodes the same therefore only assigns 1 node. Return False if check passed, True if check failed
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_departure_array
|
Array
|
Node departure array (N x R) where N is number of nodes and R is number of resources |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 |
|
check_no_spectrum_reuse(link_slot_array)
slot-=1 when used, should be zero when unoccupied, so check if any < -1 in slot array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Link slot array (L x S) where L is number of links and S is number of slots |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 |
|
check_node_capacities(capacity_array)
Sum selected nodes array and check less than node resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
capacity_array
|
Array
|
Node capacity array (N x 1) where N is number of nodes |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 |
|
check_snr_sufficient(state, params)
Check if SNR is sufficient for all connections Args: state (EnvState): Environment state params (EnvParams): Environment parameters Returns: jnp.array: 1 if SNR is sufficient for connection else 0
Source code in xlron/environments/env_funcs.py
2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 |
|
check_topology(action_history, topology_pattern)
Check that each unique virtual node (as indicated by topology pattern) is assigned to a consistent physical node i.e. start and end node of ring is same physical node. Method: For each node index in topology pattern, mask action history with that index, then find max value in masked array. If max value is not the same for all values for that virtual node in action history, then return 1, else 0. Array should be all zeroes at the end, so do an any() check on that. e.g. virtual topology pattern = [2,1,3,1,4,1,2] 3 node ring action history = [0,34,4,0,3,1,0] meaning v node "2" goes p node 0, v node "3" goes p node 4, v node "4" goes p node 3 The numbers in-between relate to the slot action. If any value in the array is 1, a virtual node is assigned to multiple different physical nodes. Need to check from both perspectives: 1. For each virtual node, check that all physical nodes are the same 2. For each physical node, check that all virtual nodes are the same
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action_history
|
Action history |
required | |
topology_pattern
|
Topology pattern |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 |
|
check_unique_nodes(node_departure_array)
Count negative values on each node (row) in node departure array, must not exceed 1.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_departure_array
|
Array
|
Node departure array (N x R) where N is number of nodes and R is number of resources |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 |
|
check_vone_action(state, remaining_actions, total_requested_nodes)
Check if action is valid. Combines checks for: - sufficient node capacities - unique nodes assigned - minimum two nodes assigned - all requested nodes assigned - correct topology pattern - no spectrum reuse
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
current state |
required | |
remaining_actions
|
remaining actions |
required | |
total_requested_nodes
|
total requested nodes |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if check failed, False if check passed |
Source code in xlron/environments/env_funcs.py
1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 |
|
convert_node_probs_to_traffic_matrix(node_probs)
Convert list of node probabilities to symmetric traffic matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_probs
|
list
|
node probabilities |
required |
Returns:
Name | Type | Description |
---|---|---|
traffic_matrix |
Array
|
traffic matrix |
Source code in xlron/environments/env_funcs.py
1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 |
|
create_run_name(config)
Create name for run based on config flags
Source code in xlron/environments/env_funcs.py
2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 |
|
decrement_action_counter(state)
Decrement action counter in-place. Used in VONE environments.
Source code in xlron/environments/env_funcs.py
547 548 549 550 |
|
ff_ksp(state, params)
Get the first available slot from all paths Method: Go through action mask and find the first available slot on all paths
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Action |
Source code in xlron/heuristics/heuristics.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
finalise_action_rsa(state, params)
Turn departure times positive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
current state |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
updated state |
Source code in xlron/environments/env_funcs.py
1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 |
|
finalise_action_rwalr(state, params)
Turn departure times positive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
current state |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
updated state |
Source code in xlron/environments/env_funcs.py
1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 |
|
finalise_vone_action(state)
Turn departure times positive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
current state |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
updated state |
Source code in xlron/environments/env_funcs.py
1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 |
|
first_fit(state, params)
First-Fit Spectrum Allocation. Returns the first fit slot for each path.
Source code in xlron/heuristics/heuristics.py
466 467 468 469 470 471 472 473 |
|
format_vone_slot_request(state, action)
Format slot request for VONE action into format (source-node, slot, destination-node).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
current state |
required |
action
|
Array
|
action to format |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: formatted request |
Source code in xlron/environments/env_funcs.py
1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 |
|
generate_arrival_holding_times(key, params)
Generate arrival and holding times based on Poisson distributed events. To understand how sampling from e^-x can be transformed to sample from lambdae^-(x/lambda) see: https://en.wikipedia.org/wiki/Inverse_transform_sampling#Examples Basically, inverse transform sampling is used to sample from a distribution with CDF F(x). The CDF of the exponential distribution (lambdae^-{lambdax}) is F(x) = 1 - e^-{lambdax}. Therefore, the inverse CDF is x = -ln(1-u)/lambda, where u is sample from uniform distribution. Therefore, we need to divide jax.random.exponential() by lambda in order to scale the standard exponential CDF. Experimental histograms of this method compared to random.expovariate() in Python's random library show that the two methods are equivalent. Also see: https://numpy.org/doc/stable/reference/random/generated/numpy.random.exponential.html https://jax.readthedocs.io/en/latest/_autosummary/jax.random.exponential.html
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
PRNG key |
required | |
params
|
Environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
arrival_time |
Arrival time |
|
holding_time |
Holding time |
Source code in xlron/environments/env_funcs.py
809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 |
|
generate_vone_request(key, state, params)
Generate a new request for the VONE environment. The request has two rows. The first row shows the node and slot values. The first three elements of the second row show the number of unique nodes, the total number of steps, and the remaining steps. These first three elements comprise the action counter. The remaining elements of the second row show the virtual topology pattern, i.e. the connectivity of the virtual topology.
Source code in xlron/environments/env_funcs.py
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 |
|
get_action_mask(state, params)
N.B. The mask must already be present in the state!
Source code in xlron/heuristics/heuristics.py
401 402 403 404 405 406 407 |
|
get_best_modulation_format(state, path, initial_slot_index, launch_power, params)
Get best modulation format for lightpath. "Best" is the highest order that has SNR requirements below available. Try each modulation format, calculate SNR for each, then return the highest order possible. Args: state (EnvState): Environment state path (chex.Array): Path array initial_slot_index (int): Initial slot index params (EnvParams): Environment parameters Returns: jnp.array: Acceptable modulation format indices
Source code in xlron/environments/env_funcs.py
2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 |
|
get_best_modulation_format_simple(state, path, initial_slot_index, params)
Get modulation format for lightpath. Assume worst case (least Gaussian) modulation format when calculating SNR. Args: state (EnvState): Environment state path (chex.Array): Path array initial_slot_index (int): Initial slot index params (EnvParams): Environment parameters Returns: jnp.array: Acceptable modulation format indices
Source code in xlron/environments/env_funcs.py
2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 |
|
get_centre_frequency(initial_slot_index, num_slots, params)
Get centre frequency for new lightpath
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_slot_index
|
Array
|
Centre frequency of first slot |
required |
num_slots
|
float
|
Number of slots |
required |
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Centre frequency for new lightpath |
Source code in xlron/environments/env_funcs.py
2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 |
|
get_edge_disjoint_paths(graph)
Get edge disjoint paths between all nodes in graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
Graph
|
graph |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
edge disjoint paths (path is list of edges) |
Source code in xlron/environments/env_funcs.py
1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 |
|
get_launch_power(state, path_action, power_action, params)
Get launch power for new lightpath. N.B. launch power is specified in dBm but is converted to linear units when stored in channel_power_array. This func returns linear units (mW). Path action is used to determine the launch power in the case of tabular launch power type. Power action is used to determine the launch power in the case of RL launch power type. During masking, power action is set as state.launch_power_array[0], which is set by the RL agent. Args: state (EnvState): Environment state path_action (chex.Array): Action specifying path index (0 to k_paths-1) power_action (chex.Array): Action specifying launch power in dBm params (EnvParams): Environment parameters Returns: chex.Array: Launch power for new lightpath
Source code in xlron/environments/env_funcs.py
3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 |
|
get_lightpath_snr(state, params)
Get SNR for each link on path. N.B. that in most cases it is more efficient to calculate the SNR for every possible path, rather than a slot-by-slot basis. But in some cases slot-by-slot is better i.e. when kN(N-1)/2 > LS Args: state (RSAGNModelEnvState): Environment state params (RSAGNModelEnvParams): Environment parameters
Returns:
Type | Description |
---|---|
Array
|
chex.array: SNR for each link on path |
Source code in xlron/environments/env_funcs.py
2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 |
|
get_link_weights(state, params)
Get link weights based on occupancy for use in congestion-aware routing heuristics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
chex.Array: Link weights |
Source code in xlron/heuristics/heuristics.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
|
get_minimum_snr_of_channels_on_path(state, path, slot_index, req_slots, params)
Get the minimum value of the SNR on newly assigned channels. N.B. this requires the link_snr_array to have already been calculated and present in state.
Source code in xlron/environments/env_funcs.py
3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 |
|
get_num_spectral_features(n_nodes)
Heuristic for number of spectral features based on graph size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_nodes
|
int
|
Number of nodes in the graph |
required |
Returns:
Type | Description |
---|---|
int
|
Number of spectral features to use, clamped between 3 and 15. |
int
|
Follows log2(n_nodes) scaling as reasonable default. |
Source code in xlron/environments/env_funcs.py
35 36 37 38 39 40 41 42 43 44 45 46 |
|
get_path_from_path_index_array(path_index_array, path_link_array)
Get path from path index array. Args: path_index_array (chex.Array): Path index array path_link_array (chex.Array): Path link array
Returns:
Type | Description |
---|---|
Array
|
jnp.array: path index values replaced with binary path-link arrays |
Source code in xlron/environments/env_funcs.py
2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 |
|
get_path_index_array(params, nodes)
Indices of paths between source and destination from path array
Source code in xlron/environments/env_funcs.py
742 743 744 745 746 747 748 749 |
|
get_path_indices(s, d, k, N, directed=False)
Get path indices for a given source, destination and number of paths. If source > destination and the graph is directed (two fibres per link, one in each direction) then an offset is added to the index to get the path in the other direction (the offset is the total number source-dest pairs).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s
|
int
|
Source node index |
required |
d
|
int
|
Destination node index |
required |
k
|
int
|
Number of paths |
required |
N
|
int
|
Number of nodes |
required |
directed
|
bool
|
Whether graph is directed. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
Array
|
jnp.array: Start index on path-link array for candidate paths |
Source code in xlron/environments/env_funcs.py
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 |
|
get_path_slots(link_slot_array, params, nodes_sd, i, agg_func='max')
Get slots on each constitutent link of path from link_slot_array (L x S), then aggregate to get (S x 1) representation of slots on path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Array
|
link-slot array |
required |
params
|
EnvParams
|
environment parameters |
required |
nodes_sd
|
Array
|
source-destination nodes |
required |
i
|
int
|
path index |
required |
agg_func
|
str
|
aggregation function (max or sum). If max, result will be available slots on path. If sum, result will contain information on edge features. |
'max'
|
Returns:
Name | Type | Description |
---|---|---|
slots |
Array
|
slots on path |
Source code in xlron/environments/env_funcs.py
1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 |
|
get_paths(params, nodes)
Get k paths between source and destination
Source code in xlron/environments/env_funcs.py
752 753 754 755 756 |
|
get_paths_obs_gn_model(state, params)
Get observation space for launch power optimization (with numerical stability).
Source code in xlron/environments/env_funcs.py
3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 |
|
get_paths_se(params, nodes)
Get max. spectral efficiency of modulation format on k paths between source and destination
Source code in xlron/environments/env_funcs.py
759 760 761 762 763 764 |
|
get_required_snr_se_kurtosis_array(modulation_format_index_array, col_index, params)
Convert modulation format index to required SNR or spectral efficiency. Modulation format index array contains the index of the modulation format used by the channel. The modulation index references a row in the modulations array, which contains SNR and SE values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
modulation_format_index_array
|
Array
|
Modulation format index array |
required |
col_index
|
int
|
Column index for required SNR or spectral efficiency |
required |
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
Array
|
jnp.array: Required SNR for each channel (min. SNR for empty channel (mod. index 0)) |
Source code in xlron/environments/env_funcs.py
2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 |
|
get_snr_link_array(state, params)
Get SNR per link Args: state (EnvState): Environment state params (EnvParams): Environment parameters Returns: jnp.array: SNR per link
Source code in xlron/environments/env_funcs.py
2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 |
|
get_spectral_features(laplacian, num_features)
Compute spectral node features from symmetric normalized graph Laplacian.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adj
|
Adjacency matrix of the graph |
required | |
num_features
|
int
|
Number of eigenvector features to extract |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Array of shape (n_nodes, num_features) containing eigenvectors corresponding |
ndarray
|
to the smallest non-zero eigenvalues of the graph Laplacian. |
Notes
- Skips trivial eigenvectors (those with near-zero eigenvalues)
- Eigenvectors are ordered by ascending eigenvalue magnitude
- Runtime is O(n^3) - use only for small/medium graphs
- Eigenvector signs are arbitrary (may vary between runs)
Source code in xlron/environments/env_funcs.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
implement_action_rmsa_gn_model(state, action, params)
Implement action for RSA GN model. Update following arrays: - link_slot_array - link_slot_departure_array - link_snr_array - modulation_format_index_array - channel_power_array - active_path_array Args: state (EnvState): Environment state action (chex.Array): Action tuple (first is path action, second is launch_power) params (EnvParams): Environment parameters Returns: EnvState: Updated environment state
Source code in xlron/environments/env_funcs.py
2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 |
|
implement_action_rsa(state, action, params)
Implement action to assign slots on links.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
current state |
required |
action
|
Array
|
action to implement |
required |
params
|
EnvParams
|
environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
updated state |
Source code in xlron/environments/env_funcs.py
1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 |
|
implement_action_rsa_gn_model(state, action, params)
Implement action for RSA GN model. Update following arrays: - link_slot_array - link_slot_departure_array - link_snr_array - modulation_format_index_array - channel_power_array - active_path_array Args: state (EnvState): Environment state action (chex.Array): Action tuple (first is path action, second is launch_power) params (EnvParams): Environment parameters Returns: EnvState: Updated environment state
Source code in xlron/environments/env_funcs.py
2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 |
|
implement_action_rwalr(state, action, params)
For use in RWALightpathReuseEnv. Update link_slot_array and link_slot_departure_array to reflect new lightpath assignment. Update link_capacity_array with new capacity if lightpath is available. Undo link_capacity_update if over capacity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
action
|
Array
|
Action array |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 |
|
implement_node_action(state, s_node, d_node, s_request, d_request, n=2)
Update node capacity, node resource and node departure arrays
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
State
|
current state |
required |
s_node
|
int
|
source node |
required |
d_node
|
int
|
destination node |
required |
s_request
|
int
|
source node request |
required |
d_request
|
int
|
destination node request |
required |
n
|
int
|
number of nodes to implement. Defaults to 2. |
2
|
Returns:
Name | Type | Description |
---|---|---|
State |
EnvState
|
updated state |
Source code in xlron/environments/env_funcs.py
1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 |
|
implement_path_action(state, path, initial_slot_index, num_slots)
Update link-slot and link-slot departure arrays. Times are set to negative until turned positive by finalisation (after checks).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
State
|
current state |
required |
path
|
int
|
path to implement |
required |
initial_slot_index
|
int
|
initial slot index |
required |
num_slots
|
int
|
number of slots to implement |
required |
Source code in xlron/environments/env_funcs.py
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 |
|
implement_vone_action(state, action, total_actions, remaining_actions, params)
Implement action to assign nodes (1, 2, or 0 nodes assigned per action) and assign slots and links for lightpath.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
current state |
required |
action
|
Array
|
action to implement (node, node, path_slot_action) |
required |
total_actions
|
Scalar
|
total number of actions to implement for current request |
required |
remaining_actions
|
Scalar
|
remaining actions to implement |
required |
k
|
number of paths to consider |
required | |
N
|
number of nodes to assign |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
updated state |
Source code in xlron/environments/env_funcs.py
1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 |
|
init_action_counter()
Initialize action counter. First index is num unique nodes, second index is total steps, final is remaining steps until completion of request. Only used in VONE environments.
Source code in xlron/environments/env_funcs.py
539 540 541 542 543 544 |
|
init_action_history(params)
Initialize action history
Source code in xlron/environments/env_funcs.py
574 575 576 577 |
|
init_active_lightpaths_array(params)
Initialise active lightpath array. Stores path indices of all active paths on the network in a 1 x M array. M is MIN(max_requests, num_links * link_resources / min_slots). min_slots is the minimum number of slots required for a lightpath i.e. max(values_bw)/ slot_size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
Returns: jnp.array: Active path array (default value -1, empty path)
Source code in xlron/environments/env_funcs.py
2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 |
|
init_active_lightpaths_array_departure(params)
Initialise active lightpath array. Stores path indices of all active paths on the network in a 1 x M array. M is MIN(max_requests, num_links * link_resources / min_slots). min_slots is the minimum number of slots required for a lightpath i.e. max(values_bw)/ slot_size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
Returns: jnp.array: Active path array (default value -1, empty path)
Source code in xlron/environments/env_funcs.py
2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 |
|
init_active_path_array(params)
Initialise active path array. Stores details of full path utilised by lightpath on each frequency slot. Args: params (EnvParams): Environment parameters Returns: jnp.array: Active path array
Source code in xlron/environments/env_funcs.py
2569 2570 2571 2572 2573 2574 2575 2576 |
|
init_channel_centre_bw_array(params)
Initialise channel centre array. Args: params (EnvParams): Environment parameters Returns: jnp.array: Channel centre array
Source code in xlron/environments/env_funcs.py
2549 2550 2551 2552 2553 2554 2555 2556 |
|
init_channel_power_array(params)
Initialise channel power array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params
|
EnvParams
|
Environment parameters |
required |
Returns: jnp.array: Channel power array
Source code in xlron/environments/env_funcs.py
2538 2539 2540 2541 2542 2543 2544 2545 2546 |
|
init_graph_tuple(state, params, adj, exclude_source_dest=False)
Initialise graph tuple for use with Jraph GNNs. Args: state (EnvState): Environment state params (EnvParams): Environment parameters adj (jnp.array): Adjacency matrix of the graph Returns: jraph.GraphsTuple: Graph tuple
Source code in xlron/environments/env_funcs.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
init_link_capacity_array(params)
Initialise link capacity array. Represents available data rate for lightpath on each link. Default is high value (1e6) for unoccupied slots. Once lightpath established, capacity is determined by corresponding entry in path capacity array.
Source code in xlron/environments/env_funcs.py
2170 2171 2172 2173 2174 |
|
init_link_length_array(graph)
Initialise link length array. Args: graph (nx.Graph): NetworkX graph Returns:
Source code in xlron/environments/env_funcs.py
185 186 187 188 189 190 191 192 193 194 195 |
|
init_link_length_array_gn_model(graph, max_span_length, max_spans)
Initialise link length array for environements that use GN model of physical layer. We assume each link has spans of equal length.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
Graph
|
NetworkX graph |
required |
Returns: jnp.array: Link length array (L x max_spans)
Source code in xlron/environments/env_funcs.py
2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 |
|
init_link_slot_array(params)
Initialize empty (all zeroes) link-slot array. 0 means slot is free, -1 means occupied. Args: params (EnvParams): Environment parameters Returns: jnp.array: Link slot array (E x S) where E is number of edges and S is number of slots
Source code in xlron/environments/env_funcs.py
500 501 502 503 504 505 506 507 |
|
init_link_slot_mask(params, agg=1)
Initialize link mask
Source code in xlron/environments/env_funcs.py
527 528 529 530 |
|
init_link_snr_array(params)
Initialise signal-to-noise ratio (SNR) array. Args: params (EnvParams): Environment parameters Returns: jnp.array: SNR array
Source code in xlron/environments/env_funcs.py
2527 2528 2529 2530 2531 2532 2533 2534 2535 |
|
init_mod_format_mask(params)
Initialize link mask
Source code in xlron/environments/env_funcs.py
533 534 535 536 |
|
init_modulation_format_index_array(params)
Initialise modulation format index array. Args: params (EnvParams): Environment parameters Returns: jnp.array: Modulation format index array
Source code in xlron/environments/env_funcs.py
2559 2560 2561 2562 2563 2564 2565 2566 |
|
init_modulations_array(modulations_filepath=None)
Initialise array of maximum spectral efficiency for modulation format on path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
modulations_filepath
|
str
|
Path to CSV file containing modulation formats. Defaults to None. |
None
|
Returns: jnp.array: Array of maximum spectral efficiency for modulation format on path. First two columns are maximum path length and spectral efficiency.
Source code in xlron/environments/env_funcs.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
|
init_node_capacity_array(params)
Initialize node array with uniform resources. Args: params (EnvParams): Environment parameters Returns: jnp.array: Node capacity array (N x 1) where N is number of nodes
Source code in xlron/environments/env_funcs.py
490 491 492 493 494 495 496 497 |
|
init_node_mask(params)
Initialize node mask
Source code in xlron/environments/env_funcs.py
521 522 523 524 |
|
init_node_resource_array(params)
Array to track node resources occupied by virtual nodes
Source code in xlron/environments/env_funcs.py
568 569 570 571 |
|
init_path_capacity_array(link_length_array, path_link_array, min_request=1, scale_factor=1.0, alpha=0.0002, NF=4.5, B=10000000000000.0, R_s=100000000000.0, beta_2=-2.17e-26, gamma=0.0012, L_s=100000.0, lambda0=1.55e-06)
Calculated from Nevin paper: https://api.repository.cam.ac.uk/server/api/core/bitstreams/b80e7a9c-a86b-4b30-a6d6-05017c60b0c8/content
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_length_array
|
Array
|
Array of link lengths |
required |
path_link_array
|
Array
|
Array of links on paths |
required |
min_request
|
int
|
Minimum data rate request size. Defaults to 100 GBps. |
1
|
scale_factor
|
float
|
Scale factor for link capacity. Defaults to 1.0. |
1.0
|
alpha
|
float
|
Fibre attenuation coefficient. Defaults to 0.2e-3 /m |
0.0002
|
NF
|
float
|
Amplifier noise figure. Defaults to 4.5 dB. |
4.5
|
B
|
float
|
Total modulated bandwidth. Defaults to 10e12 Hz. |
10000000000000.0
|
R_s
|
float
|
Symbol rate. Defaults to 100e9 Baud. |
100000000000.0
|
beta_2
|
float
|
Dispersion parameter. Defaults to -21.7e-27 s^2/m. |
-2.17e-26
|
gamma
|
float
|
Nonlinear coefficient. Defaults to 1.2e-3 /W/m. |
0.0012
|
L_s
|
float
|
Span length. Defaults to 100e3 m. |
100000.0
|
lambda0
|
float
|
Wavelength. Defaults to 1550e-9 m. |
1.55e-06
|
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Array of link capacities in Gbps |
Source code in xlron/environments/env_funcs.py
2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 |
|
init_path_index_array(params)
Initialise path index array. Represents index of lightpath occupying each slot.
Source code in xlron/environments/env_funcs.py
2177 2178 2179 |
|
init_path_length_array(path_link_array, graph)
Initialise path length array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_link_array
|
Array
|
Path-link array |
required |
graph
|
Graph
|
NetworkX graph |
required |
Returns: chex.Array: Path length array
Source code in xlron/environments/env_funcs.py
331 332 333 334 335 336 337 338 339 340 341 342 |
|
init_path_link_array(graph, k, disjoint=False, weight='weight', directed=False, modulations_array=None, rwa_lr=False, scale_factor=1.0, path_snr=False)
Initialise path-link array. Each path is defined by a link utilisation array (one row in the path-link array). 1 indicates link corresponding to index is used, 0 indicates not used.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
Graph
|
NetworkX graph |
required |
k
|
int
|
Number of paths |
required |
disjoint
|
bool
|
Whether to use edge-disjoint paths. Defaults to False. |
False
|
weight
|
str
|
Sort paths by edge attribute. Defaults to "weight". |
'weight'
|
directed
|
bool
|
Whether graph is directed. Defaults to False. |
False
|
modulations_array
|
Array
|
Array of maximum spectral efficiency for modulation format on path. Defaults to None. |
None
|
rwa_lr
|
bool
|
Whether the environment is RWA with lightpath reuse (affects path ordering). |
False
|
path_snr
|
bool
|
If GN model is used, include extra row of zeroes for unutilised paths |
False
|
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Path-link array (N(N-1)*k x E) where N is number of nodes, E is number of edges, k is number of shortest paths |
Source code in xlron/environments/env_funcs.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
|
init_path_se_array(path_length_array, modulations_array)
Initialise array of maximum spectral efficiency for highest-order modulation format on path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_length_array
|
array
|
Array of path lengths |
required |
modulations_array
|
array
|
Array of maximum spectral efficiency for modulation format on path |
required |
Returns:
Type | Description |
---|---|
jnp.array: Array of maximum spectral efficiency for on path |
Source code in xlron/environments/env_funcs.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
|
init_rsa_request_array()
Initialize request array
Source code in xlron/environments/env_funcs.py
516 517 518 |
|
init_traffic_matrix(key, params)
Initialize traffic matrix. Allows for random traffic matrix or uniform traffic matrix. Source-dest traffic requests are sampled probabilistically from the resulting traffic matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
PRNGKey
|
PRNG key |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
jnp.array: Traffic matrix |
Source code in xlron/environments/env_funcs.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
|
init_virtual_topology_patterns(pattern_names)
Initialise virtual topology patterns. First 3 digits comprise the "action counter": first index is num unique nodes, second index is total steps, final is remaining steps until completion of request. Remaining digits define the topology pattern, with 1 to indicate links and other positive integers are node indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pattern_names
|
list
|
List of virtual topology pattern names |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Array of virtual topology patterns |
Source code in xlron/environments/env_funcs.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
|
init_vone_request_array(params)
Initialize request array either with uniform resources
Source code in xlron/environments/env_funcs.py
510 511 512 513 |
|
kca_ff(state, params)
Congestion-aware First Fit. Only suitable for RSA/RMSA. Method:
Source code in xlron/heuristics/heuristics.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
|
kmc_ff(state, params)
K-Minimum Cut. Only suitable for RSA/RMSA. Method: 1. Go through action mask and find the first available slot on all paths. 2. For each path, allocate the first available slot. 3. Sum number of new consecutive zero regions (cuts) created by assignment (on each link) 4. Choose path that creates the fewest cuts.
Source code in xlron/heuristics/heuristics.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|
kme_ff(state, params)
K-Minimum Entropy. Only suitable for RSA/RMSA. Method: 1. Go through action mask and find the first available slot on all paths. 2. For each path, allocate the first available slot. 3. Sum number of new consecutive zero regions (cuts) created by assignment (on each link) 4. Choose path that creates the fewest cuts.
Source code in xlron/heuristics/heuristics.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
|
kmf_ff(state, params)
K-Minimum Frag-size. Only suitable for RSA/RMSA. Method: 1. Go through action mask and find the first available slot on all paths. 2. For each path, allocate the first available slot. 3. Sum number of new consecutive zero regions (cuts) created by assignment (on each link) 4. Choose path that creates the fewest cuts.
Source code in xlron/heuristics/heuristics.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
|
ksp_bf(state, params)
Get the first available slot from all k-shortest paths Method: Go through action mask and find the first available slot, starting from shortest path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Action |
Source code in xlron/heuristics/heuristics.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
ksp_ff(state, params)
Get the first available slot from the shortest available path Method: Go through action mask and find the first available slot, starting from shortest path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Action |
Source code in xlron/heuristics/heuristics.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
ksp_ff_multiband(state, params)
Get the first available slot from all k-shortest paths in multiband scenario Method: Go through action mask and find the first available slot, starting from shortest path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
MultiBandRSAEnvState
|
Environment state specific to multiband operations |
required |
params
|
MultiBandRSAEnvParams
|
Environment parameters including multiband details |
required |
Returns: chex.Array: Action
Source code in xlron/heuristics/heuristics.py
30 31 32 33 34 35 36 37 38 39 40 |
|
ksp_lf(state, params)
Get the last available slot on the shortest available path Method: Go through action mask and find the last available slot, starting from shortest path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Action |
Source code in xlron/heuristics/heuristics.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
ksp_mu(state, params, unique_lightpaths, relative)
Get the most-used slot on the shortest available path. Method: Go through action mask and find the utilisation of available slots on each path. Find the shortest available path and choose the most utilised slot on that path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
unique_lightpaths
|
bool
|
Whether to consider unique lightpaths |
required |
relative
|
bool
|
Whether to return relative utilisation |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Action |
Source code in xlron/heuristics/heuristics.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
last_fit(state, params)
Last-Fit Spectrum Allocation. Returns the last fit slot for each path.
Source code in xlron/heuristics/heuristics.py
476 477 478 479 480 481 482 483 484 485 |
|
lf_ksp(state, params)
Get the last available slot from all paths Method: Go through action mask and find the last available slot on all paths
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Action |
Source code in xlron/heuristics/heuristics.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
make_graph(topology_name='conus', topology_directory=None)
Create graph from topology definition. Topologies must be defined in JSON format in the topologies directory and named as the topology name with .json extension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topology_name
|
str
|
topology name |
'conus'
|
topology_directory
|
str
|
topology directory |
None
|
Returns:
Name | Type | Description |
---|---|---|
graph |
graph |
Source code in xlron/environments/env_funcs.py
1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 |
|
mask_nodes(state, num_nodes)
Returns mask of valid actions for node selection. 1 for valid action, 0 for invalid action.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
num_nodes
|
Scalar
|
Number of nodes |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 |
|
mask_slots(state, params, request)
Returns binary mask of valid actions. 1 for valid action, 0 for invalid action.
- Check request for source and destination nodes
- For each path:
- Get current slots on path (with padding on end to avoid out of bounds)
- Get mask for required slots on path
- Multiply through current slots with required slots mask to check if slots available on path
- Remove padding from mask
- Return path mask
- Update total mask with path mask
- If aggregate_slots > 1, aggregate slot mask to reduce action space
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
request
|
Array
|
Request array in format [source_node, data-rate, destination_node] |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 |
|
mask_slots_rmsa_gn_model(state, params, request)
For use in RSAGNModelEnv. 1. For each path: 1.1 Get path slots 1.2 Get launch power
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
RSAGNModelEnvState
|
Environment state |
required |
params
|
RSAGNModelEnvParams
|
Environment parameters |
required |
request
|
Array
|
Request array in format [source_node, data-rate, destination_node] |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 |
|
mask_slots_rwalr(state, params, request)
For use in RWALightpathReuseEnv. Each lightpath has a maximum capacity defined in path_capacity_array. This is updated when a lightpath is assigned. If remaining path capacity is less than current request, corresponding link-slots are masked out. If link-slot is in use by another lightpath for a different source and destination node (even if not full) it is masked out. Step 1: - Mask out slots that are not valid based on path capacity (check link_capacity_array) Step 2: - Mask out slots that are not valid based on lightpath reuse (check path_index_array)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
request
|
Array
|
Request array in format [source_node, data-rate, destination_node] |
required |
Returns:
Name | Type | Description |
---|---|---|
state |
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 |
|
most_used(state, params, unique_lightpaths, relative)
Get the amount of utilised bandwidth on each lightpath. If RWA-LR environment, the utilisation of a slot is defined by either the count of unique active lightpahts on the slot (if unique_lightpaths is True) or the count of active lightpaths on the slot (if unique_lightpaths is False). If RSA-type environment, utilisation is the count of active lightpaths on that slot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
unique_lightpaths
|
bool
|
Whether to consider unique lightpaths |
required |
relative
|
bool
|
Whether to return relative utilisation |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Most used slots (array length = link_resources) |
Source code in xlron/heuristics/heuristics.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
|
mu_ksp(state, params, unique_lightpaths, relative)
Use the most-used available slot on any path. The most-used slot is that which has the most unique lightpaths (if unique_lightpaths=True) or active lightpaths. Method: Go through action mask and find the usage of available slots, choose available slot that is most utilised.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
params
|
EnvParams
|
Environment parameters |
required |
unique_lightpaths
|
bool
|
Whether to consider unique lightpaths |
required |
relative
|
bool
|
Whether to return relative utilisation |
required |
Returns:
Type | Description |
---|---|
Array
|
chex.Array: Action |
Source code in xlron/heuristics/heuristics.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
normalise_traffic_matrix(traffic_matrix)
Normalise traffic matrix to sum to 1
Source code in xlron/environments/env_funcs.py
580 581 582 583 |
|
pad_array(array, fill_value)
Pad a ragged multidimensional array to rectangular shape. Used for training on multiple topologies. Source: https://codereview.stackexchange.com/questions/222623/pad-a-ragged-multidimensional-array-to-rectangular-shape
Parameters:
Name | Type | Description | Default |
---|---|---|---|
array
|
array to pad |
required | |
fill_value
|
value to fill with |
required |
Returns:
Name | Type | Description |
---|---|---|
result |
padded array |
Source code in xlron/environments/env_funcs.py
2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 |
|
path_action_only(topology_pattern, action_counter, remaining_actions)
This is to check if node has already been assigned, therefore just need to assign slots (n=0)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topology_pattern
|
Array
|
Topology pattern |
required |
action_counter
|
Array
|
Action counter |
required |
remaining_actions
|
Scalar
|
Remaining actions |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if only path action, False if node action |
Source code in xlron/environments/env_funcs.py
1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 |
|
poisson(key, lam, shape=(), dtype=dtypes.float_)
Sample Exponential random values with given shape and float dtype.
The values are distributed according to the probability density function:
.. math:: f(x) = \lambda e^{-\lambda x}
on the domain :math:0 \le x < \infty
.
Args:
key: a PRNG key used as the random key.
lam: a positive float32 or float64 Tensor
indicating the rate parameter
shape: optional, a tuple of nonnegative integers representing the result
shape. Default ().
dtype: optional, a float dtype for the returned values (default float64 if
jax_enable_x64 is true, otherwise float32).
Returns: A random array with the specified shape and dtype.
Source code in xlron/environments/env_funcs.py
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 |
|
process_path_action(state, params, path_action)
Process path action to get path index and initial slot index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
State
|
current state |
required |
params
|
Params
|
environment parameters |
required |
path_action
|
int
|
path action |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
(Array, Array)
|
path index |
int |
(Array, Array)
|
initial slot index |
Source code in xlron/environments/env_funcs.py
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 |
|
read_rsa_request(request_array)
Read RSA request from request array. Return source-destination nodes and bandwidth request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request_array
|
Array
|
request array |
required |
Returns:
Type | Description |
---|---|
Tuple[Array, Array]
|
Tuple[chex.Array, chex.Array]: source-destination nodes and bandwidth request |
Source code in xlron/environments/env_funcs.py
1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 |
|
remove_expired_node_requests(state)
Check for values in node_departure_array that are less than the current time but greater than zero (negative time indicates the request is not yet finalised). If found, set to infinity in node_departure_array, set to zero in node_resource_array, and increase node_capacity_array by expired resources on each node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 |
|
remove_expired_services_rmsa_gn_model(state)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 |
|
remove_expired_services_rsa(state)
Check for values in link_slot_departure_array that are less than the current time but greater than zero (negative time indicates the request is not yet finalised). If found, set to zero in link_slot_array and link_slot_departure_array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 |
|
remove_expired_services_rsa_gn_model(state)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 |
|
remove_expired_services_rwalr(state)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 |
|
required_slots(bitrate, se, channel_width, guardband=1)
Calculate required slots for a given bitrate and spectral efficiency.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bit_rate
|
float
|
Bit rate in Gbps |
required |
se
|
float
|
Spectral efficiency in bps/Hz |
required |
channel_width
|
float
|
Channel width in GHz |
required |
guardband
|
int
|
Guard band. Defaults to 1. |
1
|
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
Required slots |
Source code in xlron/environments/env_funcs.py
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 |
|
set_c_l_band_gap(link_slot_array, params, val)
Set C+L band gap in link slot array Args: link_slot_array (chex.Array): Link slot array params (RSAGNModelEnvParams): Environment parameters val (int): Value to set Returns: chex.Array: Link slot array with C+L band gap
Source code in xlron/environments/env_funcs.py
2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 |
|
undo_action_rmsa_gn_model(state, params)
Undo action for RMSA GN model Args: state (EnvState): Environment state action (chex.Array): Action array params (EnvParams): Environment parameters Returns: EnvState: Updated environment state
Source code in xlron/environments/env_funcs.py
3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 |
|
undo_action_rsa(state, params)
If the request is unsuccessful i.e. checks fail, then remove the partial (unfinalised) resource allocation. Partial resource allocation is indicated by negative time in link slot departure array. Check for values in link_slot_departure_array that are less than zero. If found, increase link_slot_array by +1 and link_slot_departure_array by current_time + holding_time of current request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 |
|
undo_action_rsa_gn_model(state, params)
Undo action for RSA GN model Args: state (EnvState): Environment state action (chex.Array): Action array params (EnvParams): Environment parameters Returns: EnvState: Updated environment state
Source code in xlron/environments/env_funcs.py
3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 |
|
undo_action_rwalr(state, params)
If the request is unsuccessful i.e. checks fail, then remove the partial (unfinalised) resource allocation. Partial resource allocation is indicated by negative time in link slot departure array. Check for values in link_slot_departure_array that are less than zero. If found, increase link_slot_array by +1 and link_slot_departure_array by current_time + holding_time of current request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 |
|
undo_node_action(state)
If the request is unsuccessful i.e. checks fail, then remove the partial (unfinalised) resource allocation. Partial resource allocation is indicated by negative time in node departure array. Check for values in node_departure_array that are less than zero. If found, set to infinity in node_departure_array, set to zero in node_resource_array, and increase node_capacity_array by expired resources on each node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
EnvState
|
Environment state |
required |
Returns:
Type | Description |
---|---|
EnvState
|
Updated environment state |
Source code in xlron/environments/env_funcs.py
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 |
|
update_action_history(action_history, action_counter, action)
Update action history by adding action to first available index starting from the end.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action_history
|
Array
|
Action history |
required |
action_counter
|
Array
|
Action counter |
required |
action
|
Array
|
Action to add to history |
required |
Returns:
Type | Description |
---|---|
Array
|
Updated action_history |
Source code in xlron/environments/env_funcs.py
850 851 852 853 854 855 856 857 858 859 860 861 |
|
update_active_lightpaths_array(state, path_index)
Update active lightpaths array with new path index. Find the first index of the array with value -1 and replace with path index. Args: state (RSAGNModelEnvState): Environment state path_index (int): Path index to add to active lightpaths array Returns: jnp.array: Updated active lightpaths array
Source code in xlron/environments/env_funcs.py
2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 |
|
update_active_lightpaths_array_departure(state, time)
Update active lightpaths array with new path index. Find the first index of the array with value -1 and replace with path index. Args: state (RSAGNModelEnvState): Environment state time (float): Departure time Returns: jnp.array: Updated active lightpaths array
Source code in xlron/environments/env_funcs.py
2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 |
|
update_graph_tuple(state, params)
Update graph tuple for use with Jraph GNNs. Edge and node features are updated from link_slot_array and node_capacity_array respectively. Global features are updated as request_array. Args: state (EnvState): Environment state params (EnvParams): Environment parameters Returns: state (EnvState): Environment state with updated graph tuple
Source code in xlron/environments/env_funcs.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
|
update_node_array(node_indices, array, node, request)
Used to udated selected_nodes array with new requested resources on each node, for use in
Source code in xlron/environments/env_funcs.py
973 974 975 |
|
vmap_set_path_links(link_slot_array, path, initial_slot, num_slots, value)
Set relevant slots along links in path to val.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Array
|
Link slot array |
required |
path
|
Array
|
Path (row from path-link array that indicates links used by path) |
required |
initial_slot
|
int
|
Initial slot |
required |
num_slots
|
int
|
Number of slots |
required |
value
|
int
|
Value to set on link slot array |
required |
Returns:
Type | Description |
---|---|
Array
|
Updated link slot array |
Source code in xlron/environments/env_funcs.py
904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 |
|
vmap_update_node_departure(node_departure_array, selected_nodes, value)
Called when implementing node action. Sets request departure time ("value") in place of first "inf" i.e. unoccupied index on node departure array for selected nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_departure_array
|
Array
|
(N x R) Node departure array |
required |
selected_nodes
|
Array
|
(N x 1) Selected nodes (non-zero value on selected node indices) |
required |
value
|
int
|
Value to set on node departure array |
required |
Returns:
Type | Description |
---|---|
Array
|
Updated node departure array |
Source code in xlron/environments/env_funcs.py
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 |
|
vmap_update_node_resources(node_resource_array, selected_nodes)
Called when implementing node action. Sets requested node resources on selected nodes in place of first "zero" i.e. unoccupied index on node resource array for selected nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_resource_array
|
(N x R) Node resource array |
required | |
selected_nodes
|
(N x 1) Requested resources on selected nodes |
required |
Returns:
Type | Description |
---|---|
Updated node resource array |
Source code in xlron/environments/env_funcs.py
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 |
|
vmap_update_path_links(link_slot_array, path, initial_slot, num_slots, value)
Update relevant slots along links in path to current_val - val.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_slot_array
|
Array
|
Link slot array |
required |
path
|
Array
|
Path (row from path-link array that indicates links used by path) |
required |
initial_slot
|
int
|
Initial slot |
required |
num_slots
|
int
|
Number of slots |
required |
value
|
int
|
Value to subtract from link slot array |
required |
Returns:
Type | Description |
---|---|
Array
|
Updated link slot array |
Source code in xlron/environments/env_funcs.py
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 |
|