EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.tcfmoop.config]

COVERAGE SUMMARY FOR SOURCE FILE [NoNewParetoOptimalCandidatesFoundConfig.java]

nameclass, %method, %block, %line, %
NoNewParetoOptimalCandidatesFoundConfig.java0%   (0/1)0%   (0/4)0%   (0/32)0%   (0/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class NoNewParetoOptimalCandidatesFoundConfig0%   (0/1)0%   (0/4)0%   (0/32)0%   (0/11)
NoNewParetoOptimalCandidatesFoundConfig (): void 0%   (0/1)0%   (0/4)0%   (0/2)
getIterationsWithoutNewCandidates (): int 0%   (0/1)0%   (0/4)0%   (0/1)
setIterationsWithoutNewCandidates (int): void 0%   (0/1)0%   (0/13)0%   (0/4)
validateConfiguration (): boolean 0%   (0/1)0%   (0/11)0%   (0/4)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.tcfmoop.config;
5 
6import de.uka.ipd.sdq.tcfmoop.config.exceptions.InvalidConfigException;
7 
8/**
9 * Configuration class for NoNewParetoOptimalCandidatesFound termination criterion.
10 * @author Atanas Dimitrov
11 */
12public class NoNewParetoOptimalCandidatesFoundConfig extends
13                AbstractConfiguration {
14        
15        //Number of iterations without a new pareto optimal candidate
16        private Integer iterationsWithoutNewCandidates;
17        
18        public NoNewParetoOptimalCandidatesFoundConfig(){
19                super(TerminationCriteriaNames.NO_NEW_PARETO_OPTIMAL_CANDIDATES_FOUND);
20        }
21 
22        /**
23         * {@inheritDoc}
24         */
25        @Override
26        public boolean validateConfiguration() {
27                if (this.getTerminationCriterionName() != TerminationCriteriaNames.NO_NEW_PARETO_OPTIMAL_CANDIDATES_FOUND
28                                || this.iterationsWithoutNewCandidates == null) {
29                        return false;
30                } else {
31                        return true;
32                }
33        }
34        
35        /**
36         * Set the required number of iterations without new pareto optimal candidates in the pareto optimal set.
37         * @param numberOfIterations required number of iterations without new pareto optimal candidates in the pareto optimal set. Must be a >=1.
38         * @throws InvalidConfigException if the supplied parameter do not conform to the required conditions.
39         */
40        public void setIterationsWithoutNewCandidates(int numberOfIterations) throws InvalidConfigException{
41                if(numberOfIterations < 1){
42                        throw new InvalidConfigException("NoNewParetoOptimalCandidatesFoundConfig.setNumberOfGenerationWithoutNewCandidates: " +
43                                        "The minimum number of generations without new pareto optimal candidate" +
44                                        " must be at least 1.");
45                }else{
46                        this.iterationsWithoutNewCandidates = numberOfIterations;
47                }
48        }
49        
50        /**
51         * Get the required number of iterations without new pareto optimal candidates in the pareto optimal set.
52         * @return the required number of iterations without new pareto optimal candidates in the pareto optimal set. Guaranteed to be >=1
53         */
54        public int getIterationsWithoutNewCandidates(){
55                return this.iterationsWithoutNewCandidates;
56        }
57 
58}

[all classes][de.uka.ipd.sdq.tcfmoop.config]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov