get_random#

eclypse.builders.infrastructure.generators.random.get_random(n, infrastructure_id='random', p=0.5, symmetric=False, update_policies=None, node_assets=None, link_assets=None, include_default_assets=False, strict=False, resource_init='min', path_algorithm=None, seed=None)[source]#

Create a random infrastructure with n nodes and a connection probability p.

The nodes are partitioned into groups according to the provided distribution.

Parameters:
  • n (int) – The number of nodes in the infrastructure.

  • infrastructure_id (str) – The ID of the infrastructure.

  • p (float) – The probability of connecting two nodes. Defaults to 0.5.

  • symmetric (bool) – Whether the links are symmetric. Defaults to False.

  • update_policies (Callable | list[Callable] | None) – Graph update policies. Defaults to None.

  • node_assets (dict[str, Asset] | None) – The assets for the nodes. Defaults to None.

  • link_assets (dict[str, Asset] | None) – The assets for the links. Defaults to None.

  • include_default_assets (bool) – Whether to include the default assets. Defaults to False.

  • strict (bool) – If True, raises an error if the asset values are not consistent with their spaces. Defaults to False.

  • resource_init (InitPolicy) – The initialization policy for the resources. Defaults to “min”.

  • path_algorithm (Callable[[nx.Graph, str, str], list[str]] | None) – The algorithm to compute the paths between nodes. Defaults to None.

  • seed (int | None) – The seed for the random number generator. Defaults to None.

Returns:

The random infrastructure.

Return type:

Infrastructure