Partial fix for #5576. Stopped it from overflowing though at some point the EnergyNetwork should still be updated to having capacity be a double.

This commit is contained in:
pupnewfster committed 2019-07-28 11:07:22 -04:00
1 parent bebcee022c
commit ba414752a5
1 file changed
+3 -1
@@ -255,7 +255,9 @@ public abstract class DynamicNetwork<ACCEPTOR, NETWORK extends DynamicNetwork<AC
public synchronized void updateCapacity() {
updateMeanCapacity();
capacity = (int) meanCapacity * transmitters.size();
double newCapacity = meanCapacity * transmitters.size();
//TODO: Make EnergyNetwork use doubles for capacity rather than just integers
capacity = newCapacity > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) newCapacity;
}
/**