|
@@ -2,9 +2,6 @@ package ui.controller;
|
|
|
|
|
|
import algo.StorageElement;
|
|
|
import classes.*;
|
|
|
-import classes.comparator.EnergyMinToMaxComparator;
|
|
|
-import classes.comparator.MinEnergyComparator;
|
|
|
-import classes.comparator.WeakestBattery;
|
|
|
import ui.model.IntermediateCableWithState;
|
|
|
import ui.model.DecoratedCable;
|
|
|
import ui.model.DecoratedCable.CableState;
|
|
@@ -18,19 +15,13 @@ import ui.model.Model;
|
|
|
import ui.model.Model.FairnessModel;
|
|
|
import ui.model.VisualRepresentationalState;
|
|
|
import ui.view.FlexiblePane;
|
|
|
-import ui.view.GUI;
|
|
|
-import ui.view.MyCanvas;
|
|
|
-import ui.view.Outliner;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Collections;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.LinkedList;
|
|
|
import java.util.List;
|
|
|
import java.util.ListIterator;
|
|
|
|
|
|
-import javax.swing.JPanel;
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* Controller for Simulation.
|
|
@@ -131,7 +122,7 @@ public class SimulationManager {
|
|
|
.filter(ele -> ele != null)
|
|
|
.filter(ele -> (ele.getStatus().equals(StorageElement.Mode.EMIT)
|
|
|
|| (ele.getStatus().equals(StorageElement.Mode.COLLECT))))
|
|
|
- .forEach(obj -> obj.chargeCalc());
|
|
|
+ .forEach(obj -> obj.stateOfChargeCalculation());
|
|
|
|
|
|
//find the cable with the energy supplied from his two connected objects are the biggest, from all cables that the network give more energy than the cablecapacity.
|
|
|
IntermediateCableWithState cable = net.getEdgeList().stream().filter(aCable -> energyOnCables > aCable.getModel().getCapacity() && !aCable.getModel().isUnlimitedCapacity()).max((lhs,rhs) -> Float.compare(lhs.getEnergyFromConnetedAtTimestep(timestep, newFlexManager), rhs.getEnergyFromConnetedAtTimestep(timestep, newFlexManager))).orElse(null);
|