Exemplo n.º 1
0
        public void AddToQueue()
        {
            DetailPos current = new DetailPos
            {
                Index     = CurrentDetail.Index,
                StartTime = CurrentDetail.StartTimes[CurrentDetail.OpNumber],
                Duration  = CurrentDetail.CurrentDuration
            };

            DetailPos last = DetailQueue.LastOrDefault() ?? new DetailPos {
                Index = -1, Duration = 0, StartTime = 0
            };

            float idleDuration = current.StartTime - (last.StartTime + last.Duration);

            if (idleDuration > 0.01)
            {
                DetailPos idle = new DetailPos
                {
                    Index     = 0,
                    StartTime = last.StartTime + last.Duration,
                    Duration  = idleDuration
                };
                DetailQueue.Add(idle);
            }
            DetailQueue.Add(current);
        }
Exemplo n.º 2
0
        public void AddToQueue(DetailPos dp, FMM currentModule)
        {
            if (dp.Index != 15)
            {
                float     time = dp.StartTime;
                DetailPos last = DetailQueue.LastOrDefault() ?? new DetailPos {
                    Index = -1, Duration = 0, StartTime = 0
                };
                dp.StartTime = Math.Max(EndTime, currentModule.CurrentDetail.CurrentEndTime - currentModule.CurrentDetail.CurrentDuration);
                float idleDuration = dp.StartTime - (last.StartTime + last.Duration);
                if (idleDuration > 0.01)
                {
                    DetailPos idle = new DetailPos
                    {
                        Index     = 0,
                        StartTime = last.StartTime + last.Duration,
                        Duration  = idleDuration
                    };
                    DetailQueue.Add(idle);
                }
                DetailQueue.Add(dp);


                currentModule.CurrentDetail.CurrentEndTime += dp.Duration + EndTime - (time - currentModule.CurrentDetail.CurrentDuration);
                EndTime = currentModule.CurrentDetail.CurrentEndTime - currentModule.CurrentDetail.CurrentDuration + idleDuration;
            }
            else
            {
                DetailQueue.Add(dp);
                EndTime += dp.Duration;
            }
        }
Exemplo n.º 3
0
        public float ResolveTransport(FMM module, float time, out float transportTime)
        {
            bool linearFlag = false;

            int to    = module.Index,
                @from = module.CurrentDetail.OpNumber == 0
                ? 0
                : module.CurrentDetail.Route[module.CurrentDetail.OpNumber - 1].Index;
            int routeLength = TransportLengths[@from, to];

            if (to == 6 || to == 5)
            {
                linearFlag = true;
            }
            if (to == 4 || to == 3)
            {
                linearFlag = true;
            }

            transportTime = Tpid * routeLength + Tpost;
            if (to == 0)
            {
                transportTime += Tpost;
            }
            else
            {
                transportTime += Tz;
            }
            if (linearFlag)
            {
                transportTime += Tvz + Tpost;
            }
            if (@from == 0)
            {
                transportTime += Tvz;
            }
            else
            {
                transportTime += Tr;
            }

            DetailPos current, idle, linearPos, linearIdle;

            switch (to)
            {
            case 3:
                current = new DetailPos
                {
                    Index     = module.CurrentDetail.Index,
                    StartTime = time,
                    Duration  = transportTime - Tvz - Tz
                };
                //module.CurrentDetail.StartTimes[module.CurrentDetail.OpNumber] += transportTime;
                Atm1.AddToQueue(current, module);

                idle = new DetailPos
                {
                    Index     = 15,
                    StartTime = current.StartTime + current.Duration,
                    Duration  = Tpid * routeLength
                };
                Atm1.AddToQueue(idle, module);

                linearPos = new DetailPos
                {
                    Index     = module.CurrentDetail.Index,
                    StartTime = current.StartTime + current.Duration,
                    Duration  = Tvz + Tz
                };
                Atm2.AddToQueue(linearPos, module);

                break;

            case 4:
                current = new DetailPos
                {
                    Index     = module.CurrentDetail.Index,
                    StartTime = time,
                    Duration  = transportTime - Tvz - Tz
                };
                //module.CurrentDetail.StartTimes[module.CurrentDetail.OpNumber] += transportTime;
                Atm1.AddToQueue(current, module);

                idle = new DetailPos
                {
                    Index     = 15,
                    StartTime = current.StartTime + current.Duration,
                    Duration  = Tpid * routeLength
                };
                Atm1.AddToQueue(idle, module);

                linearPos = new DetailPos
                {
                    Index     = module.CurrentDetail.Index,
                    StartTime = current.StartTime + current.Duration,
                    Duration  = Tvz + Tz
                };
                Atm3.AddToQueue(linearPos, module);

                break;

            case 5:
                current = new DetailPos
                {
                    Index     = module.CurrentDetail.Index,
                    StartTime = time,
                    Duration  = transportTime - Tvz - Tz - Tpid
                };
                //module.CurrentDetail.StartTimes[module.CurrentDetail.OpNumber] += transportTime - Tvz - Tz - Tpid;
                Atm1.AddToQueue(current, module);

                idle = new DetailPos
                {
                    Index     = 15,
                    StartTime = current.StartTime + current.Duration,
                    Duration  = Tpid * (routeLength - 1)
                };
                Atm1.AddToQueue(idle, module);

                linearPos = new DetailPos
                {
                    Index     = module.CurrentDetail.Index,
                    StartTime = current.StartTime + current.Duration,
                    Duration  = Tvz + Tz + Tpid
                };
                Atm3.AddToQueue(linearPos, module);

                linearIdle = new DetailPos
                {
                    Index     = 15,
                    StartTime = linearPos.StartTime + linearPos.Duration,
                    Duration  = Tpid
                };
                Atm3.AddToQueue(linearIdle, module);
                break;

            case 6:
                current = new DetailPos
                {
                    Index     = module.CurrentDetail.Index,
                    StartTime = time,
                    Duration  = transportTime - Tvz - Tz - Tpid
                };
                //module.CurrentDetail.StartTimes[module.CurrentDetail.OpNumber] += transportTime - Tvz - Tz - Tpid;
                Atm1.AddToQueue(current, module);

                idle = new DetailPos
                {
                    Index     = 15,
                    StartTime = current.StartTime + current.Duration,
                    Duration  = Tpid * (routeLength - 1)
                };
                Atm1.AddToQueue(idle, module);

                linearPos = new DetailPos
                {
                    Index     = module.CurrentDetail.Index,
                    StartTime = current.StartTime + current.Duration,
                    Duration  = Tvz + Tz + Tpid
                };
                Atm2.AddToQueue(linearPos, module);

                linearIdle = new DetailPos
                {
                    Index     = 15,
                    StartTime = linearPos.StartTime + linearPos.Duration,
                    Duration  = Tpid
                };
                Atm2.AddToQueue(linearIdle, module);

                break;

            case 0:
                break;

            default:
                current = new DetailPos
                {
                    Index     = module.CurrentDetail.Index,
                    StartTime = time,
                    Duration  = transportTime
                };
                //module.CurrentDetail.StartTimes[module.CurrentDetail.OpNumber] += transportTime - Tvz - Tz - Tpid;
                Atm1.AddToQueue(current, module);
                idle = new DetailPos
                {
                    Index     = 15,
                    StartTime = current.StartTime + current.Duration,
                    Duration  = Tpid * routeLength
                };
                Atm1.AddToQueue(idle, module);

                break;
            }

            return(module.CurrentDetail.CurrentEndTime - module.CurrentDetail.CurrentDuration);
        }