Пример #1
0
        public List <Voertuig> CreateConfiguration(TransportOpdracht rt)
        {
            List <Voertuig> combos = new List <Voertuig>();

            foreach (Voertuig trekker in wagenpark.Where(v => v.HeeftMotor))
            {
                Combinatie combo = new Combinatie();
                combo.Combine(trekker);
                Combinatie beste;
                foreach (Voertuig oplegger in wagenpark.Where(v => v.LaadMeters > 0).OrderByDescending(v => v.LaadMeters))
                {
                    combo.Combine(oplegger);
                    float prijs = combo.BerekenKosten(rt.Afstand);
                }
            }

            return(combos);
        }
Пример #2
0
        static void Main(string[] args)
        {
            PopulateLocations();
            PopulateVehicles();
            TransportOpdracht to = new TransportOpdracht();

            to.Locaties.Add(locaties.First());
            to.Locaties.Add(locaties.Last());
            to.Lading = 200;

            Console.WriteLine(to.Afstand);

            TruckConfiguration tconf    = new TruckConfiguration();
            List <Voertuig>    cheapest = tconf.CreateConfiguration(to);

            Console.WriteLine("De goedkoopste combo is:");
            foreach (Voertuig v in cheapest)
            {
                Console.Write($"[{v.BerekenKosten(to.Afstand)}] ");
                v.ShowInfo();
            }
        }