|
@@ -335,16 +335,16 @@ public class StatisticGraph extends JPanel {
|
|
switch (set.getProperty()) {
|
|
switch (set.getProperty()) {
|
|
case TrackedDataSet.CONSUMPTION:
|
|
case TrackedDataSet.CONSUMPTION:
|
|
for (HolonElement h : ((HolonObject) set.getCpsObject()).getElements()) {
|
|
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());
|
|
set.setValAt(val, model.getCurIteration());
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case TrackedDataSet.PRODUCTION:
|
|
case TrackedDataSet.PRODUCTION:
|
|
for (HolonElement h : ((HolonObject) set.getCpsObject()).getElements()) {
|
|
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());
|
|
set.setValAt(val, model.getCurIteration());
|
|
}
|
|
}
|