Ejemplo n.º 1
0
        public override void execute()
        {
            double expectedTime = (lengthOfWay / (car.getSpeed() / 60.0)) + time; // ocakavany cas - kolko autu trava cesta

            // poruchovost
            if (car.hasFailed())
            {
                expectedTime += car.getTimeOfRepair();
            }

            core.materialB += car.getVolume();
            if (core.materialB >= Constants.materialToLoad)
            {
                core.materialB = Constants.materialToLoad;
                return;
            }

            Event arrivalC = new EventArrivalToC(core, expectedTime, car);

            core.updateEventCalendar(arrivalC);

            Vehicle carInFront = core.getFirstBeforeBuilding();

            if (carInFront != null)
            {
                Event unloadStart = new EventUnloadStart(core, time, carInFront);
                core.updateEventCalendar(unloadStart);
            }
            else
            {
                core.unloadMachineWorking = false;
            }
        }
Ejemplo n.º 2
0
        public override void execute()
        {
            double expectedTime = (lengthOfWay / (double)(car.getSpeed() / 60.0)) + time; // ocakavany cas - kolko by autu trava cesta

            expectedTime = core.wayAB.realTime(expectedTime);
            Event arrivalB = new EventArrivalToB(core, expectedTime, car);

            core.updateEventCalendar(arrivalB);

            if (core.materialA <= 0)
            {
                return;
            }

            Vehicle carInFront = core.getFirstBeforeDepo();

            if (carInFront != null)
            {
                Event loadStart = new EventLoadStart(core, time, carInFront);
                core.updateEventCalendar(loadStart);
            }
            else
            {
                core.loadMachineWorking = false;
            }
        }
        public override void execute()
        {
            double expectedTime = (lengthOfWay / (car.getSpeed() / 60.0)) + time; // ocakavany cas - kolko by autu trava cesta

            expectedTime = core.wayCA.realTime(expectedTime);
            Event arrivalA = new EventArrivalToA(core, expectedTime, car);

            core.updateEventCalendar(arrivalA);
        }
        public override void execute()
        {
            // postavia sa do radu
            core.updteListBeforeBuilding(car);
            // nastavi sa im pociatocny cas cakania
            car.setStartOfWaiting(time);
            // ak sa nic nenaklada, pride prve auto na rad

            if (core.unloadMachineWorking == false)
            {
                Event unloadStart = new EventUnloadStart(core, time, core.getFirstBeforeBuilding());
                core.updateEventCalendar(unloadStart);
                core.unloadMachineWorking = true;
            }
        }
 public override void execute()
 {
     // postavia sa do radu
     core.updteListBeforeDepo(car);
     // nastavi sa im pociatocny cas cakania
     car.setStartOfWaiting(time);
     // ak sa nic nenaklada, pride prve auto na rad
     if (core.loadMachineWorking == false)
     {
         if (core.materialA <= 0)
         {
             return;
         }
         Event loadStart = new EventLoadStart(core, time, core.getFirstBeforeDepo());
         core.updateEventCalendar(loadStart);
         core.loadMachineWorking = true;
     }
 }
        public override void execute()
        {
            double volumeToLoad = (core.materialA <= car.getVolume()) ? core.materialA : car.getVolume();

            core.materialA -= volumeToLoad;

            double timeOfLoading = volumeToLoad / speedOfLoading;

            car.realVolume = volumeToLoad;

            core.loadMachineWorking = true;

            car.setEndOfWaitingOnDepo(time);

            Event loadEnd = new EventLoadFinish(core, timeOfLoading + time, car);

            core.updateEventCalendar(loadEnd);
        }
Ejemplo n.º 7
0
        public override void execute()
        {
            // nastavi nakladac ze pracuje
            core.unloadMachineWorking = true;

            // nastavi cas koniec cakania v rade
            car.setEndOfWaitingOnBuilding(time);

            // TO-DO vypocita cas nakladania
            double timeOfUnloading = car.realVolume / speedOfUnloading; // v minutach

            car.realVolume = 0;

            // vytvori koniec nakladania
            Event unloadEnd = new EventUnloadFinish(core, timeOfUnloading + time, car);

            // prida koniec nakladania do kalendata udalosti
            core.updateEventCalendar(unloadEnd);
        }