public bool HaveSthSimilar(ProductsSet other)
 {
     for (int i = 0; i < Simulation.ProductsCount; i++)
     {
         if (Items[i] > 0 && other.Items[i] > 0)
         {
             return true;
         }
     }
     return false;
 }
 public bool HaveSthSimilar(ProductsSet other)
 {
     for (int i = 0; i < Simulation.ProductsCount; i++)
     {
         if (Items[i] > 0 && other.Items[i] > 0)
         {
             return(true);
         }
     }
     return(false);
 }
 public static Warehouse findCLosestWarehouse(List<Warehouse> ww, IntVector2 v, ProductsSet set)
 {
     int minDst = int.MaxValue;
     Warehouse reslt = null;
     for (int i = 0; i < Warehouses.Count; i++)
     {
         if (ww[i].Set.HaveSthSimilar(set))
         {
             int dst = (int)Math.Ceiling(ww[i].Pos.Distance(v));
             if (dst < minDst)
             {
                 reslt = Warehouses[i];
                 minDst = dst;
             }
         }
     }
     return reslt;
 }
 public Warehouse(int Xloc, int Yloc, int ide)
 {
     Set = new ProductsSet();
     Pos = new IntVector2(Xloc, Yloc);
     id = ide;
 }
Beispiel #5
0
 public Warehouse(int Xloc, int Yloc, int ide)
 {
     Set = new ProductsSet();
     Pos = new IntVector2(Xloc, Yloc);
     id  = ide;
 }
Beispiel #6
0
 public Drone(int ide)
 {
     Set = new ProductsSet();
     id  = ide;
 }
        public static Warehouse findCLosestWarehouse(List <Warehouse> ww, IntVector2 v, ProductsSet set)
        {
            int       minDst = int.MaxValue;
            Warehouse reslt  = null;

            for (int i = 0; i < Warehouses.Count; i++)
            {
                if (ww[i].Set.HaveSthSimilar(set))
                {
                    int dst = (int)Math.Ceiling(ww[i].Pos.Distance(v));
                    if (dst < minDst)
                    {
                        reslt  = Warehouses[i];
                        minDst = dst;
                    }
                }
            }
            return(reslt);
        }
Beispiel #8
0
 public Order(int id, IntVector2 destination)
 {
     ID           = id;
     _destination = destination;
     Set          = new ProductsSet();
 }
Beispiel #9
0
 public Drone(int ide)
 {
     Set = new ProductsSet();
     id = ide;
 }