Ejemplo n.º 1
0
 public UserCollection Generate(EnvTrafficMap map,int index, int scalingFactor, bool isFixure)
 {
     ITrafficMapModelService service = map.ServiceContext.Lookup(typeof(ITrafficMapModelService).FullName) as ITrafficMapModelService;
     IGeoPolygonAssist polygonRegionAssist = service.PolygonRegionAssist;
     this.InitRandom(isFixure);
     this.m_UserCollection = new UserCollection();
     this.m_ScalingFactor = scalingFactor;
     foreach (GeoPolygonRegion region in map.PolygonRegionList)
     {
         try
         {
             this.m_Poly = this.getActuralPolyonRegion(polygonRegionAssist, region);
             this.m_Rect = this.m_Poly.GetMiniEnclosingRect();
             foreach (UserMobilityBinding binding in map.PolygonEnvironmentBindings[region].UserDatas)
             {
                 this.UserMobilityReader(index,binding, isFixure);
             }
         }
         catch (Exception exception)
         {
             WriteLog.Logger.Error(region.Name + " is not exist" + exception.Message);
         }
     }
     this.setUserIDProperty();
     return this.m_UserCollection;
 }
Ejemplo n.º 2
0
 public UserCollection Generate(int index, EnvTrafficMap map, int scalingFactor, bool isFixure)
 {
     this.m_UserCollection = new UserCollection();
     ITrafficMapModelService service = this.ServiceContext.Lookup(typeof(ITrafficMapModelService).FullName) as ITrafficMapModelService;
     IGeoPolygonAssist polygonRegionAssist = service.PolygonRegionAssist;
     foreach (GeoPolygonRegion region in map.PolygonEnvironmentBindings.Keys)
     {
         try
         {
             GeoPolygonRegion poly = this.getActuralPolyonRegion(polygonRegionAssist, region);
             this.m_PolyClutterMapping = new MapClutterHelper(poly, polygonRegionAssist, map.PolygonEnvironmentBindings[region].ClutterDatas, this.ServiceContext, isFixure);
             this.m_UserCoordinateGen = new EnvUserCoordinateGen(index,poly, map.PolygonEnvironmentBindings[region], this.m_PolyClutterMapping, scalingFactor, isFixure, this.ServiceContext);
             this.GenerateUsersByClutters();
         }
         catch (Exception exception)
         {
             WriteLog.Logger.Error(region.Name + " is not exist or" + exception.StackTrace);
         }
     }
     this.IndexUsersId(this.m_UserCollection);
     return this.m_UserCollection;
 }