Class Opt4JStarter
- java.lang.Object
-
- de.uka.ipd.sdq.dsexplore.opt4j.start.Opt4JStarter
-
public class Opt4JStarter extends Object
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 Constructor Description Opt4JStarter()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidcloseTask()static ChoicecreateRandomGene(int index, DesignDecisionGenotype genotype)static PopulationTrackergetAllIndividuals()Returns the instance ofPopulationTrackerfrom the Opt4JTask, which is anIndividualSetListenerthat listens on thePopulationinstance from the Opt4JTask.static org.opt4j.core.optimizer.ArchivegetArchiveIndividuals()Returns the instance ofArchivefrom the Opt4JTask, which is aDefaultArchiveinheriting fromCrowdingArchiveandBoundedArchive.static DSECreatorgetDSECreator()Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static DSEDecodergetDSEDecoder()Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static DSEEvaluatorgetDSEEvaluator()Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static DSEWorkflowConfigurationgetDSEWorkflowConfig()Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static DSEIndividualFactorygetIndividualFactory()Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).static List<DSEIndividual>getPopulationIndividuals()Returns the instance ofPopulationfrom the Opt4JTask, which is a plainIndividualSet.static DSEProblemgetProblem()Can 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 voidstartOpt4JWithGUI()Deprecated.static voidtearDown()static voidterminate()
-
-
-
Method Detail
-
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
public static void openTask(Collection<com.google.inject.Module> modules)
-
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
public static DSEIndividualFactory getIndividualFactory() throws CoreException
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
- Throws:
CoreException
-
closeTask
public static void closeTask()
-
startOpt4JWithGUI
@Deprecated public static void 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
public static List<DSEIndividual> getPopulationIndividuals()
Returns the instance ofPopulationfrom the Opt4JTask, which is a plainIndividualSet. Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
-
getAllIndividuals
public static PopulationTracker 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
public static void registerWriter(ResultsWriter writer)
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Parameters:
writer-
-
createRandomGene
public static Choice createRandomGene(int index, DesignDecisionGenotype genotype)
-
getProblem
public static DSEProblem getProblem()
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard). If not, this returns null.- Returns:
- the problem or null.
-
getDSEEvaluator
public static DSEEvaluator getDSEEvaluator() throws CoreException
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
- Throws:
CoreException
-
getDSEDecoder
public static DSEDecoder getDSEDecoder() throws CoreException
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
- Throws:
CoreException
-
getDSEWorkflowConfig
public static DSEWorkflowConfiguration getDSEWorkflowConfig()
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
- the
DSEWorkflowConfigurationor null is init has not been called before.
-
getDSECreator
public static DSECreator getDSECreator() throws CoreException
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard).- Returns:
- Throws:
CoreException
-
-