Class GapFunction

    • Field Detail

      • stopCriterion

        protected final StopCriterion stopCriterion
        The stopCriterion to use
      • LINK_BASED_RELATIVE_GAP

        public static final String LINK_BASED_RELATIVE_GAP
        short code for link based relative duality gap function type
      • NORM_BASED_GAP

        public static final String NORM_BASED_GAP
        short code for a norm based gap function type
    • Constructor Detail

      • GapFunction

        public GapFunction​(IdGroupingToken idToken,
                           StopCriterion stopCriterion)
        Constructor
        Parameters:
        idToken - to use for the generation of its id
        stopCriterion - the StopCriterion object to be used
      • GapFunction

        public GapFunction​(GapFunction other,
                           boolean deepCopy)
        Copy constructor
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • collectSettingsAsKeyValueMap

        public Map<String,​String> collectSettingsAsKeyValueMap()
        Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entity
        Specified by:
        collectSettingsAsKeyValueMap in class PlanitComponent<GapFunction>
        Returns:
        name-value map of all (user configurable) settings
      • hasConverged

        public boolean hasConverged​(int iterationIndex)
        Verify if algorithm has converged
        Parameters:
        iterationIndex - the index of the current iteration
        Returns:
        true if stopping criterion has been met, false otherwise
      • getStopCriterion

        public StopCriterion getStopCriterion()
        Return the StopCriterion object
        Returns:
        StopCriterion object being used
      • computeGap

        public abstract double computeGap()
        Compute the gap and return it
        Returns:
        the gap for the current iteration
      • getGap

        public abstract double getGap()
        Returns the last computed gap
        Returns:
        latest gap
      • deepClone

        public abstract GapFunction deepClone()
        deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible
        Specified by:
        deepClone in interface IdAble
        Specified by:
        deepClone in class PlanitComponent<GapFunction>
        Returns:
        deep copy of entity