public override PullDecision PullUnitload(Queue queueIn, UnitloadList unitloadListIn) { PullDecision decision = new PullDecision(); //First blocked first served foreach (Unitload unit in unitloadListIn) { if (unit.Station.InQueue == queueIn) { decision.Unitload = unit; decision.InQueue = unit.Station.InQueue; return(decision); //first one added to blocked list is found, break } } return(null); }
//ProcessorSelectionAlgorithm public void Execute() { this.PreOperation(); QueueList queueList = this.Manager.LayoutManager.QueuesToPull; UnitloadList unitloadList = this.Manager.JobManager.BlockedUnitloads; foreach (Queue queue in queueList) { while (queue.IsAvailable == true) { PullDecision decision = this.PullUnitload(queue, unitloadList); if (decision == null) { break; } else { Processor ProcessorToRelease = ((Processor)decision.Unitload.Location); Unitload unitloadToGo = decision.Unitload; //int transferTime = this.Manager.LayoutManager.Layout.DistanceMatrix[(Station)ProcessorToRelease.Parent, unitloadToGo.Station]; ie486f18 int transferTime = 1; queue.Reserved++; unitloadToGo.InTransfer = true; this.Manager.LayoutManager.Layout.UnitloadsOnMover.Add(unitloadToGo); //geldiği processorün/inqueuecellin queusunun blockedı açılacak. (Release) ProcessorToRelease.Release(this.Manager.Time, unitloadToGo); ProcessorToRelease.ChangeBlocked(this.Manager.Time, false); this.Manager.TriggerStationControllerAlgorithm((Station)ProcessorToRelease.Parent); this.Manager.EventCalendar.ScheduleEnterQueueEvent(this.Manager.Time + transferTime, queue, unitloadToGo); unitloadList.Remove(unitloadToGo); } } } queueList.Clear(); this.PostOperation(); }