|
@@ -26,6 +26,7 @@ import classes.HolonElement.Priority;
|
|
|
import ui.controller.Control;
|
|
|
import ui.controller.FlexManager.FlexState;
|
|
|
import ui.controller.FlexManager.FlexWrapper;
|
|
|
+import ui.model.DecoratedGroupNode;
|
|
|
import ui.model.DecoratedHolonObject.HolonObjectState;
|
|
|
import ui.model.DecoratedState;
|
|
|
|
|
@@ -37,28 +38,37 @@ public class InformationPanel implements AddOn {
|
|
|
|
|
|
|
|
|
//Fields
|
|
|
- private int amountHolonObjects;
|
|
|
private int amountSwitch;
|
|
|
- private int amountConsumer;
|
|
|
- private int amountUnderSupplied;
|
|
|
- private int amountPatiallySupplied;
|
|
|
- private int amountFullySupplied;
|
|
|
- private int amountOversupllied;
|
|
|
+ private int amountHolonObjects;
|
|
|
+ private int amountConsumer;
|
|
|
+ private int amountUnderSupplied;
|
|
|
+ private int amountPatiallySupplied;
|
|
|
+ private int amountFullySupplied;
|
|
|
+ private int amountOversupllied;
|
|
|
private int amountSupplier;
|
|
|
|
|
|
private int amountHolonElements;
|
|
|
private int amountActiveHolonElements;
|
|
|
private int amountInactiveHolonElements;
|
|
|
private int amountFlexibilities;
|
|
|
+ private int amountActiveFlexibilities;
|
|
|
private int amountEssential;
|
|
|
+ private int amountActiveEssential;
|
|
|
private int amountHigh;
|
|
|
+ private int amountActiveHigh;
|
|
|
private int amountMedium;
|
|
|
+ private int amountActiveMedium;
|
|
|
private int amountLow;
|
|
|
+ private int amountActiveLow;
|
|
|
|
|
|
private int amountConsumingFlexibilities;
|
|
|
private int amountProducingFlexibilities;
|
|
|
private int amountPassiv;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ private int amountHolons;
|
|
|
+
|
|
|
List<Entry> entryList = new ArrayList<Entry>();
|
|
|
|
|
|
private int currentEntryVerticalPosition = 0;
|
|
@@ -66,6 +76,8 @@ public class InformationPanel implements AddOn {
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
public InformationPanel(){
|
|
@@ -91,7 +103,7 @@ public class InformationPanel implements AddOn {
|
|
|
JPanel middle = new JPanel();
|
|
|
middle.setLayout(new GridBagLayout());
|
|
|
|
|
|
- int size = 60;
|
|
|
+ int size = 75;
|
|
|
middle.setPreferredSize(new Dimension(16*size, 9*size));
|
|
|
|
|
|
|
|
@@ -120,8 +132,14 @@ public class InformationPanel implements AddOn {
|
|
|
entryList.add(new Entry(() -> Integer.toString(amountMedium) + addPercentage(amountMedium, amountFlexibilities), "\tamountMedium", middle));
|
|
|
entryList.add(new Entry(() -> Integer.toString(amountHigh) + addPercentage(amountHigh, amountFlexibilities), "\tamountHigh", middle));
|
|
|
entryList.add(new Entry(() -> Integer.toString(amountEssential) + addPercentage(amountEssential, amountFlexibilities), "\tamountEssential", middle));
|
|
|
-
|
|
|
-
|
|
|
+ addSeperator(middle);
|
|
|
+ entryList.add(new Entry(() -> Integer.toString(amountActiveFlexibilities), "amountActiveFlexibilities", middle));
|
|
|
+ entryList.add(new Entry(() -> Integer.toString(amountActiveLow) + addPercentage(amountActiveLow, amountActiveFlexibilities), "\tamountActiveLow", middle));
|
|
|
+ entryList.add(new Entry(() -> Integer.toString(amountActiveMedium) + addPercentage(amountActiveMedium, amountActiveFlexibilities), "\tamountActiveMedium", middle));
|
|
|
+ entryList.add(new Entry(() -> Integer.toString(amountActiveHigh) + addPercentage(amountActiveHigh, amountActiveFlexibilities), "\tamountActiveHigh", middle));
|
|
|
+ entryList.add(new Entry(() -> Integer.toString(amountActiveEssential) + addPercentage(amountActiveEssential, amountActiveFlexibilities), "\tamountActiveEssential", middle));
|
|
|
+ addSeperator(middle);
|
|
|
+ entryList.add(new Entry(() -> Integer.toString(amountHolons), "amountHolons", middle));
|
|
|
|
|
|
return middle;
|
|
|
}
|
|
@@ -197,6 +215,18 @@ public class InformationPanel implements AddOn {
|
|
|
amountMedium = (int)flexList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Medium).count();
|
|
|
amountLow = (int)flexList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Low).count();
|
|
|
this.amountFlexibilities = amountEssential + amountHigh + amountMedium + amountLow;
|
|
|
+
|
|
|
+
|
|
|
+ List<Flexibility> flexActiveList = control.getSimManager().getActualFlexManager().getAllFlexWrapperWithState(FlexState.IN_USE).stream().map(flex -> flex.getFlex()).collect(Collectors.toList());
|
|
|
+ amountActiveEssential = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Essential).count();
|
|
|
+ amountActiveHigh = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.High).count();
|
|
|
+ amountActiveMedium = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Medium).count();
|
|
|
+ amountActiveLow = (int)flexActiveList.stream().filter(flex -> flex.getElement().getPriority() == Priority.Low).count();
|
|
|
+ this.amountActiveFlexibilities = amountActiveEssential + amountActiveHigh + amountActiveMedium + amountActiveLow;
|
|
|
+
|
|
|
+ amountHolons = control.getSimManager().getActualVisualRepresentationalState().getAmountOfHolons();
|
|
|
+
|
|
|
+
|
|
|
int cost = 0;
|
|
|
int consumingFlex = 0;
|
|
|
float consumingFlexEnergy = 0.0f;
|
|
@@ -220,6 +250,8 @@ public class InformationPanel implements AddOn {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public JPanel getPanel() {
|
|
|
return content;
|