grape.fault_diagnosis.FaultDiagnosis.apply_perturbation

FaultDiagnosis.apply_perturbation(perturbed_nodes, params, weights, parallel, verbose, kind='element')[source]

Perturbation simulator, actually applying the perturbation to all the nodes. The optimizer is run if any switch is present, and edges connecting its predecessors are removed if the switch state is set to ‘False’.

Parameters
  • perturbed_nodes (list) – nodes(s) involved in the perturbing event.

  • params (dict) – values for the optimizer evolutionary algorithm. Dict of: {str: int, str: int, str: float, str: float, str: int}: - ‘npop’: number of individuals for each population (default to 300) - ‘ngen’: total number of generations (default to 100) - ‘indpb’: independent probability for attributes to be changed (default to 0.6) - ‘tresh’: threshold for applying crossover/mutation (default to 0.5) - ‘nsel’: number of individuals to select (default to 5)

  • weights (dict) –

    weights for fitness evaluation on individuals. Dict of: {str: float, str: float, str: float}: - ‘w1’: weight multiplying number of switch flips (default to 1.0) - ‘w2’: weight multiplying total final service (default to -1.0) - ‘w3’: weight multiplying final graph size (default to -1.0) - ‘w4’: weight multiplying number of users with non-zero service

    (default to -1.0)

    • ’w5’: weight for service balance over users (default to 2.0)

  • parallel (bool) – flag for parallel fitness evaluation of initial population.

  • verbose (bool) – flag for verbose printing.

  • kind (str) – type of simulation, used to label output files, default to ‘element’.

Note

A perturbation, depending on the considered system, may spread in all directions starting from the damaged component(s) and may be affect nearby elements.