예제 #1
0
 //Verify MDP based on several DTMC: SSP
 public bool verifyMDPSSP(SimulationNoMDP sml, Policy policy, out string report)
 {
     report = null;
     policy.reSetPlan();
     while (policy.hasPolicy())
     {
         reSetRunTest();
         report += policy.reportAdversary(policy.updatePolicy());
         bool   result = singleSamplingTest(sml);
         string st     = result ? "Hypothesis Accepted!" : "Hypothesis Rejected!";
         report += "\nSingle Sampling Plan Result:\n" + sprtcount + "/" + sprttotal + "\n" + st;
         if (!result)
         {
             return(false);
         }
     }
     return(true);
 }
예제 #2
0
        //Verify MDP based on several DTMC: SPRT
        public bool verifyMDPSPRT(SimulationNoMDP sml, Policy policy, out string report)
        {
            report = null;
            policy.reSetPlan();
            while (policy.hasPolicy())
            {
                reSetRunTest();
                report += policy.reportAdversary(policy.updatePolicy());
                bool result = sequentialProbRatioTest(sml);

                // following two statements only used for
                string st = result ? "Hypothesis Accepted!" : "Hypothesis Rejected!";
                report += "\nSeqential Ration Plan Result:\n" + sprtcount + "/" + sprttotal + "\n" + st;
                if (!result)
                {
                    return(false);
                }
            }
            return(true);
        }
 //Verify DTMC: SSP
 public bool verifyMDPSSP(Simulation sml, Policy policy, out string report)
 {
     report = null;
     policy.reSetPlan();
     while (policy.hasPolicy())
     {
         reSetRunTest();
         report += policy.reportAdversary(policy.updatePolicy());
         bool result = singleSamplingTest(sml);
         string st = result ? "Hypothesis Accepted!" : "Hypothesis Rejected!";
         report += "\nSingle Sampling Plan Result:\n" + sprtcount + "/" + sprttotal + "\n" + st;
         if (!result) return false;
     }
     return true;
 }
        //Verify DTMC: SPRT
        public bool verifyMDPSPRT(Simulation sml, Policy policy, out string report)
        {
            report = null;
            policy.reSetPlan();
            while (policy.hasPolicy())
            {
                reSetRunTest();
                report += policy.reportAdversary(policy.updatePolicy());
                bool result = sequentialProbRatioTest(sml);

             // following two statements only used for
                string st = result ? "Hypothesis Accepted!" : "Hypothesis Rejected!";
                report += "\nSeqential Ration Plan Result:\n" + sprtcount + "/" + sprttotal + "\n" + st;
                if (!result) return false;
            }
            return true;
        }