<jupyter_start><jupyter_text>Otimização por Múltiplos Enxames Aplicada ao Escalonamento Dinâmico de Projetos de Software<jupyter_code>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

from dspsp_analysis import (algorithm_dataset, instance_dataset, comparison_dataset, 
                            max_event, metrics_dataset, mean_hypervolume)

%matplotlib inline

data = metrics_dataset()
instance_ids = list(data.instance.unique())
algorithm_ids = list(data.algorithm.unique())

instance_datasets = {}
for inst in instance_ids:
    ds = instance_dataset(data, inst, zero_values=True)
    instance_datasets[inst] = {alg: algorithm_dataset(ds, alg, zero_values=True) for alg in algorithm_ids}

comparison_datasets = {}
for inst in instance_ids:
    comparison_datasets[inst] = {alg: comparison_dataset(instance_datasets[inst][alg]) for alg in algorithm_ids}

for inst in instance_ids:
    min_event = min([max_event(ds) for ds in comparison_datasets[inst].values()])
    for k in comparison_datasets[inst].keys():
        comparison_datasets[inst][k] = comparison_datasets[inst][k][:min_event+1]

mean_hypervolume(data)
mean_hypervolume(data).index
comparison_datasets["ST10_DT10_E5_SK4-5"]["NSGAII"].tail()
comparison_datasets["ST10_DT10_E5_SK4-5"]["NSGAIIDynamic"].tail()
comparison_datasets["ST10_DT10_E5_SK4-5"]["SMPSO"].tail()<jupyter_output><empty_output><jupyter_text>Geração dos gráficos comparativos<jupyter_code>plt.title("NSGA-II x NSGA-II Dinamico")
plt.xlabel("Eventos dinâmicos (pontos de reescalonamento)")
plt.ylabel("Hipervolume")
plt.plot(comparison_datasets["ST10_DT10_E5_SK4-5"]["NSGAII"].event, comparison_datasets["ST10_DT10_E5_SK4-5"]["NSGAII"].hypervolume, "-ro", markersize=3, lw=.5, label="NSGAII")
plt.plot(comparison_datasets["ST10_DT10_E5_SK4-5"]["NSGAIIDynamic"].event, comparison_datasets["ST10_DT10_E5_SK4-5"]["NSGAIIDynamic"].hypervolume, "-go", markersize=3, lw=.5, label="NSGAIIDyn")
plt.legend()
plt.show()
plt.title("SMPSO x SMPSO Dinamico")
plt.xlabel("Eventos dinâmicos (pontos de reescalonamento)")
plt.ylabel("Hipervolume")
plt.plot(datasets["smpso"].event, datasets["smpso"].hypervolume, "-ro", markersize=3, lw=.5, label="SMPSO")
plt.plot(datasets["smpso_dyn"].event, datasets["smpso_dyn"].hypervolume, "-go", markersize=3, lw=.5, label="SMPSODyn")
plt.legend()
plt.show()
plt.title("NSGA-II x SMPSO")
plt.xlabel("Eventos dinâmicos (pontos de reescalonamento)")
plt.ylabel("Hipervolume")
plt.plot(datasets["nsgaii"].event, datasets["nsgaii"].hypervolume, "-ro", markersize=3, lw=.5, label="NSGAII")
plt.plot(datasets["smpso"].event, datasets["smpso"].hypervolume, "-go", markersize=3, lw=.5, label="SMPSO")
plt.legend()
plt.show()
plt.title("NSGA-II Dinamico x SMPSO Dinamico")
plt.xlabel("Eventos dinâmicos (pontos de reescalonamento)")
plt.ylabel("Hipervolume")
plt.plot(datasets["nsgaii_dyn"].event, datasets["nsgaii_dyn"].hypervolume, "-ro", markersize=3, lw=.5, label="NSGAIIDyn")
plt.plot(datasets["smpso_dyn"].event, datasets["smpso_dyn"].hypervolume, "-go", markersize=3, lw=.5, label="SMPSODyn")
plt.legend()
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15561959654178675, 'fraction_numerical': 0.021133525456292025, 'mean_word_length': 8.002881844380404, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '145631', 'license': 'MIT', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1180, 'n_words': 189, 'path': 'dspsp-analysis/results_by_instance.ipynb', 'repo_name': 'lclpsoz/spsp-jmetal', 'size': '3123'}