Ejemplo n.º 1
0
 /// <summary>
 /// 构建TD用户
 /// </summary>
 /// <param name="index"></param>
 /// <param name="tfMatrix"></param>
 /// <param name="pg"></param>
 /// <returns></returns>
 public User ConstructUser(int index, TrueFalseMatrix tfMatrix)
 {
     User user = new User();
     user.X = tfMatrix.GetXYPoint(index).X;
     user.Y = tfMatrix.GetXYPoint(index).Y;
     user.Terminal = m_Terminal;
     user.Service = m_Service;
     return user;
 }
Ejemplo n.º 2
0
        public void ConstructTFMatrixTest()
        {
            GeoPolygonRegion region = CreatRegion(); // TODO: 初始化为适当的值
            float resolution = 50F; // TODO: 初始化为适当的值
            TrueFalseMatrix expected = new TrueFalseMatrix(70,56,1000,4500,50,true); // TODO: 初始化为适当的值
            TrueFalseMatrix actual=FuctionAssistant.ConstructTFMatrix(region,resolution);
            GeoXYPoint expectedPoint,actualPoint;
            for (int i = 0; i < actual.TotalCount;i++ )
            {
                expectedPoint = expected.GetXYPoint(i);
                actualPoint = actual.GetXYPoint(i);
                Assert.AreEqual(expectedPoint.X, actualPoint.X);
                Assert.AreEqual(expectedPoint.Y, actualPoint.Y);
            }

            Assert.IsTrue(actual[80]);
            Assert.IsTrue(actual[actual.TotalCount / 2-28]);
            Assert.IsFalse(actual[actual.TotalCount-11]);
            //Assert.IsFalse();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 构建用户
 /// </summary>
 /// <param name="index"></param>
 /// <param name="tfMatrix"></param>
 /// <param name="pg"></param>
 /// <returns></returns>
 private static User ConstructionUser(int index, TrueFalseMatrix tfMatrix, TDPredictionGroup pg)
 {
     User user = new User();
     user.X = tfMatrix.GetXYPoint(index).X;
     user.Y = tfMatrix.GetXYPoint(index).Y;
     user.Terminal = pg.TrafficTerminal;
     user.Service = pg.TrafficService;
     return user;
 }