Esempio n. 1
0
        public void BulidWay(WaySetter ws)
        {
            IRoadNet inet = RoadNet.GetInstance();

            Way            = inet.BuildWay(this.Shape.Start, this.Shape.End);
            Way.Name       = ws.TBWayName.Text + Way.ID.ToString();
            Way.TrueLength = (double)ws.TBLength.Value;
            ///先创建一个车道做测试
            int iLaneCount = System.Convert.ToInt32(ws.TBLaneCount.Value);

            Way.AddLane(LaneType.All);
            Way.Shape = EntityShape.CreateShape(this.shape);
        }
Esempio 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);
            }
        }
Esempio n. 3
0
        private void ShowDebugMessage()
        {
            DebugShower ds   = new DebugShower();
            IRoadNet    inet = RoadNet.GetInstance();

            List <string> list = new List <string>();

            foreach (var item in inet.Ways)
            {
                list.Add(item.Name);
            }
            ds.LB_LaneNuber.DataSource = list;

            List <string> listLane = new List <string>();

            foreach (var item in inet.Lanes)
            {
                listLane.Add(item.Name + item.Shape.Count.ToString());
            }

            ds.LB_LaneShape.DataSource = listLane;//.lane.Lanes;// as Dictionary<int, lane>;
            SplitMain.Panel2.Controls.Add(ds);
            ds.Show();
        }