private void CompareAndBalance()
        {
            var hosts = _commonLoadManager.GetAllHostLoadInfos();
            Dictionary <int, double> pdis = CalculatePropDistributionForAllHosts(hosts);
            Random r = new Random(Guid.NewGuid().GetHashCode());
            List <ContainerToHost> list = new List <ContainerToHost>();

            foreach (var container in ContainerTable.GetAllContainers())
            {
                var k     = r.GetRandomFromDictionary(pdis);
                var cdash = _commonLoadManager.GetHostLoadInfoByHostIdAfterContainer(k, container.GetContainerNeededLoadInfo()).Volume;//Should be after adding the current container
                var c     = LoadManager.GetNeededHostLoadInfo().Volume;
                if (cdash < c)
                {
                    list.Add(new ContainerToHost(container.ContainerId, k, c - cdash));
                }
            }
            if (list.Count == 0)
            {
                return;
            }
            var total = list.Select(x => x.Cost).Sum();

            foreach (var item in list)
            {
                item.Probaility = item.Cost / total;
            }

            var result = r.GetRandomFromContainerToHost(list);

            MigrationContainer(result);
            Busy = true;
        }
 private void UpdateInformation()
 {
     _commonLoadManager.UpdateHostLoadInfo(LoadManager.GetNeededHostLoadInfo());
 }