Class ReduceNumberOfUsedInverters


  • public class ReduceNumberOfUsedInverters
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Inverter> apply​(java.util.List<Inverter> allInverters, TargetDirection targetDirection, ThrowingFunction<java.util.List<Inverter>,​org.apache.commons.math3.optim.PointValuePair,​java.lang.Exception> validateFunction)
      Finds the Inverters that are minimally required to fulfill all Constraints.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReduceNumberOfUsedInverters

        public ReduceNumberOfUsedInverters()
    • Method Detail

      • apply

        public java.util.List<Inverter> apply​(java.util.List<Inverter> allInverters,
                                              TargetDirection targetDirection,
                                              ThrowingFunction<java.util.List<Inverter>,​org.apache.commons.math3.optim.PointValuePair,​java.lang.Exception> validateFunction)
        Finds the Inverters that are minimally required to fulfill all Constraints.

        This method removes inverters till it finds a minimum setup. It uses an algorithm similarly to binary tree search to find the minimum required number of inverters.

        Parameters:
        allInverters - a list of all inverters
        targetDirection - the target direction
        validateFunction - a function that can tell if a setup is solvable with a given list of disabled Inverters.
        Returns:
        a list of target inverters