Class Update

java.lang.Object
dynheurset.update.Update
Direct Known Subclasses:
PhaseDominanceUpdate, PhaseGreedyUpdate, PhaseQualityIndexUpdate

public abstract class Update
extends java.lang.Object
This class defines the update strategy used by a dynamic set.

The update strategy should specify:

  • The update condition which determines when to update the active set, and
  • The update criterion which determines how to update the active set (which heuristic to include in the active set)
The logic for the update condition should be implemented in canUpdate method of this class. The logic for the update criterion should be implemented in performUpdate method of this class.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.List<java.lang.Integer> activeList
    The active set which contains the indexes of heuristics in the universal set.
    protected java.util.List<java.lang.Integer> heurList
    The universal set which contains the heuristic unique identifiers
    protected Measure measure
    The performance measure that measures the value of low-level heuristics
    int numRemove  
    int numReset  
    int numUpdates  
    protected Remove remove
    The removal strategy
    protected Reset reset
    The reset strategy
    protected RunStat runStat
    The run statistics to record the heuristic performance.
  • Constructor Summary

    Constructors 
    Constructor Description
    Update()  
  • Method Summary

    Modifier and Type Method Description
    protected abstract boolean canUpdate()
    Returns true if the active set is to be updated and false otherwise.
    java.util.List<java.lang.Integer> getActiveList()
    Returns an array list of the indexes of the heuristics currently in the active set.
    protected abstract void performUpdate()
    Determines which heuristics to include in the active set.
    void setHeurList​(int[] heurArray)
    Sets the universal set for this dynamic heuristic set.
    void setMeasure​(Measure measure)
    Sets the performance measure for this update strategy.
    void setRemove​(Remove remove)
    Sets the removal strategy for this update strategy.
    void setReset​(Reset reset)
    Sets the reset strategy for this update strategy.
    void setRunStat​(RunStat runStat)
    Sets the runStat field of this update strategy.
    java.util.List<java.lang.Integer> updateActiveList()
    Updates and returns the active set.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • runStat

      protected RunStat runStat
      The run statistics to record the heuristic performance.
    • measure

      protected Measure measure
      The performance measure that measures the value of low-level heuristics
    • remove

      protected Remove remove
      The removal strategy
      See Also:
      Remove
    • reset

      protected Reset reset
      The reset strategy
      See Also:
      Reset
    • numUpdates

      public int numUpdates
    • numRemove

      public int numRemove
    • numReset

      public int numReset
    • heurList

      protected java.util.List<java.lang.Integer> heurList
      The universal set which contains the heuristic unique identifiers
    • activeList

      protected java.util.List<java.lang.Integer> activeList
      The active set which contains the indexes of heuristics in the universal set.

      It is very important to note the difference between activeList (active set) and heurList (universal set). The universal set contains integer identifiers where each element in the universal set uniquely identifies one heuristic. The active set contains the indexes (positions) of the heuristics as appear in the universal set. For instance, the universal set may contain [3,5,7,9] and if the heuristics identified by 3, 7 are in the active set, then the active set is [0,2]

  • Constructor Details

  • Method Details

    • setRunStat

      public void setRunStat​(RunStat runStat)
      Sets the runStat field of this update strategy.
      Parameters:
      runStat - the observer that record the performance of heuristics
    • setMeasure

      public void setMeasure​(Measure measure)
      Sets the performance measure for this update strategy.
      Parameters:
      measure - the performance measure
    • setRemove

      public void setRemove​(Remove remove)
      Sets the removal strategy for this update strategy.
      Parameters:
      remove - the removal strategy
    • setReset

      public void setReset​(Reset reset)
      Sets the reset strategy for this update strategy.
      Parameters:
      reset - the reset strategy
    • setHeurList

      public void setHeurList​(int[] heurArray)
      Sets the universal set for this dynamic heuristic set.

      The universal set should contain all heuristics represented in an array of integers where each integer identifies a unique heuristic.

      Parameters:
      heurArray - an integer array where each integer uniquely identifies a heuristic
    • canUpdate

      protected abstract boolean canUpdate()
      Returns true if the active set is to be updated and false otherwise.

      In this method, you should use the RunStat field to access the run information that you may need to decides whether to update the active set.

      Returns:
      true if the active set is to be updated and false otherwise.
    • updateActiveList

      public java.util.List<java.lang.Integer> updateActiveList()
      Updates and returns the active set.

      This method should be used as this. To specify your own update strategy you need to implement canUpdate (update condition) and performUpdate (update criterion).

      Returns:
      an array list containing the indexes of the heuristics currently in the active set.
    • performUpdate

      protected abstract void performUpdate()
      Determines which heuristics to include in the active set.

      This method should contain your logic for updating the active set. You can access the runStat and measure fields in your implementation to get the search-status information and measure the performance of heuristics. regarding the search

    • getActiveList

      public java.util.List<java.lang.Integer> getActiveList()
      Returns an array list of the indexes of the heuristics currently in the active set.

      Note that each element in the returned array list is an index of a heuristic in the universal set. This is should not be confused by the integer identifiers contained the universal set.

      Returns:
      the active set