예제 #1
0
        public void GenerateEmpoyees(Workshop ws)
        {
            var e  = new SeniorWorker("David", 130, 20);
            var e2 = new JuniorWorker("Jesper", 88, 15);
            var e3 = new Intern("Martin", 43, 12);

            ws.Empolyees.Add(e);
            ws.Empolyees.Add(e2);
            ws.Empolyees.Add(e3);
        }
예제 #2
0
 public WorkItem(Workshop ws, Employee employee, Vehicle vehicle, int goal, Customer customer, int id, decimal brokenPartCosts)
 {
     Random          = new Random();
     WorkDone        = 1;
     ID              = id;
     BrokenPartCosts = brokenPartCosts;
     WS              = ws;
     Employee        = employee;
     Vehicle         = vehicle;
     Customer        = customer;
     Goal            = goal;
 }
예제 #3
0
        public List <SparePart> GenerateBrokenParts(Workshop ws)
        {
            List <SparePart> spareParts = new List <SparePart>();
            var tempList            = new List <string>(parts);
            var numberOfBrokenParts = rand.Next(1, 4);

            for (int j = 0; j < numberOfBrokenParts; j++)
            {
                var       index = rand.Next(0, tempList.Count);
                SparePart sp    = new SparePart(parts[index], 20, rand.Next(15, 25), rand.Next(500, 10000), rand.Next(5, 20));
                spareParts.Add(sp);
                tempList.RemoveAt(index);
            }
            return(spareParts);
        }