Class Opt4JStarter
java.lang.Object
de.uka.ipd.sdq.dsexplore.opt4j.start.Opt4JStarter
Main class to start the whole Opt4J stuff.
TODO: Make this a Singleton instead of static? Even better: Handle the global stuff properly. Similar to SimuComModel.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic ChoicecreateRandomGene(int index, DesignDecisionGenotype genotype) static PopulationTrackerReturns the instance ofPopulationTrackerfrom the Opt4JTask, which is anIndividualSetListenerthat listens on thePopulationinstance from the Opt4JTask.static org.opt4j.core.optimizer.ArchiveReturns the instance ofArchivefrom the Opt4JTask, which is aDefaultArchiveinheriting fromCrowdingArchiveandBoundedArchive.static DSECreatorCan only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static DSEDecoderCan only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static DSEEvaluatorCan only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static DSEWorkflowConfigurationCan only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static DSEIndividualFactoryCan only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static List<DSEIndividual>Returns the instance ofPopulationfrom the Opt4JTask, which is a plainIndividualSet.static DSEProblemCan only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static voidinit(List<IAnalysis> evaluators, DSEWorkflowConfiguration dseConfig, org.palladiosimulator.solver.models.PCMInstance pcmInstance, IProgressMonitor monitor, de.uka.ipd.sdq.workflow.mdsd.blackboard.MDSDBlackboard blackboard) static voidopenTask(Collection<com.google.inject.Module> modules) static voidregisterWriter(ResultsWriter writer) Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static voidrunOpt4JWithPopulation(DSEWorkflowConfiguration dseConfig, IProgressMonitor monitor, List<DesignDecisionGenotype> genotypes, List<DesignDecisionGenotype> allCandidates, List<DesignDecisionGenotype> archiveCandidates) Only starts Opt4J, needs call toOpt4JStarter#init(IAnalysis, IAnalysis, List, CostRepository, PCMInstance, boolean)first.static voidDeprecated.static voidtearDown()static void
-
Constructor Details
-
Opt4JStarter
public Opt4JStarter()
-
-
Method Details
-
init
public static void init(List<IAnalysis> evaluators, DSEWorkflowConfiguration dseConfig, org.palladiosimulator.solver.models.PCMInstance pcmInstance, IProgressMonitor monitor, de.uka.ipd.sdq.workflow.mdsd.blackboard.MDSDBlackboard blackboard) throws CoreException - Throws:
CoreException
-
openTask
-
runOpt4JWithPopulation
public static void runOpt4JWithPopulation(DSEWorkflowConfiguration dseConfig, IProgressMonitor monitor, List<DesignDecisionGenotype> genotypes, List<DesignDecisionGenotype> allCandidates, List<DesignDecisionGenotype> archiveCandidates) throws CoreException Only starts Opt4J, needs call toOpt4JStarter#init(IAnalysis, IAnalysis, List, CostRepository, PCMInstance, boolean)first.- Parameters:
dseConfig-monitor-genotypes- May be nullallCandidates-archiveCandidates-- Throws:
CoreException
-
getIndividualFactory
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
- Throws:
CoreException
-
closeTask
public static void closeTask() -
startOpt4JWithGUI
Deprecated. -
terminate
public static void terminate() -
getArchiveIndividuals
public static org.opt4j.core.optimizer.Archive getArchiveIndividuals()Returns the instance ofArchivefrom the Opt4JTask, which is aDefaultArchiveinheriting fromCrowdingArchiveandBoundedArchive. Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
-
getPopulationIndividuals
Returns the instance ofPopulationfrom the Opt4JTask, which is a plainIndividualSet. Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
-
getAllIndividuals
Returns the instance ofPopulationTrackerfrom the Opt4JTask, which is anIndividualSetListenerthat listens on thePopulationinstance from the Opt4JTask. Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
-
tearDown
public static void tearDown() -
registerWriter
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Parameters:
writer-
-
createRandomGene
-
getProblem
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard). If not, this returns null.- Returns:
- the problem or null.
-
getDSEEvaluator
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
- Throws:
CoreException
-
getDSEDecoder
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
- Throws:
CoreException
-
getDSEWorkflowConfig
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
- the
DSEWorkflowConfigurationor null is init has not been called before.
-
getDSECreator
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
- Throws:
CoreException
-