get_hierarchical#

eclypse.builders.infrastructure.generators.hierarchical.get_hierarchical(n, infrastructure_id='hierarchical', symmetric=False, node_partitioning=None, connectivity=None, cross_level_connectivity=None, update_policies=None, node_assets=None, link_assets=None, include_default_assets=False, strict=False, resource_init='max', path_algorithm=None, seed=None)[source]#

Create a hierarchical infrastructure made of n nodes.

It uses the given partitioning of the nodes into len(node_partitioning) layers. Nodes of the same level are connected with a given probability function or list of probabilities connectivity, and another function/list of probabilities cross_level_connectivity is used to connect nodes in the same level.

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

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

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

  • node_partitioning (list[float] | None]) – The partitioning of the nodes into groups, specified as a list of probabilities. The sum of the probabilities must be 1. Defaults to None.

  • connectivity (ConnectivityFn | list[float] | None) – The connectivity function or list of probabilities for the connections between levels. Defaults to None.

  • cross_level_connectivity (ConnectivityFn | list[float] | None) – The connectivity function or list of probabilities for the connections between nodes in the same level. Defaults to None.

  • 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 hierarchical infrastructure.

Return type:

Infrastructure