Class TwoPhaseHASCO<S extends ai.libs.jaicore.search.probleminputs.GraphSearchWithPathEvaluationsInput<N,A,java.lang.Double>,N,A>
- java.lang.Object
-
- ai.libs.jaicore.basic.algorithm.AAlgorithm<I,O>
-
- ai.libs.jaicore.basic.algorithm.ASolutionCandidateIterator<I,O>
-
- ai.libs.jaicore.basic.algorithm.AOptimizer<P,O,V>
-
- ai.libs.hasco.optimizingfactory.SoftwareConfigurationAlgorithm<TwoPhaseSoftwareConfigurationProblem,HASCOSolutionCandidate<java.lang.Double>,java.lang.Double>
-
- ai.libs.hasco.variants.forwarddecomposition.twophase.TwoPhaseHASCO<S,N,A>
-
- All Implemented Interfaces:
ai.libs.jaicore.basic.algorithm.IAlgorithm<TwoPhaseSoftwareConfigurationProblem,HASCOSolutionCandidate<java.lang.Double>>,ai.libs.jaicore.basic.algorithm.IOptimizationAlgorithm<TwoPhaseSoftwareConfigurationProblem,HASCOSolutionCandidate<java.lang.Double>,java.lang.Double>,ai.libs.jaicore.basic.algorithm.ISolutionCandidateIterator<TwoPhaseSoftwareConfigurationProblem,HASCOSolutionCandidate<java.lang.Double>>,ai.libs.jaicore.basic.Cancelable,ai.libs.jaicore.basic.ILoggingCustomizable,java.lang.Iterable<ai.libs.jaicore.basic.algorithm.events.AlgorithmEvent>,java.util.concurrent.Callable<HASCOSolutionCandidate<java.lang.Double>>,java.util.Iterator<ai.libs.jaicore.basic.algorithm.events.AlgorithmEvent>
public class TwoPhaseHASCO<S extends ai.libs.jaicore.search.probleminputs.GraphSearchWithPathEvaluationsInput<N,A,java.lang.Double>,N,A> extends SoftwareConfigurationAlgorithm<TwoPhaseSoftwareConfigurationProblem,HASCOSolutionCandidate<java.lang.Double>,java.lang.Double>
-
-
Constructor Summary
Constructors Constructor Description TwoPhaseHASCO(TwoPhaseSoftwareConfigurationProblem problem, TwoPhaseHASCOConfig config)TwoPhaseHASCO(TwoPhaseSoftwareConfigurationProblem problem, TwoPhaseHASCOConfig config, HASCO<S,N,A,java.lang.Double> hasco)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()TwoPhaseHASCOConfiggetConfig()intgetExpectedRuntimeForPhase2ForAGivenPool(java.util.Collection<HASCOSolutionCandidate<java.lang.Double>> solutions)intgetExpectedTotalRemainingRuntimeForAGivenPool(java.util.Collection<HASCOSolutionCandidate<java.lang.Double>> solutions, boolean assumeCurrentlyBestCandidateToBeSelected)ai.libs.jaicore.search.core.interfaces.GraphGenerator<N,A>getGraphGenerator()HASCO<S,N,A,java.lang.Double>getHasco()java.lang.StringgetLoggerName()intgetMaximumPostprocessingTimeOfAnyPoolMember(java.util.Collection<HASCOSolutionCandidate<java.lang.Double>> solutions)intgetNumberOfConsideredSolutions()java.util.Queue<HASCOSolutionCandidate<java.lang.Double>>getPhase1ResultQueue()intgetPostprocessingTimeOfCurrentlyBest()TwoPhaseHASCOReportgetReort()intgetSecondsSpentInPhase1()HASCOSolutionCandidate<java.lang.Double>getSelectedSolutionCandidate()java.util.List<HASCOSolutionCandidate<java.lang.Double>>getSelectionForPhase2()java.util.Map<HASCOSolutionCandidate<java.lang.Double>,java.lang.Double>getSelectionScoresOfCandidates()ai.libs.jaicore.basic.algorithm.events.AlgorithmEventnextWithException()protected HASCOSolutionCandidate<java.lang.Double>selectModel()voidsetHasco(HASCO<S,N,A,java.lang.Double> hasco)voidsetLoggerName(java.lang.String name)voidsetNumberOfConsideredSolutions(int numberOfConsideredSolutions)protected booleanshouldSearchTerminate(long timeRemaining)voidshutdown()java.lang.StringtoString()-
Methods inherited from class ai.libs.jaicore.basic.algorithm.AOptimizer
call, getBestSeenSolution, nextSolutionCandidate, nextSolutionCandidateEvent, setBestSeenSolution, updateBestSeenSolution
-
Methods inherited from class ai.libs.jaicore.basic.algorithm.ASolutionCandidateIterator
collectAllSolutions
-
Methods inherited from class ai.libs.jaicore.basic.algorithm.AAlgorithm
activate, announceTimeoutDetected, avoidReinterruptionOnShutdownOnCurrentThread, checkAndConductTermination, checkTermination, computeTimeoutAware, getActivationTime, getId, getInput, getNumCPUs, getRemainingTimeToDeadline, getState, getTimeout, getTimeoutPrecautionOffset, hasNext, hasThreadBeenInterruptedDuringShutdown, interruptThreadAsPartOfShutdown, isCanceled, isShutdownInitialized, isStopCriterionSatisfied, isTimeouted, iterator, next, post, registerActiveThread, registerListener, resolveShutdownInterruptOnCurrentThread, setConfig, setMaxNumThreads, setNumCPUs, setState, setTimeout, setTimeout, setTimeoutPrecautionOffset, terminate, unregisterActiveThread, unregisterThreadAndShutdown
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
TwoPhaseHASCO
public TwoPhaseHASCO(TwoPhaseSoftwareConfigurationProblem problem, TwoPhaseHASCOConfig config)
-
TwoPhaseHASCO
public TwoPhaseHASCO(TwoPhaseSoftwareConfigurationProblem problem, TwoPhaseHASCOConfig config, HASCO<S,N,A,java.lang.Double> hasco)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
nextWithException
public ai.libs.jaicore.basic.algorithm.events.AlgorithmEvent nextWithException() throws java.lang.InterruptedException, ai.libs.jaicore.basic.algorithm.exceptions.AlgorithmTimeoutedException, ai.libs.jaicore.basic.algorithm.exceptions.AlgorithmException, ai.libs.jaicore.basic.algorithm.AlgorithmExecutionCanceledException- Throws:
java.lang.InterruptedExceptionai.libs.jaicore.basic.algorithm.exceptions.AlgorithmTimeoutedExceptionai.libs.jaicore.basic.algorithm.exceptions.AlgorithmExceptionai.libs.jaicore.basic.algorithm.AlgorithmExecutionCanceledException
-
shouldSearchTerminate
protected boolean shouldSearchTerminate(long timeRemaining)
-
getSelectionForPhase2
public java.util.List<HASCOSolutionCandidate<java.lang.Double>> getSelectionForPhase2()
-
getExpectedTotalRemainingRuntimeForAGivenPool
public int getExpectedTotalRemainingRuntimeForAGivenPool(java.util.Collection<HASCOSolutionCandidate<java.lang.Double>> solutions, boolean assumeCurrentlyBestCandidateToBeSelected)
-
getPostprocessingTimeOfCurrentlyBest
public int getPostprocessingTimeOfCurrentlyBest()
-
getMaximumPostprocessingTimeOfAnyPoolMember
public int getMaximumPostprocessingTimeOfAnyPoolMember(java.util.Collection<HASCOSolutionCandidate<java.lang.Double>> solutions)
-
getExpectedRuntimeForPhase2ForAGivenPool
public int getExpectedRuntimeForPhase2ForAGivenPool(java.util.Collection<HASCOSolutionCandidate<java.lang.Double>> solutions)
-
selectModel
protected HASCOSolutionCandidate<java.lang.Double> selectModel() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
getPhase1ResultQueue
public java.util.Queue<HASCOSolutionCandidate<java.lang.Double>> getPhase1ResultQueue()
-
getSecondsSpentInPhase1
public int getSecondsSpentInPhase1()
-
getSelectionScoresOfCandidates
public java.util.Map<HASCOSolutionCandidate<java.lang.Double>,java.lang.Double> getSelectionScoresOfCandidates()
-
shutdown
public void shutdown()
- Overrides:
shutdownin classai.libs.jaicore.basic.algorithm.AAlgorithm<TwoPhaseSoftwareConfigurationProblem,HASCOSolutionCandidate<java.lang.Double>>
-
cancel
public void cancel()
- Specified by:
cancelin interfaceai.libs.jaicore.basic.Cancelable- Overrides:
cancelin classai.libs.jaicore.basic.algorithm.AAlgorithm<TwoPhaseSoftwareConfigurationProblem,HASCOSolutionCandidate<java.lang.Double>>
-
getSelectedSolutionCandidate
public HASCOSolutionCandidate<java.lang.Double> getSelectedSolutionCandidate()
- Returns:
- The solution candidate selected by TwoPhase HASCO
-
getConfig
public TwoPhaseHASCOConfig getConfig()
- Specified by:
getConfigin interfaceai.libs.jaicore.basic.algorithm.IAlgorithm<S extends ai.libs.jaicore.search.probleminputs.GraphSearchWithPathEvaluationsInput<N,A,java.lang.Double>,N>- Overrides:
getConfigin classai.libs.jaicore.basic.algorithm.AAlgorithm<TwoPhaseSoftwareConfigurationProblem,HASCOSolutionCandidate<java.lang.Double>>
-
getNumberOfConsideredSolutions
public int getNumberOfConsideredSolutions()
- Returns:
- The number of considered solutions in the selection phase.
-
setNumberOfConsideredSolutions
public void setNumberOfConsideredSolutions(int numberOfConsideredSolutions)
- Parameters:
numberOfConsideredSolutions- The number of considered solutions in the selection phase.
-
getGraphGenerator
public ai.libs.jaicore.search.core.interfaces.GraphGenerator<N,A> getGraphGenerator()
-
getReort
public TwoPhaseHASCOReport getReort()
-
getLoggerName
public java.lang.String getLoggerName()
- Specified by:
getLoggerNamein interfaceai.libs.jaicore.basic.ILoggingCustomizable- Overrides:
getLoggerNamein classai.libs.jaicore.basic.algorithm.AOptimizer<TwoPhaseSoftwareConfigurationProblem,HASCOSolutionCandidate<java.lang.Double>,java.lang.Double>
-
setLoggerName
public void setLoggerName(java.lang.String name)
- Specified by:
setLoggerNamein interfaceai.libs.jaicore.basic.ILoggingCustomizable- Overrides:
setLoggerNamein classai.libs.jaicore.basic.algorithm.AOptimizer<TwoPhaseSoftwareConfigurationProblem,HASCOSolutionCandidate<java.lang.Double>,java.lang.Double>
-
-