grape.fault_diagnosis.FaultDiagnosis.optimizer¶
-
FaultDiagnosis.
optimizer
(perturbed_nodes, initial_condition, params, weights, parallel)[source]¶ Genetic algorithm to optimize switches conditions, using DEAP.
- Parameters
perturbed_nodes (list) – nodes(s) involved in the perturbing event.
initial_condition (dict) – initial status (boolean) for the graph switches.
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 populations.