Ejemplo n.º 1
0
 private void GenerateEnvironment()
 {
     this.m_NewEnvironment = new TrafficEnvironment(this.txtName.Text.Trim());
     for (int i = 0; i < (this.gridEnvrionmentModel.Rows.Count - 1); i++)
     {
         string userName = this.gridEnvrionmentModel.Rows[i].Cells["user"].Value.ToString();
         string mobName = this.gridEnvrionmentModel.Rows[i].Cells["mobility"].Value.ToString();
         UserMobilityBinding item = new UserMobilityBinding();
         item.UserProfile = this.m_EnvControl.FindUserProfileByName(userName);
         item.Mobility = this.m_EnvControl.FindMobilityByName(mobName);
         item.Density = float.Parse(this.gridEnvrionmentModel.Rows[i].Cells["density"].Value.ToString());
         this.m_NewEnvironment.UserDatas.Add(item);
     }
 }
Ejemplo n.º 2
0
 private void UserObjectGen(UserMobilityBinding umb, ServiceUsage svcUsg, LinkType linkType, int usrCnt)
 {
     for (int i = 0; i < usrCnt; i++)
     {
         User user = new User(umb.Mobility, svcUsg.Service, svcUsg.Terminal, linkType, umb.UserProfile.Priority);
         this.GenUserXY(user);
         user.Clutter = new ClutterInfo(-1, TrafficMapResource.TRAFFICMAP_NAME_BLANK);
         user.UserProfile = umb.UserProfile.Name;
         this.m_UserCollection.Add(user);
     }
 }
Ejemplo n.º 3
0
 private void UserMobilityReader(UserMobilityBinding umb, bool isFixure)
 {          
     PolygonUserCalculator calculator = new PolygonUserCalculator(this.m_Poly, umb.Density, this.m_ScalingFactor, !isFixure);
     foreach (ServiceUsage usage in umb.UserProfile.ServiceDemand)
     {
         UserNumber number = calculator.CalculateUserPerService(usage);
         this.UserObjectGen(umb, usage, LinkType.Uplink, number.ULUsersNumber);
         this.UserObjectGen(umb, usage, LinkType.Downlink, number.DLUsersNumber);
     }
 }
Ejemplo n.º 4
0
        private void UserMobilityReader(int index,UserMobilityBinding umb, bool isFixure)
        {
            int i, count;
            UserProfile u = new UserProfile();
            u.CopyFrom(umb.m_UserProfile);
            count = u.ServiceDemand.Count;
            if (index == 0)
            {
                for (i = 0; i < count; i++)
                {
                    foreach (ServiceUsage usage in u.ServiceDemand)
                    {
                        if (usage.Service.Name.Substring(0, 3) != "FDD")
                        {
                            u.ServiceDemand.Remove(usage);
                            break;
                        }
                    }
                }

            }
            else if (index == 1)
            {
                for (i = 0; i < count; i++)
                {
                    foreach (ServiceUsage usage in u.ServiceDemand)
                    {
                        if (usage.Service.Name.Substring(0, 3) != "TDD")
                        {
                            u.ServiceDemand.Remove(usage);
                            break;
                        }
                    }
                }
            }
            else
            {
                for (i = 0; i < count; i++)
                {
                    foreach (ServiceUsage usage in u.ServiceDemand)
                    {
                        if (usage.Service.Name.Substring(0, 2) != "E-")
                        {
                            u.ServiceDemand.Remove(usage);
                            break;
                        }
                    }
                }
            }
           

            PolygonUserCalculator calculator = new PolygonUserCalculator(this.m_Poly, umb.Density, this.m_ScalingFactor, !isFixure);
            foreach (ServiceUsage usage in u.ServiceDemand)
            {
                UserNumber number = calculator.CalculateUserPerService(usage);
                this.UserObjectGen(umb, usage, LinkType.Uplink, number.ULUsersNumber);
                this.UserObjectGen(umb, usage, LinkType.Downlink, number.DLUsersNumber);
            }
        }
Ejemplo n.º 5
0
 private void generateEnvironmentList()
 {
     this.m_envName = new List<string>();
     foreach (string text in this.m_EnvSelectedDis)
     {
         this.m_envName.Add(text);
         this.m_EvnManagement.FindEnvironmentByName(text).UserDatas.Clear();
     }
     for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
     {
         TrafficEnvironment item;
         string environemntName = this.dataGridView1.Rows[i].Cells["EnvItem"].Value.ToString();
         string useProfileName = this.dataGridView1.Rows[i].Cells["UserProfiles"].Value.ToString();
         string name = this.dataGridView1.Rows[i].Cells["Mobility"].Value.ToString();
         float result = 0f;
         float.TryParse(this.dataGridView1.Rows[i].Cells["Density"].Value.ToString(), out result);
         bool flag = true;
         UserMobilityBinding binding = new UserMobilityBinding();
         binding.Mobility = this.m_MobilityManagemet.FindMobilityByName(name);
         binding.UserProfile = this.m_UserProfileManagement.FindUserProfileByName(useProfileName);
         binding.Density = result;
         if (this.m_EvnManagement.FindEnvironmentByName(environemntName) != null)
         {
             item = this.m_EvnManagement.FindEnvironmentByName(environemntName);
             foreach (UserMobilityBinding binding2 in item.UserDatas)
             {
                 if ((binding2.UserProfile.Name == binding.UserProfile.Name) && (binding2.Mobility.Name == binding.Mobility.Name))
                 {
                     flag = false;
                 }
             }
             if (flag)
             {
                 item.UserDatas.Add(binding);
             }
         }
         else
         {
             item = new TrafficEnvironment();
             item.Name = environemntName;
             item.UserDatas = new List<UserMobilityBinding>();
             item.UserDatas.Add(binding);
             this.m_EvnManagement.EnviromentList.Add(item);
             this.changeEnvironmentNode(environemntName);
         }
     }
     this.SaveClutterData();
 }