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 void
closeTask()
static Choice
createRandomGene(int index, DesignDecisionGenotype genotype)
static PopulationTracker
getAllIndividuals()
Returns the instance ofPopulationTracker
from the Opt4JTask
, which is anIndividualSetListener
that listens on thePopulation
instance from the Opt4JTask
.static org.opt4j.core.optimizer.Archive
getArchiveIndividuals()
Returns the instance ofArchive
from the Opt4JTask
, which is aDefaultArchive
inheriting fromCrowdingArchive
andBoundedArchive
.static DSECreator
getDSECreator()
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static DSEDecoder
getDSEDecoder()
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static DSEEvaluator
getDSEEvaluator()
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static DSEWorkflowConfiguration
getDSEWorkflowConfig()
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static DSEIndividualFactory
getIndividualFactory()
Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.static List<DSEIndividual>
getPopulationIndividuals()
Returns the instance ofPopulation
from the Opt4JTask
, which is a plainIndividualSet
.static DSEProblem
getProblem()
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
startOpt4JWithGUI()
Deprecated.static void
tearDown()
static void
terminate()
-
-
-
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 ofArchive
from the Opt4JTask
, which is aDefaultArchive
inheriting fromCrowdingArchive
andBoundedArchive
. Can only be called after callinginit(List, DSEWorkflowConfiguration, PCMInstance, IProgressMonitor, MDSDBlackboard)
.- Returns:
-
getPopulationIndividuals
public static List<DSEIndividual> 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
public static PopulationTracker 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
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
DSEWorkflowConfiguration
or 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
-
-