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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static Choice
createRandomGene
(int index, DesignDecisionGenotype genotype) static PopulationTracker
Returns the instance ofPopulationTracker
from the Opt4JTask
, which is anIndividualSetListener
that listens on thePopulation
instance from the Opt4JTask
.static org.opt4j.core.optimizer.Archive
Returns the instance ofArchive
from the Opt4JTask
, which is aDefaultArchive
inheriting fromCrowdingArchive
andBoundedArchive
.static DSECreator
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static DSEDecoder
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static DSEEvaluator
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static DSEWorkflowConfiguration
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static DSEIndividualFactory
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static List<DSEIndividual>
Returns the instance ofPopulation
from the Opt4JTask
, which is a plainIndividualSet
.static DSEProblem
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.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) static void
openTask
(Collection<com.google.inject.Module> modules) static void
registerWriter
(ResultsWriter writer) Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static void
runOpt4JWithPopulation
(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 void
Deprecated.static void
tearDown()
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 ofArchive
from the Opt4JTask
, which is aDefaultArchive
inheriting fromCrowdingArchive
andBoundedArchive
. Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.- Returns:
-
getPopulationIndividuals
Returns the instance ofPopulation
from the Opt4JTask
, which is a plainIndividualSet
. Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.- Returns:
-
getAllIndividuals
Returns the instance ofPopulationTracker
from the Opt4JTask
, which is anIndividualSetListener
that listens on thePopulation
instance 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
DSEWorkflowConfiguration
or null is init has not been called before.
-
getDSECreator
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.- Returns:
- Throws:
CoreException
-