Ejemplo n.º 1
0
        private static void LoadMobiles()
        {
            //下面这段代码不知道干嘛的
            if (--SimController.iCarCount > 0)
            {
                int iLane = 0;                // iCarCount % 3;
                //新建一条路由
                EdgeRoute route = new EdgeRoute();
                route.Add(SimController.ReA1);
                //添加节点—fis
                route.Add(SimController.ReA2);
//							erA.Add(SimController.ReA3);
//							erA.Add(SimController.ReA4);
                //设置每段路走哪条路
                Lane startLane = SimController.ReA1.Lanes[iLane];

                startLane.EnterInn(MobileSimulator.MakeMobile(route, startLane));

                //Lane r2 = SimController.ReB.Lanes[iLane];
                //为每个原包选择出行路由
                //	rA.EnterWaitedQueue(SubSys_SimDriving.TrafficModel.MobileSimulator.MakeCell(erA));
                //r2.EnterWaitedQueue(SubSys_SimDriving.TrafficModel.CarSimulator.MakeCell(er));
            }
        }
Ejemplo n.º 2
0
        private static void LoadMobiles()
        {
            IRoadNet inet = RoadNet.GetInstance();
            Way      way  = null;//= new Way(;

            foreach (var item in inet.Ways)
            {
                way = item;
            }
            Lane startLane = way.Lanes[0];
            int  i         = SimController.iMobileCount;

            while (i-- > 0)
            {
                //新建一条路由
                EdgeRoute route = new EdgeRoute();
                //设置每段路走哪条路
                route.Add(way);
                var car = MobileFactory.BuildSmallCar();
                car.Route = route;
                startLane.EnterInn(car);
            }
        }