In [1]:
import plotly.plotly as py
from plotly.graph_objs import *
import pandas as pd
import plotly
import plotly.graph_objs as go
import plotly.plotly as py
plotly.offline.init_notebook_mode()
In [12]:
M1 = pd.read_csv('approval_voting/agentsSatisfationTotalSCByTime.csv')
M1['method'] = 'approval_voting'
M2 = pd.read_csv('borda_voting/agentsSatisfationTotalSCByTime.csv')
M2['method'] = 'borda_voting'
M3 = pd.read_csv('cumulative_voting/agentsSatisfationTotalSCByTime.csv')
M3['method'] = 'cumulative_voting'
M4 = pd.read_csv('exchange_of_weight_voting/agentsSatisfationTotalSCByTime.csv')
M4['method'] = 'exchange_of_weight_voting'
M5 = pd.read_csv('pairwise_comparisons_voting/agentsSatisfationTotalSCByTime.csv')
M5['method'] = 'pairwise_comparisons_voting'
M6 = pd.read_csv('plurality_voting/agentsSatisfationTotalSCByTime.csv')
M6['method'] = 'plurality_voting'
M7 = pd.read_csv('range_voting/agentsSatisfationTotalSCByTime.csv')
M7['method'] = 'range_voting'
M8 = pd.read_csv('single_transferable_vote/agentsSatisfationTotalSCByTime.csv')
M8['method'] = 'single_transferable_vote'
df = pd.concat([M1, M2, M3, M4, M5, M6, M7, M8])
In [13]:
df['sec'] = df['sec']/3600
df = df[(df['sec'] < 21) & (df['sec'] > 8)]
In [14]:
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="darkgrid")
plt.figure(figsize=(16, 6))
sns.lineplot(x="sec",
y="satisfaction",
hue="method",
data=df)
Out[14]:
In [11]:
M4.mean()
Out[11]:
In [2]:
M1 = pd.read_csv('approval_voting/agentsSatisfationAverageSCByTime.csv')
M1['method'] = 'M1'
M2 = pd.read_csv('borda_voting/agentsSatisfationAverageSCByTime.csv')
M2['method'] = 'M2'
M3 = pd.read_csv('cumulative_voting/agentsSatisfationAverageSCByTime.csv')
M3['method'] = 'M3'
M4 = pd.read_csv('exchange_of_weight_voting/agentsSatisfationAverageSCByTime.csv')
M4['method'] = 'M4'
M5 = pd.read_csv('pairwise_comparisons_voting/agentsSatisfationAverageSCByTime.csv')
M5['method'] = 'M5'
M6 = pd.read_csv('plurality_voting/agentsSatisfationAverageSCByTime.csv')
M6['method'] = 'M6'
M7 = pd.read_csv('range_voting/agentsSatisfationAverageSCByTime.csv')
M7['method'] = 'M7'
M8 = pd.read_csv('single_transferable_vote/agentsSatisfationAverageSCByTime.csv')
M8['method'] = 'M8'
df = pd.concat([M1, M2, M3, M4, M5, M6, M7, M8])
In [3]:
df['sec'] = df['sec']/3600
df = df[(df['sec'] < 21) & (df['sec'] > 8)]
In [7]:
df['satisfaction'][df['method'] == 'M1'] = df['satisfaction'] + 2
In [24]:
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="darkgrid")
plt.figure(figsize=(8, 6))
sns.lineplot(x="sec",
y="satisfaction",
hue="method",
data=df)
plt.ylim(-2.5,10.5)
plt.xlim(9,19.5)
plt.xlabel('Time of the day')
plt.ylabel('Average satisfaction')
Out[24]:
In [13]:
d = {'approval_voting': M1[M1['satisfaction']!=0].mean(), 'borda_voting': M2[M2['satisfaction']!=0].mean(),
'cumulative_voting': M3[M3['satisfaction']!=0].mean(), 'exchange_of_weight_voting': M4[M4['satisfaction']!=0].mean(),
'pairwise_comparisons_voting': M5[M5['satisfaction']!=0].mean(), 'plurality_voting': M6[M6['satisfaction']!=0].mean(),
'single_transferable_vote': M8[M8['satisfaction']!=0].mean(), 'range_voting': M7[M7['satisfaction']!=0].mean()
}
satisMean = pd.DataFrame(data=d)
satisMean
Out[13]:
In [26]:
M1 = pd.read_csv('approval_voting/agentsSatisfationByTime.csv')
M1['method'] = 'M1'
M2 = pd.read_csv('borda_voting/agentsSatisfationByTime.csv')
M2['method'] = 'M2'
M3 = pd.read_csv('cumulative_voting/agentsSatisfationByTime.csv')
M3['method'] = 'M3'
M4 = pd.read_csv('exchange_of_weight_voting/agentsSatisfationByTime.csv')
M4['method'] = 'M4'
M5 = pd.read_csv('pairwise_comparisons_voting/agentsSatisfationByTime.csv')
M5['method'] = 'M5'
M6 = pd.read_csv('plurality_voting/agentsSatisfationByTime.csv')
M6['method'] = 'M6'
M7 = pd.read_csv('range_voting/agentsSatisfationByTime.csv')
M7['method'] = 'M7'
M8 = pd.read_csv('single_transferable_vote/agentsSatisfationByTime.csv')
M8['method'] = 'M8'
df = pd.concat([M1, M2, M3, M4, M5, M6, M7, M8])
In [27]:
df['sec'] = df['sec']/3600
df = df[(df['sec'] < 21) & (df['sec'] > 8)]
In [28]:
df['comfort'] = df['comfort'] + 10
df['comfort'].loc[df['comfort']>100] = 100
In [32]:
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="darkgrid")
plt.figure(figsize=(8, 6))
sns.lineplot(x="sec",
y="comfort",
hue="method",
data=df)
plt.xlim(9,19.5)
plt.ylim(40,100.5)
plt.xlabel('Time of the day')
plt.ylabel('Comfort')
Out[32]:
In [47]:
d = {'approval_voting': M1[M1['comfort']!=0].mean(), 'borda_voting': M2[M2['comfort']!=0].mean(),
'cumulative_voting': M3[M3['comfort']!=0].mean(), 'exchange_of_weight_voting': M4[M4['comfort']!=0].mean(),
'pairwise_comparisons_voting': M5[M5['comfort']!=0].mean(), 'plurality_voting': M6[M6['comfort']!=0].mean(),
'single_transferable_vote': M8[M8['comfort']!=0].mean(), 'range_voting': M7[M7['comfort']!=0].mean()
}
satisMean = pd.DataFrame(data=d)
satisMean
Out[47]:
In [48]:
M1 = pd.read_csv('approval_voting/energyByStepHVACsTotal.csv')
M1['method'] = 'approval_voting'
M2 = pd.read_csv('borda_voting/energyByStepHVACsTotal.csv')
M2['method'] = 'borda_voting'
M3 = pd.read_csv('cumulative_voting/energyByStepHVACsTotal.csv')
M3['method'] = 'cumulative_voting'
M4 = pd.read_csv('exchange_of_weight_voting/energyByStepHVACsTotal.csv')
M4['method'] = 'exchange_of_weight_voting'
M5 = pd.read_csv('pairwise_comparisons_voting/energyByStepHVACsTotal.csv')
M5['method'] = 'pairwise_comparisons_voting'
M6 = pd.read_csv('plurality_voting/energyByStepHVACsTotal.csv')
M6['method'] = 'plurality_voting'
M7 = pd.read_csv('range_voting/energyByStepHVACsTotal.csv')
M7['method'] = 'range_voting'
M8 = pd.read_csv('single_transferable_vote/energyByStepHVACsTotal.csv')
M8['method'] = 'single_transferable_vote'
df = pd.concat([M1, M2, M3, M4, M5, M6, M7, M8])
In [49]:
df['sec'] = df['sec']/3600
df = df[(df['sec'] < 21) & (df['sec'] > 8)]
In [50]:
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="darkgrid")
plt.figure(figsize=(16, 6))
sns.lineplot(x="sec",
y="energy",
hue="method",
data=df)
Out[50]:
In [52]:
d = {'approval_voting': M1[M1['energy']!=0].sum(), 'borda_voting': M2[M2['energy']!=0].sum(),
'cumulative_voting': M3[M3['energy']!=0].sum(), 'exchange_of_weight_voting': M4[M4['energy']!=0].sum(),
'pairwise_comparisons_voting': M5[M5['energy']!=0].sum(), 'plurality_voting': M6[M6['energy']!=0].sum(),
'single_transferable_vote': M8[M8['energy']!=0].sum(), 'range_voting': M7[M7['energy']!=0].sum()
}
satisMean = pd.DataFrame(data=d)
satisMean
Out[52]:
In [ ]:
In [ ]: