@Test public void testMinimumValue() { assertEquals(0.0, g1.minimumValue(network), 0.0); assertEquals(0, g2.minimumValue(network, GENERATOR), 0.0); assertEquals(-100, g2.minimumValue(network, LOAD), 0.0); assertEquals(0, g4.minimumValue(network, GENERATOR), 0); assertEquals(-80, g4.minimumValue(network, LOAD), 0); assertEquals(20, g5.minimumValue(network, GENERATOR), 0); assertEquals(-100, g5.minimumValue(network, LOAD), 0); }
@Override public double minimumValue(Network n, ScalingConvention scalingConvention) { Objects.requireNonNull(n); Objects.requireNonNull(scalingConvention); Generator g = n.getGenerator(id); if (g != null) { return scalingConvention == GENERATOR ? Math.max(g.getMinP(), minValue) : -Math.min(g.getMaxP(), maxValue); } else { return 0; } }
GeneratorScalable extends AbstractInjectionScalable { @Override public double minimumValue(Network n, ScalingConvention scalingConvention) { Objects.requireNonNull(n); Objects.requireNonNull(scalingConvention); Generator g = n.getGenerator(id); if (g != null) { return scalingConvention == GENERATOR ? Math.max(g.getMinP(), minValue) : -Math.min(g.getMaxP(), maxValue); } else { return 0; } } }
GeneratorScalable extends AbstractInjectionScalable { @Override public double minimumValue(Network n, ScalingConvention scalingConvention) { Objects.requireNonNull(n); Objects.requireNonNull(scalingConvention); Generator g = n.getGenerator(id); if (g != null) { return scalingConvention == GENERATOR ? Math.max(g.getMinP(), minValue) : -Math.min(g.getMaxP(), maxValue); } else { return 0; } } GeneratorScalable(String id);   GeneratorScalable(String id, double minValue, double maxValue); }
GeneratorScalable extends AbstractInjectionScalable { @Override public double minimumValue(Network n, ScalingConvention scalingConvention) { Objects.requireNonNull(n); Objects.requireNonNull(scalingConvention); Generator g = n.getGenerator(id); if (g != null) { return scalingConvention == GENERATOR ? Math.max(g.getMinP(), minValue) : -Math.min(g.getMaxP(), maxValue); } else { return 0; } } GeneratorScalable(String id);   GeneratorScalable(String id, double minValue, double maxValue); @Override void reset(Network n); @Override double maximumValue(Network n, ScalingConvention scalingConvention); @Override double minimumValue(Network n, ScalingConvention scalingConvention); @Override void filterInjections(Network n, List<Injection> injections, List<String> notFoundInjections); @Override double scale(Network n, double asked, ScalingConvention scalingConvention); }
GeneratorScalable extends AbstractInjectionScalable { @Override public double minimumValue(Network n, ScalingConvention scalingConvention) { Objects.requireNonNull(n); Objects.requireNonNull(scalingConvention); Generator g = n.getGenerator(id); if (g != null) { return scalingConvention == GENERATOR ? Math.max(g.getMinP(), minValue) : -Math.min(g.getMaxP(), maxValue); } else { return 0; } } GeneratorScalable(String id);   GeneratorScalable(String id, double minValue, double maxValue); @Override void reset(Network n); @Override double maximumValue(Network n, ScalingConvention scalingConvention); @Override double minimumValue(Network n, ScalingConvention scalingConvention); @Override void filterInjections(Network n, List<Injection> injections, List<String> notFoundInjections); @Override double scale(Network n, double asked, ScalingConvention scalingConvention);  }