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

COVERAGE SUMMARY FOR SOURCE FILE [DSEIndividualStateListener.java]

nameclass, %method, %block, %line, %
DSEIndividualStateListener.java0%   (0/1)0%   (0/4)0%   (0/54)0%   (0/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DSEIndividualStateListener0%   (0/1)0%   (0/4)0%   (0/54)0%   (0/15)
<static initializer> 0%   (0/1)0%   (0/4)0%   (0/3)
DSEIndividualStateListener (DSEWorkflowConfiguration): void 0%   (0/1)0%   (0/20)0%   (0/4)
finalize (): void 0%   (0/1)0%   (0/6)0%   (0/3)
inidividualStateChanged (Individual): void 0%   (0/1)0%   (0/24)0%   (0/5)

1package de.uka.ipd.sdq.dsexplore.opt4j.representation;
2 
3import org.apache.log4j.Logger;
4import org.opt4j.core.Individual;
5import org.opt4j.core.IndividualStateListener;
6 
7import de.uka.ipd.sdq.dsexplore.helper.ResultsWriter;
8import de.uka.ipd.sdq.dsexplore.launch.DSEWorkflowConfiguration;
9import de.uka.ipd.sdq.dsexplore.opt4j.start.Opt4JStarter;
10 
11public class DSEIndividualStateListener implements IndividualStateListener {
12        
13        ResultsWriter writer;
14 
15        /** Logger for log4j. */
16        private static Logger logger = 
17                Logger.getLogger("de.uka.ipd.sdq.dsexplore.opt4j.representation.DSEIndividualStateListener");
18        
19        public DSEIndividualStateListener(DSEWorkflowConfiguration dseConfig){
20                this.writer = new ResultsWriter(dseConfig.getResultFolder()+"allIndividualsDirectly");
21                Opt4JStarter.registerWriter(this.writer);
22        }
23 
24        @Override
25        public void inidividualStateChanged(Individual individual) {
26                if (individual.getState() == Individual.State.EVALUATED){
27                        if (individual instanceof DSEIndividual){
28                                this.writer.writeIndividual((DSEIndividual)individual);
29                        } else {
30                                logger.error("There was an illegal individual that is not instance of DSEIndividual. Ignoring it. "+individual.toString());
31                        }
32                }
33 
34        }
35 
36        @Override
37        protected void finalize() throws Throwable {
38                this.writer.close();
39                super.finalize();
40        }
41        
42        
43 
44}

[all classes][de.uka.ipd.sdq.dsexplore.opt4j.representation]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov