コード例 #1
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;
            }
        }
コード例 #2
0
 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;
     }
 }