コード例 #1
0
ファイル: baseline1.py プロジェクト: pchuanvn/MUB
    energy[4][t] = dc.e[1]
    energy[5][t] = dc.e[2]   
    energy[6][t] = bk.ez    
    cost[0][t]=hvac.userComfCosti(0)
    cost[1][t]=hvac.userComfCosti(1)
    cost[2][t]=hvac.userComfCosti(2)
    cost[3][t]=dc.dcCosti(0)
    cost[4][t]=dc.dcCosti(1)
    cost[5][t]=dc.dcCosti(2)
    cost[6][t]=bk.bgCost()    
    totalcost[t]=hvac.userComfCost()+dc.dcCost()+bk.bgCost()
    
    
################################################
plt.plot(totalcost)
nmub.saveFile('baseline1.p',totalcost)

def plot_lines(datas, numb_of_line, markerstyle, labels, title ):
   for line in range(numb_of_line):
       plt.plot(datas[line], marker = markerstyle, markersize=4, label=labels[line])
   plt.legend(loc=1)
   plt.title(title)
   plt.show()


#labels = ['Office 1','Office 2','Office 3','DC 1','DC 2','DC 3','BK']
#plot_lines(energy,7,".",labels,"Energy")
#plot_lines(sigma,7,"+",labels,"Sigma")
#labels = ['Office 1','Office 2','Office 3','DC 1','DC 2','DC 3','BK']
#plot_lines(cost,7,"+",labels,"Cost")
#labels = ['Office 1','Office 2','Office 3']
コード例 #2
0
ファイル: DANE_totalcost.py プロジェクト: pchuanvn/MUB
    energy[5][t] = dc.e[2]   
    energy[6][t] = bk.ez    
    cost[0][t]=hvac.userComfCosti(0)
    cost[1][t]=hvac.userComfCosti(1)
    cost[2][t]=hvac.userComfCosti(2)
    cost[3][t]=dc.dcCosti(0)
    cost[4][t]=dc.dcCosti(1)
    cost[5][t]=dc.dcCosti(2)
    cost[6][t]=bk.bgCost()
    
    totalcost[t]=hvac.userComfCost()+dc.dcCost()+bk.bgCost()
    
    

################################################
nmub.saveFile('DANE.p',totalcost)
plt.plot(totalcost)

labels = ['Office 1','Office 2','Office 3','DC 1','DC 2','DC 3','BK']
def totalCost(data,opt):
    #
    fig=plt.figure(figsize=(6,3.5))  
    
    plt.plot(data, color='black',marker = '^', markersize=3, label='Total cost')
    #optimal value    
    plt.plot(np.ones(runTime)*opt,color='black',ls='--', markersize=4, label='Optimal')
    plt.xlim([0,runTime])
    plt.ylim([35,60])
    plt.legend(loc=1)
    plt.xlabel('Iterations')
    plt.ylabel('Total cost')