Commit 3c0438ef authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Forecaster component:

- Extended tests/Tools to allow setting client endpoints in test descriptors
- Minor code cleanup
parent 35248a79
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ def read_csv(csv_file : str) -> pandas.DataFrame:

    return df

def compose_descriptors(df : pandas.DataFrame) -> Dict:
def compose_descriptors(df : pandas.DataFrame, num_client_endpoints : int = 0) -> Dict:
    devices = dict()
    links = dict()

@@ -72,11 +72,17 @@ def compose_descriptors(df : pandas.DataFrame) -> Dict:
        dst_port_uuid = row.source

        if src_device_uuid not in devices:
            devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': set()}
            endpoints = set()
            for num_client_endpoint in range(num_client_endpoints):
                endpoints.add('client:{:d}'.format(num_client_endpoint))
            devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': endpoints}
        devices[src_device_uuid]['endpoints'].add(src_port_uuid)

        if dst_device_uuid not in devices:
            devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': set()}
            endpoints = set()
            for num_client_endpoint in range(num_client_endpoints):
                endpoints.add('client:{:d}'.format(num_client_endpoint))
            devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': endpoints}
        devices[dst_device_uuid]['endpoints'].add(dst_port_uuid)

        if link_uuid not in links: