1 | package de.uka.ipd.sdq.simucomframework.variables; |
2 | |
3 | import java.io.Serializable; |
4 | |
5 | import de.uka.ipd.sdq.simucomframework.variables.stackframe.SimulatedStackframe; |
6 | |
7 | /** |
8 | * Evaluation Proxies are used to store the defining equation instead of the |
9 | * actual value in a stackframe entry. This is usefull in cases where the |
10 | * equation is stochastic, e.g., contains a random variable like a |
11 | * probability function literal. For example, the evaluation proxy |
12 | * 10*IntPMF[(1;0.2)(2;0.8) evaluates to 10 in 20% of all cases and to 20 in |
13 | * 80% of all cases. |
14 | * Evaluation proxies are used to store INNER characterisations which are |
15 | * evaluated on every access instead of a single time during their initialisation |
16 | * @author Steffen Becker |
17 | * |
18 | */ |
19 | /** |
20 | * @author Steffen Becker |
21 | * |
22 | */ |
23 | public class EvaluationProxy implements Serializable { |
24 | |
25 | /** |
26 | * The stoex proxied by this object |
27 | */ |
28 | private String stoex; |
29 | |
30 | /** |
31 | * The Stackframe under which the stoex is evaluated |
32 | */ |
33 | private SimulatedStackframe<Object> contextFrame; |
34 | |
35 | public EvaluationProxy (String stoex, SimulatedStackframe<Object> contextFrame) |
36 | { |
37 | this.stoex = stoex; |
38 | this.contextFrame = contextFrame; |
39 | } |
40 | |
41 | public SimulatedStackframe<Object> getStackFrame() { |
42 | return contextFrame; |
43 | } |
44 | |
45 | public String getStoEx() { |
46 | return stoex; |
47 | } |
48 | |
49 | @Override |
50 | public String toString() { |
51 | return "EvaluationProxy<"+this.getStoEx()+">"; |
52 | } |
53 | |
54 | |
55 | } |