1 | package de.uka.ipd.sdq.dsexplore.opt4j.optimizer.heuristic.operators; |
2 | |
3 | import java.util.ArrayList; |
4 | import java.util.Collection; |
5 | |
6 | import org.opt4j.core.problem.Genotype; |
7 | import org.opt4j.operator.copy.Copy; |
8 | |
9 | import de.uka.ipd.sdq.dsexplore.launch.DSEWorkflowConfiguration; |
10 | import de.uka.ipd.sdq.dsexplore.opt4j.optimizer.heuristic.operators.impl.ConcurrentProcessingSystemImplCatia; |
11 | import de.uka.ipd.sdq.dsexplore.opt4j.optimizer.heuristic.operators.impl.DecreaseProcessingRateImpl; |
12 | import de.uka.ipd.sdq.dsexplore.opt4j.optimizer.heuristic.operators.impl.IncreaseProcessingRateImpl; |
13 | import de.uka.ipd.sdq.dsexplore.opt4j.optimizer.heuristic.operators.impl.ReallocateForReduceLinkUsage; |
14 | import de.uka.ipd.sdq.dsexplore.opt4j.optimizer.heuristic.operators.impl.ReallocationImpl; |
15 | import de.uka.ipd.sdq.dsexplore.opt4j.optimizer.heuristic.operators.impl.ServerConsolidationImpl; |
16 | import de.uka.ipd.sdq.dsexplore.opt4j.optimizer.heuristic.operators.impl.ServerExpansionImpl; |
17 | import de.uka.ipd.sdq.dsexplore.opt4j.representation.DSEIndividualBuilder; |
18 | |
19 | public class TacticOperatorsFactory { |
20 | |
21 | /** |
22 | * Returns a collection of all actived heuristics. |
23 | */ |
24 | public static Collection<ITactic> getActivatedInstances(Copy<Genotype> copy, DSEIndividualBuilder individualBuilder, DSEWorkflowConfiguration configuration) { |
25 | |
26 | Collection<ITactic> activatedHeuristics = new ArrayList<ITactic>(); |
27 | if (configuration.getUseReallocation()) { |
28 | activatedHeuristics.add(new ReallocationImpl(copy, individualBuilder, configuration)); |
29 | } |
30 | if (configuration.getUseProcessingRate()) { |
31 | activatedHeuristics.add(new IncreaseProcessingRateImpl(copy, individualBuilder, configuration)); |
32 | activatedHeuristics.add(new DecreaseProcessingRateImpl(copy, individualBuilder, configuration)); |
33 | } |
34 | if (configuration.getUseServerConsolidation()) { |
35 | activatedHeuristics.add(new ServerConsolidationImpl(copy, individualBuilder, configuration)); |
36 | } |
37 | if (configuration.getUseServerExpansion()) { |
38 | activatedHeuristics.add(new ServerExpansionImpl(copy, individualBuilder, configuration)); |
39 | } |
40 | |
41 | if (configuration.getUseLinkReallocationTactic()){ |
42 | activatedHeuristics.add(new ReallocateForReduceLinkUsage(copy, individualBuilder, configuration)); |
43 | } |
44 | |
45 | if (configuration.getUseAntipatternKnowledge()) { |
46 | activatedHeuristics.add(new ConcurrentProcessingSystemImplCatia(copy, individualBuilder, configuration)); |
47 | } |
48 | return activatedHeuristics; |
49 | } |
50 | |
51 | } |