Пример #1
0
 public Trip(int storeNum, string orderDate, int count, TemperatureZone temp)//change to picks
 {
     TripId          = storeNum.ToString() + ":" + orderDate + ":" + temp.ToString() + ":" + count.ToString();
     temperatureZone = temp;
     StandardTime    = standardTime();
     CubicFeet       = Cfeet(Picks);
 }
Пример #2
0
 public Product(string name, string company, TemperatureZone zone, double height, double width, double weight)
 {
     Name    = name;
     Zone    = zone;
     Company = company;
     Height  = height;
     Width   = width;
     Weight  = weight;
 }
Пример #3
0
 public Layout(int horizontal, int vertical, TemperatureZone zone)
 {
     for (int i = 0; i <= horizontal; i++)
     {
         List <Coordinate> column = new List <Coordinate>();
         for (int j = 0; j <= vertical; j++)
         {
             Coordinate coordinate = new Coordinate(j, i);
             column.Add(coordinate);
         }
         Columns.Add(column);
     }
     Zone = zone;
 }
Пример #4
0
 public Product(string name, string company, TemperatureZone zone, double height, double width, double weight)
 {
     Name    = name;
     Zone    = zone;
     Company = company;
     Height  = height;
     Width   = width;
     Weight  = weight;
     if ((Weight * AdminControls.HollowControl) <= CubicFeet && !isHeavy)
     {
         isHollow = true;
     }
     if (Weight >= AdminControls.HeavyControl)
     {
         isHeavy = true;
     }                                                            //change both of these to stored vairables that can be changed by the admin without having to change code
 }
Пример #5
0
 public void AddAisle(string AisleName, TemperatureZone zone, int length, int height)//Add Aisle to current warehouse object//this isn't working correctly
 {
     foreach (Slot s in WHctx.Slots)
     {
         if (s.AisleName != AisleName)
         {
             continue;
         }
         else
         {
             throw new Exception("there is an aisle with that name already, would you like to add to it?");
         }
     }
     for (int i = 0; i < length; i++)
     {
     }
     WHctx.SaveChanges();
 }
Пример #6
0
 public void AddAisle(string AisleName, TemperatureZone zone, int length, int height)//Add Aisle to current warehouse object//this isn't working correctly
 {
     WHctx.SaveChanges();
 }
Пример #7
0
 public IEnumerable <Layout> DisplayAislesByTemperature(TemperatureZone z)//reduces view to temperature zones//change this to map
 {
     return(WHctx.Layouts.Where(c => c.Zone == z));
 }
Пример #8
0
        public List <Trip> TripsBreakdown(List <Pick> picks, int StoreNum, double Max, string orderDate, TemperatureZone zone)
        {
            int         tripcount = 1;
            Trip        first     = new Trip(StoreNum, orderDate, tripcount, zone);
            List <Trip> trips     = new List <Trip>();

            trips.Add(first);

            double HollowControl = AdminControls.HollowControl; // don't want to put hollow cases on trips early
            double HeavyControl  = AdminControls.HeavyControl;  // don't want people lifting heavy cases above certain height in a trip

            List <Pick> Heavies = new List <Pick>();
            List <Pick> Hollows = new List <Pick>();

            foreach (Pick p in picks)
            {
                if (trips.Last().Picks is null || trips.Last().CubicFeet + p.CubicFeet <= Max)
                {
                    while (Heavies.Count() > 0 && trips.Last().CubicFeet <= HeavyControl)
                    {
                        trips.Last().Picks.Add(Heavies.Last());
                        Heavies.Remove(Heavies.Last());
                    }
                    while (Hollows.Count > 0 && trips.Last().CubicFeet >= HollowControl && trips.Last().CubicFeet <= Max)
                    {
                        trips.Last().Picks.Add(Hollows.Last());
                        Heavies.Remove(Hollows.Last());
                    }
                }
Пример #9
0
        private Biome DetermineBiome(TemperatureZone zone, Biome[] surroundingBiomes)
        {
            // Ice, Tundra, and Taiga should be more near the vertical extremes of our square world (the poles) zone 2

            // Temparate Forest and Grassland should be inbetween the top and middle (between poles and equator) zone 1

            // Desert, Tropical Rainforest, and Savanna should be near the middle (equator) zone 0

            // Oceans should appear in large amounts surrounding landmasses in any zone
            // Freshwater should be in smaller amounts but can appear anywhere in the form of a lake or river
            // rivers should flow from lakes to oceans
            float[] weights;

            switch (zone)
            {
            case TemperatureZone.Cold:
                weights = ColdWeights;
                break;

            case TemperatureZone.Temparate:
                weights = TemparateWeights;
                break;

            case TemperatureZone.Warm:
                weights = WarmWeights;
                break;

            default:
                throw new FormatException("Zone out of range!");
            }


            for (int i = 0; i < 4; i++)
            {
                Biome b = surroundingBiomes[i];
                if (b > 0)
                { // we don't want undetermined zones being populated
                    if (weights[(int)b] == 0.0f)
                    {
                        weights[(int)b] = 10f;                          // adds chance for biomes to cross temperature zones if there are neighboring zones
                    }
                    if (b == Biome.Marine)
                    {
                        weights[(int)b] *= stickiness * 2; // for each surrounding neighbor increase weight
                    }
                    else
                    {
                        weights[(int)b]            *= stickiness;
                        weights[(int)Biome.Marine] /= 100f;
                    }
                }
            }

            // Get Total Weight
            float totalWeight = 0.0f;

            foreach (float weight in weights)
            {
                totalWeight += weight;
            }

            // Generate a random number based on the totalWeight
            float randomNumber = (float)random.NextDouble() * totalWeight;

            // using the random number and weights determine which biome to return
            Biome selectedBiome = Biome.Undetermined;

            for (int i = 0; i < weights.Length; i++)
            {
                float weight = weights[i];
                if (randomNumber < weight)
                {
                    selectedBiome = (Biome)i;
                    break;
                }

                randomNumber -= weight;
            }

            return(selectedBiome);
        }
Пример #10
0
 public void AddSlot(string AisleName, TemperatureZone zone, SlotType slotType)//add empty slot to end of aisle object
 {
     WHctx.SaveChanges();
 }