protected MobileOBJ() { this._entityID = ++TrafficOBJ.EntityCounter; this.Route = new EdgeRoute(); this.iSpeed = 0; this.iAcceleration = 1; }
private void PreapareRouteForSourceModules(EdgeRoute route, IEnumerable <EdgeMessagePipelineModule> finalModulesOfAgent, IEnumerable <EdgeMessagePipelineModule> sourceModulesOfRoute, IDictionary <string, string> routesForTemplate) { foreach (var sourceModuleOfRoute in sourceModulesOfRoute) { PreapareRouteForTargetModules(route.TargetModules, finalModulesOfAgent, sourceModuleOfRoute, routesForTemplate); } }
//--------------------------20160131-------------------------------------- public static MobileEntity MakeMobile(EdgeRoute route, StaticEntity container) { SmallCar mobile = new SmallCar(container); mobile.Color = MobileSimulator.GetRandomColor(); //mobile.Color = Color.Red; mobile.Route = route; mobile.Container = container; return(mobile); }
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); } }
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)); } }
protected MobileOBJ(StaticOBJ bornContainer) { this._entityID = ++TrafficOBJ.EntityCounter; this.Route = new EdgeRoute(); this._container = bornContainer; }