A basic exmple with a set of function that generate a trace complexity map for two traces. Based on the paper: On the complexity of traffic traces and implications.
This version of the code was used in Harnessing Generative Pre-Trained Transformer for Datacenter Packet Trace Generation However, the method accurately reflects the original paper.
This comes with two HPC example papers.
hpc_cesar_mocfe.npy
hpc_exact_boxlib_cns_nospec_large.npy
More information on the traces can be found in the complexity paper.
Install dependencies. With all trace files in the root directory, run main. This will produce a complexity map for the two provided traces
New traces must follow the format and datatype of the given examples. Each trace is:
- A two column ndarray of integers.
- Integers represent node IDs in a network.
- It is assumed that IDs are consecutive.
- There are n IDs
- The max ID is n-1
- The integers range is [0,n-1].
Inside the code, the following function will calculate complexity for the a trace 'trace'
from complex_func import *
trace_c_dic = get_trace_complexity(trace, number_of_unique_IDs=n ,comp_types='Main')Produces a dict with results for temporal and non-temporal complexity types. It's fields are e.g.,:
{'temporal': 1,
'non_temporal': 1,
'total': 1,
'entropy':1,
'pair_entropy': 1}Further documentations is inline with the code.
After running main the resulting figure should be the following:
