cpu_opt.py 781 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. @Auther :liuyuqi.gov@msn.cn
  5. @Time :2018/7/9 7:54
  6. @File :cpu_opt.py
  7. '''
  8. import pandas as pd
  9. def getWij():
  10. global machine_resources
  11. # Wij矩阵表示第i个instance实例部署到j主机上
  12. Wij_size = np.zeros((68219, 6000))
  13. Wij = np.zeros_like(Wij_size)
  14. # inst_26195, app_147, machine_1149
  15. df3=pd.read_csv("../data/instance.csv", header=None,names=list(["instanceid", "appid", "machineid","disk"]))
  16. df2 = pd.read_csv(machine_resources, header=None, names=list(
  17. ["machineid", "cpu", "mem", "disk", "P", "M", "PM"]), encoding="utf-8")
  18. for i in range(0,68219):
  19. if df3[i]["machineid"]==None:
  20. pass
  21. else:
  22. # Wij[i][j]=
  23. pass