starling_sim.basemodel.topology.network_weight

Module Contents

Classes

NetworkWeight

This class is used for computing weight on the graph edges.

class starling_sim.basemodel.topology.network_weight.NetworkWeight(topology)

Bases: abc.ABC

This class is used for computing weight on the graph edges.

Paths on the graph are evaluated by minimising weight using a shortest path algorithm.

DEFAULT_PARAMETERS
get_parameters_hash
pre_process_edge(u, v, d)

Add attributes to the edges before compute weight.

Parameters:
  • u – edge origin

  • v – edge destination

  • d – edge data

abstract compute_edge_weight(u, v, d, parameters)

Compute and set edge weight using edge data and parameters.

The attribute key to set is the hash of the parameters.

Parameters:
  • u – edge origin

  • v – edge destination

  • d – edge data

  • parameters – agent specific parameters

static get_parameters_hash(parameters)

Get the hash of the given weight parameters.

Parameters:

parameters

Returns:

hash of the parameters, associated to the computed weight.