Class RunStat
public class RunStat
extends java.lang.Object
The statistics/variables which are kept track of include:
- The elapsed time
- The percentage improvement (disimprovement) achieved (caused) by each heuristic
- The frequency of improvement (disimprovement) achieved (caused) by each heuristic
- The percentage improvement over the best/run-best solution achieved by each heuristic
- The maximum number of iterations we waited so far before the best solution is updated
-
Field Summary
Fields Modifier and Type Field Description double[]bestImprThe percentage improvement of each heuristic over the best solutiondoublebestValueThe best solution valuejava.util.List<java.lang.Double>bestValuesTraceThe fitness trace of the best solutiondouble[]disimprThe percentage disimprovement of each heuristicjava.util.List<double[]>disimprListThe percentage disimprovement for each heuristic over several periods during the search.double[]durationsThe total cumulative execution time for each heuristic (utilization)doubleelpTimeThe elapsed time so farint[]heurListThe universal set which contains the heuristic unique identifiersdouble[]imprThe percentage improvement of each heuristicjava.util.List<double[]>imprListThe percentage improvement for each heuristic over several periods during the search.intiterThe current iteration (starts from 1)doublemaxTimeThe time limit in millisecondintmaxWaitThe maximum number of iterations we waited before the best solution is updateddouble[]numBestImprThe number of improvement of each heuristic over the best solutiondouble[]numDisimprThe number of disimprovement of each heuristic (frequency of disimprovement)java.util.List<double[]>numDisimprListThe number of disimprovement for each heuristic over several periods during the search.intnumHeursThe total number of heuristicsdouble[]numImprThe number of improvement of each heuristic (frequency of improvement)java.util.List<double[]>numImprListThe number of improvement for each heuristic over several periods during the search.double[]numRunBestImprThe number of improvement of each heuristic over the run-best solutiondouble[]numRunDisimprThe number of disimprovement of each heuristic in the current rundouble[]numRunImprThe number of improvement of each heuristic in the current rundouble[]runBestImprThe percentage improvement of each heuristic over the run-best solutiondoublerunBestValueThe best solution value in the current rundouble[]runDisimprThe percentage disimprovement of each heuristic for the current run (when a restart strategy is invoked, a new run will be started)double[]runImprThe percentage improvement of each heuristic for the current run (after the last restart is invoked)intrunMaxWaitThe maximum number of iterations we waited before the best solution is updated in the current runintrunWaitRemoveintrunWaitResetintrunWaitUpdatejava.util.List<java.lang.Double>uniqueValuesTraceThe unique fitness trace which does not store duplicate solution valuesjava.util.List<java.lang.Double>valuesTraceThe fitness trace of the hyper-heuristic (the objective values of the current solution)intwaitRemoveintwaitResetintwaitUpdate -
Constructor Summary
Constructors Constructor Description RunStat() -
Method Summary
Modifier and Type Method Description voidinit(double initValue)Initializes the fields of thisRunStatobject.voidrestart(double initValue)Indicates that a restart strategy is triggered in the hyper-heuristic.voidsetHeurList(int[] heurList)Sets the universal set for thisRunStatobject.voidsetMaxTime(long maxTime)Sets the maximum computational time for this dynamic heuristic set.voidupdateHeurValue(int idx, double currentValue, double newValue, long duration)Updates the performance-related information of the heuristic stored at indexidxin the universal set of this dynamic set.
-
Field Details
-
heurList
public int[] heurListThe universal set which contains the heuristic unique identifiers -
impr
public double[] imprThe percentage improvement of each heuristic -
runImpr
public double[] runImprThe percentage improvement of each heuristic for the current run (after the last restart is invoked) -
disimpr
public double[] disimprThe percentage disimprovement of each heuristic -
runDisimpr
public double[] runDisimprThe percentage disimprovement of each heuristic for the current run (when a restart strategy is invoked, a new run will be started) -
bestImpr
public double[] bestImprThe percentage improvement of each heuristic over the best solution -
runBestImpr
public double[] runBestImprThe percentage improvement of each heuristic over the run-best solution -
numImpr
public double[] numImprThe number of improvement of each heuristic (frequency of improvement) -
numRunImpr
public double[] numRunImprThe number of improvement of each heuristic in the current run -
numDisimpr
public double[] numDisimprThe number of disimprovement of each heuristic (frequency of disimprovement) -
numRunDisimpr
public double[] numRunDisimprThe number of disimprovement of each heuristic in the current run -
numBestImpr
public double[] numBestImprThe number of improvement of each heuristic over the best solution -
numRunBestImpr
public double[] numRunBestImprThe number of improvement of each heuristic over the run-best solution -
durations
public double[] durationsThe total cumulative execution time for each heuristic (utilization) -
numHeurs
public int numHeursThe total number of heuristics -
iter
public int iterThe current iteration (starts from 1) -
maxTime
public double maxTimeThe time limit in millisecond -
elpTime
public double elpTimeThe elapsed time so far -
bestValue
public double bestValueThe best solution value -
runBestValue
public double runBestValueThe best solution value in the current run -
waitRemove
public int waitRemove -
runWaitRemove
public int runWaitRemove -
waitReset
public int waitReset -
runWaitReset
public int runWaitReset -
waitUpdate
public int waitUpdate -
runWaitUpdate
public int runWaitUpdate -
maxWait
public int maxWaitThe maximum number of iterations we waited before the best solution is updated -
runMaxWait
public int runMaxWaitThe maximum number of iterations we waited before the best solution is updated in the current run -
valuesTrace
public java.util.List<java.lang.Double> valuesTraceThe fitness trace of the hyper-heuristic (the objective values of the current solution) -
uniqueValuesTrace
public java.util.List<java.lang.Double> uniqueValuesTraceThe unique fitness trace which does not store duplicate solution values -
bestValuesTrace
public java.util.List<java.lang.Double> bestValuesTraceThe fitness trace of the best solution -
imprList
public java.util.List<double[]> imprListThe percentage improvement for each heuristic over several periods during the search.The total computational time is divided into several periods of the same time (default is
10periods). The improvement achieved by each heuristic in that period is recorded.The array at index
idxis the percentage improvement for all heuristics at periodidxstarting counting from0. To access the performance of the heuristic indexed byidxin the first period:imprList.get(0)[idx]. Note thatidxis the index of the heuristic in the universal set. -
disimprList
public java.util.List<double[]> disimprListThe percentage disimprovement for each heuristic over several periods during the search.The total computational time is divided into several periods of the same time (default is
10periods). The disimprovement caused by each heuristic in that period is recorded.The array at index
idxis the percentage disimprovement for all heuristics at periodidxstarting counting from0. To access the performance of the heuristic indexed byidxin the first period:imprList.get(0)[idx]. Note thatidxis the index of the heuristic in the universal set. -
numImprList
public java.util.List<double[]> numImprListThe number of improvement for each heuristic over several periods during the search.The total computational time is divided into several periods of the same time (default is
10periods) and the number of improvement achieved by each heuristic in that period is recorded.The array at index
idxis the number of improvement for all heuristics at periodidxstarting counting from0. To access the performance of the heuristic indexed byidxin the first period:imprList.get(0)[idx]. Note thatidxis the index of the heuristic in the universal set. -
numDisimprList
public java.util.List<double[]> numDisimprListThe number of disimprovement for each heuristic over several periods during the search.The total computational time is divided into several periods of the same time (default is
10periods) and the number of disimprovement achieved by each heuristic in that period is recorded.The array at index
idxis the number of disimprovement for all heuristics at periodidxstarting counting from0. To access the performance of the heuristic indexed byidxin the first period:imprList.get(0)[idx]. Note thatidxis the index of the heuristic in the universal set.
-
-
Constructor Details
-
RunStat
public RunStat()
-
-
Method Details
-
setHeurList
public void setHeurList(int[] heurList)Sets the universal set for thisRunStatobject.The universal set should contain all heuristics represented in an array of integers where each integer identifies a unique heuristic.
- Parameters:
heurList- an integer array where each integer uniquely identifies a heuristic
-
init
public void init(double initValue)Initializes the fields of thisRunStatobject.- Parameters:
initValue- the value of the initial solution from which the hyper-heuristic starts the search
-
updateHeurValue
public void updateHeurValue(int idx, double currentValue, double newValue, long duration)Updates the performance-related information of the heuristic stored at indexidxin the universal set of this dynamic set.Note that the universal set of this dynamic set is set using
setHeurList. Therefore,heurList.get(idx)returns the heuristic unique identifier.The update includes the percentage and frequency of improvement (disimprovement) achieved (caused) by this heuristic, the total execution time used by this heuristic, the percentage and frequency of improvement over the best solution and the run-best solution, etc.
- Parameters:
idx- the heuristic identifiercurrentValue- the solution value before applying the heuristicnewValue- the solution value after applying the heuristicduration- the time (in millisecond) taken by the heuristic to execute the move
-
restart
public void restart(double initValue)Indicates that a restart strategy is triggered in the hyper-heuristic.This method is relevant to hyper-heuristics that implement a restart strategy. This method is used by this dynamic set to reset run-specific statistics such as the percentage improvement over the run-best solution.
- Parameters:
initValue- the solution value of the solution from which the search is initialized
-
setMaxTime
public void setMaxTime(long maxTime)Sets the maximum computational time for this dynamic heuristic set.The maximum time should be the same as the maximum time for the hyper-heuristic using this dynamic heuristic set.
- Parameters:
maxTime- the time limit in millisecond for the hyper-heuristic using this dynamic set
-