|
@@ -114,6 +114,10 @@ public class StatisticGraph extends JPanel {
|
|
|
case TrackedDataSet.AVG_CONSUMED_ENERGY_IN_HOLONS:
|
|
|
case TrackedDataSet.AVG_WASTED_ENERGY_IN_HOLONS:
|
|
|
case TrackedDataSet.AMOUNT_BROKEN_EDGES:
|
|
|
+ case TrackedDataSet.AVG_AMOUNT_CLOSED_SWITCHES_IN_HOLONS:
|
|
|
+ case TrackedDataSet.AVG_AMOUNT_ACTIVE_ELEMENTS_IN_HOLONS:
|
|
|
+ case TrackedDataSet.AVG_AMOUNT_INACTIVE_ELEMENTS_IN_HOLONS:
|
|
|
+ case TrackedDataSet.AVG_PRODUCED_ENERGY_IN_HOLONS:
|
|
|
createPathFloats(set);
|
|
|
break;
|
|
|
case TrackedDataSet.ON_OFF:
|
|
@@ -251,6 +255,8 @@ public class StatisticGraph extends JPanel {
|
|
|
}
|
|
|
break;
|
|
|
case TrackedDataSet.AVG_AMOUNT_ELEMENTS_IN_HOLONS:
|
|
|
+ case TrackedDataSet.AVG_AMOUNT_ACTIVE_ELEMENTS_IN_HOLONS:
|
|
|
+ case TrackedDataSet.AVG_AMOUNT_INACTIVE_ELEMENTS_IN_HOLONS:
|
|
|
float eCount = 0;
|
|
|
for (SubNet sub : controller.getSimManager().getSubNets()) {
|
|
|
for (HolonObject obj : sub.getObjects()) {
|
|
@@ -293,6 +299,22 @@ public class StatisticGraph extends JPanel {
|
|
|
case TrackedDataSet.RATIO_PRODUCERS_CONSUMERS:
|
|
|
val = 1;
|
|
|
break;
|
|
|
+ case TrackedDataSet.AVG_AMOUNT_CLOSED_SWITCHES_IN_HOLONS:
|
|
|
+ for (SubNet sub : controller.getSimManager().getSubNets()) {
|
|
|
+ float tempVal = sub.getSwitches().size();
|
|
|
+ if (val < tempVal) {
|
|
|
+ val = tempVal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case TrackedDataSet.AVG_PRODUCED_ENERGY_IN_HOLONS:
|
|
|
+ for (SubNet sub : controller.getSimManager().getSubNets()) {
|
|
|
+ float tempVal = getMaxTotalProduction(new ArrayList<AbstractCpsObject>(sub.getObjects()));
|
|
|
+ if (val < tempVal) {
|
|
|
+ val = tempVal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
default:
|
|
|
maximum = 0;
|
|
|
break;
|
|
@@ -454,12 +476,53 @@ public class StatisticGraph extends JPanel {
|
|
|
for (HolonObject obj : sub.getObjects()) {
|
|
|
if (obj.getCurrentEnergyAtTimeStep(model.getCurIteration()) > 0) {
|
|
|
prod++;
|
|
|
- } else if(obj.getCurrentEnergyAtTimeStep(model.getCurIteration()) < 0) {
|
|
|
+ } else if (obj.getCurrentEnergyAtTimeStep(model.getCurIteration()) < 0) {
|
|
|
cons++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- val = prod/(prod+cons);
|
|
|
+ val = prod / (prod + cons);
|
|
|
+ set.setValAt(val, model.getCurIteration());
|
|
|
+ break;
|
|
|
+ case TrackedDataSet.AVG_AMOUNT_CLOSED_SWITCHES_IN_HOLONS:
|
|
|
+ for (SubNet sub : controller.getSimManager().getSubNets()) {
|
|
|
+ val += sub.getSwitches().size();
|
|
|
+ }
|
|
|
+ val /=controller.getSimManager().getSubNets().size();
|
|
|
+ set.setValAt(val, model.getCurIteration());
|
|
|
+ break;
|
|
|
+ case TrackedDataSet.AVG_AMOUNT_ACTIVE_ELEMENTS_IN_HOLONS:
|
|
|
+ for (SubNet sub : controller.getSimManager().getSubNets()) {
|
|
|
+ for (HolonObject obj : sub.getObjects()) {
|
|
|
+ for (HolonElement ele: obj.getElements()) {
|
|
|
+ if (ele.getActive()) {
|
|
|
+ val++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ val /= controller.getSimManager().getSubNets().size();
|
|
|
+ set.setValAt(val, model.getCurIteration());
|
|
|
+ break;
|
|
|
+ case TrackedDataSet.AVG_AMOUNT_INACTIVE_ELEMENTS_IN_HOLONS:
|
|
|
+ for (SubNet sub : controller.getSimManager().getSubNets()) {
|
|
|
+ for (HolonObject obj : sub.getObjects()) {
|
|
|
+ for (HolonElement ele: obj.getElements()) {
|
|
|
+ if (!ele.getActive()) {
|
|
|
+ val++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ val /= controller.getSimManager().getSubNets().size();
|
|
|
+ set.setValAt(val, model.getCurIteration());
|
|
|
+ break;
|
|
|
+ case TrackedDataSet.AVG_PRODUCED_ENERGY_IN_HOLONS:
|
|
|
+ for (SubNet sub : controller.getSimManager().getSubNets()) {
|
|
|
+ val += getTotalProductionAt(new ArrayList<AbstractCpsObject>(sub.getObjects()),
|
|
|
+ model.getCurIteration());
|
|
|
+ }
|
|
|
+ val /= controller.getSimManager().getSubNets().size();
|
|
|
set.setValAt(val, model.getCurIteration());
|
|
|
break;
|
|
|
default:
|