Class OptimizationUtils

java.lang.Object
org.apache.wayang.core.optimizer.OptimizationUtils

public class OptimizationUtils extends Object
Utility methods for the optimization process.
  • Constructor Details

    • OptimizationUtils

      public OptimizationUtils()
  • Method Details

    • findWayangPlanOutputSlotFor

      public static OutputSlot<?> findWayangPlanOutputSlotFor(Channel openChannel)
      Determine the producing OutputSlot of this Channel that lies within a WayangPlan. We follow non-WayangPlan ExecutionOperators because they should merely forward data.
    • getPredecessorChannel

      public static Channel getPredecessorChannel(Channel channel)
      Finds the single input Channel of the given channel's producing ExecutionTask.
      Parameters:
      channel - whose predecessor is requested
      Returns:
      the preceeding Channel
    • createPruningStrategy

      public static <T extends PlanEnumerationPruningStrategy> T createPruningStrategy(Class<T> strategyClass, Configuration configuration)
      Creates a new PlanEnumerationPruningStrategy and configures it.
      Parameters:
      strategyClass - the Class of the PlanEnumerationPruningStrategy; must have a default constructor
      configuration - provides any potential configuration values
      Returns:
      the configured PlanEnumerationPruningStrategy instance
    • collectConnectedSlots

      public static Set<Slot<?>> collectConnectedSlots(Slot<?> slot)
      Collects all Slots that are related to the given Slot either by a SlotMapping or by OutputSlot/InputSlot occupation.
      Parameters:
      slot - whose related Slots are requested
      Returns:
      the related Slots including the given Slot
    • collectConnectedSlots

      public static Set<Slot<?>> collectConnectedSlots(InputSlot<?> input)
      Collects all Slots that are related to the given InputSlot either by a SlotMapping or by OutputSlot/InputSlot occupation.
      Parameters:
      input - whose related Slots are requested
      Returns:
      the related Slots including the given InputSlot
    • collectConnectedSlots

      public static Set<Slot<?>> collectConnectedSlots(OutputSlot<?> output)
      Collects all Slots that are related to the given OutputSlot either by a SlotMapping or by OutputSlot/InputSlot occupation.
      Parameters:
      output - whose related Slots are requested
      Returns:
      the related Slots including the given OutputSlot
    • logisticGrowth

      public static double logisticGrowth(double g0, double epsilon, double x0, double x)
      Uses the right part of the logistic regression curve to model a strictly growing function between g0 and 1.
      Parameters:
      g0 - the starting value at x = 0
      epsilon - the function should have a value >= 1 - epsilon for x >= x0
      x0 - the convergence x value
      x - the actual input value to the function
      Returns:
      the function value