Exemple #1
0
        public void Test_Detect_No_Person()
        {
            List <Measurement> floorData = new List <Measurement>();
            List <Measurement> doorData  = new List <Measurement>();

            doorData.Add(new Measurement {
                StartDate = DateTime.Now.AddSeconds(-10), EndDate = DateTime.Now.AddSeconds(-7)
            });
            floorData.Add(new Measurement {
                StartDate = DateTime.Now.AddSeconds(-2), EndDate = DateTime.Now.AddSeconds(-1)
            });
            floorData.Add(new Measurement {
                StartDate = DateTime.Now.AddSeconds(-18), EndDate = DateTime.Now.AddSeconds(-15)
            });

            ITask job = new InferenceLogicExperimented(floorData, doorData);

            job.Work();

            Thread.Sleep(100);

            var inferenceList = job.Done();

            Assert.AreEqual(1, inferenceList.Count);
            Assert.AreEqual(0, Int32.Parse(inferenceList[0].Count));
        }
        public override void ModelData1()
        {
            //ITask doInferenceBetweenDoorAndFloorData = new InferenceLogicNaive(floorMeasurements, doorMeasurements);
            ITask doInferenceBetweenDoorAndFloorData = new InferenceLogicExperimented(floorMeasurements, doorMeasurements);

            doInferenceBetweenDoorAndFloorData.Work();
            inferredMeasurements = doInferenceBetweenDoorAndFloorData.Done();

            ITask cryptoSensitiveData = new CryptoSensitiveData(inferredMeasurements, new RijndaelManaged());

            cryptoSensitiveData.Work();
            inferredMeasurements = cryptoSensitiveData.Done();
        }
Exemple #3
0
        public void Test_Detect_One_Person_In_And_Out()
        {
            List <Measurement> floorData = new List <Measurement>();
            List <Measurement> doorData  = new List <Measurement>();

            doorData.Add(new Measurement {
                StartDate = DateTime.Now.AddSeconds(-30), EndDate = DateTime.Now.AddSeconds(-25)
            });
            floorData.Add(new Measurement {
                StartDate = DateTime.Now.AddSeconds(-31), EndDate = DateTime.Now.AddSeconds(-28)
            });

            doorData.Add(new Measurement {
                StartDate = DateTime.Now.AddSeconds(-20), EndDate = DateTime.Now.AddSeconds(-14)
            });
            floorData.Add(new Measurement {
                StartDate = DateTime.Now.AddSeconds(-16), EndDate = DateTime.Now.AddSeconds(-14)
            });

            doorData.Add(new Measurement {
                StartDate = DateTime.Now.AddSeconds(-10), EndDate = DateTime.Now
            });
            floorData.Add(new Measurement {
                StartDate = DateTime.Now.AddSeconds(-8), EndDate = DateTime.Now.AddSeconds(-6)
            });
            floorData.Add(new Measurement {
                StartDate = DateTime.Now.AddSeconds(-4), EndDate = DateTime.Now.AddSeconds(-2)
            });

            ITask job = new InferenceLogicExperimented(floorData, doorData);

            job.Work();

            Thread.Sleep(100);

            var inferenceList = job.Done();

            Assert.AreEqual(3, inferenceList.Count);
            Assert.AreEqual(-1, Int32.Parse(inferenceList[0].Count));
            Assert.AreEqual(1, Int32.Parse(inferenceList[1].Count));
            Assert.AreEqual(-2, Int32.Parse(inferenceList[2].Count));
        }