瀏覽代碼

#37 should work correctly now

Kevin Trometer 8 年之前
父節點
當前提交
de622451c7
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/ui/view/StatisticGraph.java

+ 4 - 4
src/ui/view/StatisticGraph.java

@@ -335,16 +335,16 @@ public class StatisticGraph extends JPanel {
 			switch (set.getProperty()) {
 			case TrackedDataSet.CONSUMPTION:
 				for (HolonElement h : ((HolonObject) set.getCpsObject()).getElements()) {
-					if (h.getEnergy() < 0 && h.getActive()) {
-						val += Math.abs(h.getEnergyAt()[model.getCurIteration()]) * h.getAmount();
+					if (h.getTotalEnergyAtTimeStep(model.getCurIteration()) < 0 && h.getActive()) {
+						val += Math.abs(h.getTotalEnergyAtTimeStep(model.getCurIteration()));
 					}
 					set.setValAt(val, model.getCurIteration());
 				}
 				break;
 			case TrackedDataSet.PRODUCTION:
 				for (HolonElement h : ((HolonObject) set.getCpsObject()).getElements()) {
-					if (h.getEnergy() > 0 && h.getActive()) {
-						val += Math.abs(h.getEnergyAt()[model.getCurIteration()]) * h.getAmount();
+					if (h.getTotalEnergyAtTimeStep(model.getCurIteration()) > 0 && h.getActive()) {
+						val += Math.abs(h.getTotalEnergyAtTimeStep(model.getCurIteration()));
 					}
 					set.setValAt(val, model.getCurIteration());
 				}