1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.pcmsolver.handler; |
5 | |
6 | import org.apache.log4j.Logger; |
7 | |
8 | import de.uka.ipd.sdq.pcm.seff.ProbabilisticBranchTransition; |
9 | import de.uka.ipd.sdq.pcmsolver.visitors.SeffVisitor; |
10 | |
11 | /** |
12 | * @author Koziolek |
13 | * |
14 | */ |
15 | public class ProbabilisticBranchTransitionHandler extends |
16 | AbstractBranchTransitionHandler { |
17 | |
18 | private static Logger logger = Logger |
19 | .getLogger(ProbabilisticBranchTransitionHandler.class.getName()); |
20 | |
21 | public ProbabilisticBranchTransitionHandler(SeffVisitor seffVisitor) { |
22 | super(seffVisitor); |
23 | } |
24 | |
25 | public void handle(ProbabilisticBranchTransition bt) { |
26 | double branchProb = bt.getBranchProbability(); |
27 | logger.debug("BranchProb:" + branchProb); |
28 | storeToUsageContext(bt, branchProb); |
29 | |
30 | // Don't solve branch transitions that can never be reached. This |
31 | // releases the modeler from the duty to provide all character |
32 | // parameterizations for branches that are never reached (see Bug 615) |
33 | if (branchProb > 0.0) { |
34 | visitChildBehaviour(bt); |
35 | } |
36 | } |
37 | |
38 | } |