From 5131fb407fa33f237248c4a5187af59ff7672b5c Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Tue, 3 Jul 2012 12:52:03 +0000 Subject: [PATCH] Some useful code (commented out) for getting variance etc. from simulation results. git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@5425 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/simulator/method/CIMethod.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/prism/src/simulator/method/CIMethod.java b/prism/src/simulator/method/CIMethod.java index ac94489c..2e0dc4d0 100644 --- a/prism/src/simulator/method/CIMethod.java +++ b/prism/src/simulator/method/CIMethod.java @@ -131,21 +131,25 @@ public abstract class CIMethod extends SimulationMethod @Override public Object getResult(Sampler sampler) throws PrismException { - double estimate = sampler.getMeanValue(); + double mean = sampler.getMeanValue(); + //double variance = sampler.getVariance(); + //double stddev = Math.sqrt(variance); switch (prOp) { case 0: // 0=quantitative - return new Double(estimate); + return new Double(mean); + //return new prism.Interval(mean - stddev, mean + stddev); + //return new Double(stddev / mean); // noise case -1: // -1=lower bound - if (estimate >= theta + width) + if (mean >= theta + width) return new Boolean(true); - else if (estimate <= theta - width) + else if (mean <= theta - width) return new Boolean(false); else throw new PrismException("Approximation is not precise enough to get a result"); case 1: // 1=upper bound - if (estimate >= theta + width) + if (mean >= theta + width) return new Boolean(false); - else if (estimate <= theta - width) + else if (mean <= theta - width) return new Boolean(true); else throw new PrismException("Approximation is not precise enough to get a result");