alib.datamodel¶
-
class
alib.datamodel.Graph(name)¶ Representing a directed graph ( G = ( V , E) ).
Arbitrary attributes can be set for nodes and edges via **kwargs.
-
add_edge(tail, head, bidirected=False, **kwargs)¶
-
add_node(node, **kwargs)¶
-
check_connectivity()¶
-
get_edges()¶
-
get_in_edges(node)¶
-
get_in_neighbors(node)¶
-
get_name()¶
-
get_nodes()¶
-
get_number_of_edges()¶
-
get_number_of_nodes()¶
-
get_out_edges(node)¶
-
get_out_neighbors(node)¶
-
get_shortest_paths_cost(node, other)¶
-
get_shortest_paths_cost_dict()¶
-
initialize_shortest_paths_costs()¶
-
print_shortest_path(including_shortest_path_costs=True, data=False)¶
-
-
class
alib.datamodel.LinearRequest(name)¶ Represents a linear request, i.e. a service chain graph: virtual nodes are chained.
-
add_edge(tail, head, demand)¶
-
add_node(i, demand, ntype, allowed_nodes=None)¶
-
get_out_edge(i)¶
-
get_required_types()¶
-
-
exception
alib.datamodel.LinearRequestError¶
-
class
alib.datamodel.Objective¶ Enum representing the objective that shall be applied.
-
MAX_PROFIT= 1¶
-
MIN_COST= 0¶
-
-
class
alib.datamodel.Request(name)¶ Represents a request graph, i.e. a directed graph with demands for nodes and edges.
Note that each node is attributed with a resource type.
-
add_edge(tail, head, demand, allowed_edges=None)¶
-
add_node(i, demand, ntype, allowed_nodes=None)¶
-
get_allowed_edges(ij)¶
-
get_allowed_nodes(i)¶
-
get_edge_demand(ij)¶
-
get_node_demand(i)¶
-
get_nodes_by_type(nt)¶
-
get_required_types()¶
-
get_type(i)¶
-
set_allowed_edges(ij, allowed_edges)¶
-
set_allowed_nodes(i, allowed_nodes)¶
-
-
class
alib.datamodel.Scenario(name, substrate, requests, objective=0)¶ Represents the scenario of embedding a given number of requests onto a single substrate network.
-
get_requests()¶
-
get_substrate()¶
-
validate_types()¶ general check for every request if substrate supports every needed type
-
-
class
alib.datamodel.Substrate(name)¶ Represents a physical network.
The constructor must be passed a set of network function types. Each substrate node may host an arbitrary subset of these functions and can have arbitrary capacities for each of these.
-
add_edge(tail, head, capacity=1.0, cost=1.0, bidirected=True, **kwargs)¶
-
add_node(u, types, capacity, cost)¶
-
average_edge_capacity()¶
-
average_node_capacity(node_type)¶
-
get_average_node_distance()¶
-
get_edge_capacity(edge)¶
-
get_edge_cost(edge)¶
-
get_node_capacity(node)¶
-
get_node_cost(node)¶
-
get_node_type_capacity(node, ntype)¶
-
get_node_type_cost(node, ntype)¶
-
get_nodes_by_type(ntype)¶
-
get_path_capacity(path)¶
-
get_supported_node_types(node)¶
-
get_total_edge_resources()¶
-
get_total_node_resources(node_type)¶
-
get_types()¶
-
set_average_node_distance(dist)¶
-
-
exception
alib.datamodel.SubstrateError¶
-
class
alib.datamodel.SubstrateX(substrate)¶ Extends the substrate class with efficient lookup of substrate resources given a capacity requirement.
This is separated from the Substrate class so that the resource data is not included in pickle files.
-
get_valid_edges(demand)¶
-
get_valid_nodes(type, demand)¶
-
-
class
alib.datamodel.UndirectedGraph(name)¶ Simple representation of an unidrected graph (without any further attributes as weights, costs etc.)
-
add_edge(i, j)¶
-
add_node(node)¶
-
check_connectedness()¶
-
get_edge_representation()¶
-
get_incident_edges(node)¶
-
get_neighbors(node)¶
-
remove_edge(i, j)¶
-
remove_node(node)¶
-
-
class
alib.datamodel.UndirectedGraphStorage(parameter_name, random_instance=None)¶ -
add_graph(parameter, graph)¶
-
add_graph_as_edge_representation(parameter, edge_representation)¶
-
get_average_number_of_edges_for_parameter(parameter_value)¶
-
get_information()¶
-
get_random_graph(parameter, number_of_nodes, name='')¶
-
get_random_graph_as_edge_list_representation(parameter, number_of_nodes)¶
-
load_from_pickle(pickle_path)¶
-
-
alib.datamodel.get_nodes_of_edge_list_representation(undirected_graph_edge_representation)¶
-
alib.datamodel.get_number_of_nodes_edge_list_representation(undirected_graph_edge_representation)¶
-
alib.datamodel.get_undirected_graph_from_edge_representation(edge_list, name='')¶ returns an undirected graph given a list of edges
-
alib.datamodel.is_connected_undirected_edge_representation(edge_list)¶ Given a list of edges, returns whether the result undirected graph is connected