Exemplo n.º 1
0
            private void GetCostWeights(OplDataHandler handler)
            {
                // initialize the tuple set 'CostFunctionWeights'
                handler.StartElement("CostFunctionWeights");
                handler.StartSet();

                // Add tuple
                handler.StartTuple();
                handler.AddStringItem("a");
                handler.AddNumItem(LithographyArea.WeightA);
                handler.EndTuple();

                // Add tuple
                handler.StartTuple();
                handler.AddStringItem("b");
                handler.AddNumItem(LithographyArea.WeightB);
                handler.EndTuple();

                // Add tuple
                handler.StartTuple();
                handler.AddStringItem("c");
                handler.AddNumItem(LithographyArea.WeightC);
                handler.EndTuple();

                handler.EndSet();
                handler.EndElement();
            }
Exemplo n.º 2
0
        /// <summary>
        /// Reads a table and inject it as a tuple set in OPL.
        /// </summary>
        /// <param name="name">The name of the Data Set</param>
        /// <param name="reader">The SqlDataReader to read from</param>
        private void ReadTupleSet(String name, DbDataReader reader)
        {
            OplDataHandler handler = DataHandler;

            OplElement   element = handler.getElement(name);
            ITupleSchema schema  = element.AsTupleSet().Schema;
            int          size    = schema.Size;

            String[] oplFieldsName = new String[size];
            OplElementDefinitionType.Type[] oplFieldsType = new OplElementDefinitionType.Type[size];

            this.FillNamesAndTypes(schema, oplFieldsName, oplFieldsType);

            handler.StartElement(name);
            handler.StartSet();
            while (reader.Read())
            {
                handler.StartTuple();
                for (int column = 0; column < oplFieldsName.Length; column++)
                {
                    String columnName = oplFieldsName[column];
                    HandleColumnValue(handler, oplFieldsType[column], reader[columnName]);
                }
                handler.EndTuple();
            }
            handler.EndSet();
        }
Exemplo n.º 3
0
            private void GetOrders(OplDataHandler handler)
            {
                // initialize the tuple set 'Products'
                handler.StartElement("Orders");
                handler.StartSet();

                // Loop through queue
                for (int i = 0; i < Queue.Length; i++)
                {
                    // Peek next lot in queue
                    Lot peekLot = Queue.PeekAt(i);

                    bool eligible = false;

                    // Check if elible on any machine (not Down)
                    foreach (Machine machine in LithographyArea.Machines)
                    {
                        // Check if machine is Down
                        if (LithographyArea.MachineStates[machine.Name] == "Down")
                        {
                            continue;
                        }

                        // Get needed recipe for the lot
                        string recipe    = CPDispatcher.GetRecipe(peekLot, machine);
                        string recipeKey = machine.Name + "__" + recipe;

                        // Check if needed recipe is eligible on machine
                        bool recipeEligible = CPDispatcher.CheckMachineEligibility(recipeKey);

                        // Check if processingTime is known
                        bool processingTimeKnown = CPDispatcher.CheckProcessingTimeKnown(peekLot, machine, recipe);

                        if (recipeEligible && processingTimeKnown)
                        {
                            eligible = true;
                            break;
                        }
                    }

                    if (eligible)
                    {
                        // Add tuple
                        handler.StartTuple();
                        handler.AddStringItem(peekLot.Id.ToString()); //handler.AddStringItem(peekLot.Id.ToString());
                        handler.AddIntItem(ProductNameToID[peekLot.MasksetLayer_RecipeStepCluster]);
                        handler.AddIntItem(peekLot.LotQty);

                        handler.AddNumItem(CPDispatcher.GetDueDateWeight(peekLot));
                        handler.AddNumItem(CPDispatcher.GetWIPBalanceWeight(peekLot));

                        handler.EndTuple();
                    }
                }

                handler.EndSet();
                handler.EndElement();
            }
Exemplo n.º 4
0
            private void GetProductAuxResources(OplDataHandler handler)
            {
                // initialize the tuple set 'Products'
                handler.StartElement("ProductAuxResources");
                handler.StartSet();

                List <Lot> allLots = new List <Lot>();

                // Loop through queue
                for (int i = 0; i < Queue.Length; i++)
                {
                    // Peek next lot in queue
                    Lot peekLot = Queue.PeekAt(i);
                    allLots.Add(peekLot);
                }
                foreach (Machine machine in LithographyArea.Machines)
                {
                    if (machine.Queue.Length > 0)
                    {
                        Lot lotAtMachine = machine.Queue.PeekFirst();
                        allLots.Add(lotAtMachine);
                    }
                }

                List <string> productNames = new List <string>();

                // Loop through queue
                foreach (Lot lot in allLots)
                {
                    string productName = lot.MasksetLayer_RecipeStepCluster;

                    if (!productNames.Contains(productName))
                    {
                        // Add tuple
                        handler.StartTuple();
                        handler.AddIntItem(ProductNameToID[productName]);
                        handler.AddStringItem(lot.ReticleID1);
                        handler.EndTuple();

                        // Add tuple
                        handler.StartTuple();
                        handler.AddIntItem(ProductNameToID[productName]);
                        handler.AddStringItem(lot.IrdName);
                        handler.EndTuple();

                        productNames.Add(productName);
                    }
                }

                handler.EndSet();
                handler.EndElement();
            }
Exemplo n.º 5
0
        /// <summary>
        /// Reads a table and inject the value as a Set in OPL.
        /// </summary>
        /// <param name="type">The type of the Set elements</param>
        /// <param name="name">The name of the Set</param>
        /// <param name="reader">The SqlDataReader to read from</param>
        private void ReadSet(OplElementDefinitionType.Type type, String name, DbDataReader reader)
        {
            OplDataHandler handler = DataHandler;

            handler.StartElement(name);
            handler.StartSet();

            while (reader.Read())
            {
                HandleColumnValue(handler, type, reader.GetValue(0));
            }

            handler.EndSet();
        }
Exemplo n.º 6
0
            private void GetProductIDs(OplDataHandler handler)
            {
                ProductNameToID = new Dictionary <string, int>();

                // initialize the tuple set 'Products'
                handler.StartElement("Products");
                handler.StartSet();

                List <Lot> allLots = new List <Lot>();

                // Loop through queue
                for (int i = 0; i < Queue.Length; i++)
                {
                    // Peek next lot in queue
                    Lot peekLot = Queue.PeekAt(i);
                    allLots.Add(peekLot);
                }
                foreach (Machine machine in LithographyArea.Machines)
                {
                    if (machine.Queue.Length > 0)
                    {
                        Lot lotAtMachine = machine.Queue.PeekFirst();
                        allLots.Add(lotAtMachine);
                    }
                }

                int productID = 0;

                // Loop through queue
                foreach (Lot lot in allLots)
                {
                    string productName = lot.MasksetLayer_RecipeStepCluster;

                    if (!ProductNameToID.ContainsKey(productName))
                    {
                        // Add tuple
                        handler.StartTuple();
                        handler.AddIntItem(productID);
                        handler.AddStringItem(productName);
                        handler.EndTuple();

                        ProductNameToID.Add(productName, productID);

                        productID += 1;
                    }
                }

                handler.EndSet();
                handler.EndElement();
            }
Exemplo n.º 7
0
            private void GetComputationalSettings(OplDataHandler handler)
            {
                // initialize the tuple set
                handler.StartElement("ComputationalSettings");
                handler.StartSet();

                // Add tuple
                handler.StartTuple();
                handler.AddStringItem("timeLimit");
                handler.AddIntItem(CPDispatcher.TimeLimit);
                handler.EndTuple();

                handler.EndSet();
                handler.EndElement();
            }
Exemplo n.º 8
0
        public override void CustomRead()
        {
            int    beginTime  = 1920;  //need to initialized
            int    endTime    = 2100;  //need to initialized
            String marketCity = "SHA"; //need to initialized

            /*
             * 1* FlightCode:{"1033538119", "1033538066"}
             * 2* FlightInfo:[<"738","D",1323,1800,0>,<"738","D",1341,1800,0>]
             * 3* StandCode:{"301","302"}
             * 4* StandInfo:[<"N",2>,<"N",2>]
             * 5* Stnd_fl_type:[0,1...]
             * 6* preflightcode:{"1033538119", "1033538066"}
             * 7* prestnd:
             * 8* SCAdjCon:[<"N207","N207L">,<"N207","N207R">,<"N206","N206L">]
             */

            OplDataHandler handler = getDataHandler();

            //1.FlightCode
            handler.StartElement("FlightCode");
            handler.StartSet();
            List <FlightInfo> FlightCode = new List <FlightInfo>();

            for (int i = 0; i < FlightCode.Count; i++)
            {
                handler.AddStringItem(FlightCode[i].flightCode);
            }
            handler.EndSet();
            handler.EndElement();

            //2.FlightInfo
            handler.StartElement("FlightInfo");
            handler.StartSet();
            List <FlightInfo> FlightInfo = new List <FlightInfo>();

            for (int i = 0; i < FlightInfo.Count; i++)
            {
                handler.StartTuple();
                handler.AddStringItem(FlightInfo[i].flightType);
                handler.AddStringItem(FlightInfo[i].d_or_i);
                handler.AddIntItem(int.Parse(FlightInfo[i].startTime));//是否要转为int??居飞
                handler.AddIntItem(int.Parse(FlightInfo[i].endTime));
                handler.AddIntItem(int.Parse(FlightInfo[i].isTurnArround));
                handler.EndTuple();
            }
            handler.EndSet();
            handler.EndElement();

            //3.StandCode
            handler.StartElement("StandCode");
            handler.StartSet();
            List <StandInfo> StandCode = new List <StandInfo>();

            for (int i = 0; i < StandCode.Count; i++)
            {
                handler.AddStringItem(StandCode[i].standCode);
            }
            handler.EndSet();
            handler.EndElement();

            //4.StandInfo
            handler.StartElement("StandInfo");
            handler.StartSet();
            List <StandInfo> StandInfo = new List <StandInfo>();

            for (int i = 0; i < StandInfo.Count; i++)
            {
                handler.StartTuple();
                handler.AddStringItem(StandInfo[i].near_or_far);
                handler.AddIntItem(int.Parse(StandInfo[i].priority));
                handler.EndTuple();
            }
            handler.EndSet();
            handler.EndElement();

            //5.Stnd_fl_type
            handler.StartElement("Stnd_fl_type");
            handler.StartSet();

            //6.preflightcode
            handler.StartElement("preflightcode");
            handler.StartSet();

            //7.prestnd
            handler.StartElement("prestnd");
            handler.StartSet();

            //8.SCAdjCon
            handler.StartElement("SCAdjCon");
            handler.StartSet();

            Console.WriteLine("Read Over");
        }
Exemplo n.º 9
0
            public override void CustomRead()
            {
                OplDataHandler handler = DataHandler;

                // initialize the int 'simpleInt'
                handler.StartElement("anInt");
                handler.AddIntItem(3);
                handler.EndElement();

                // initialize the int array 'simpleIntArray'
                handler.StartElement("anIntArray");
                handler.StartArray();
                handler.AddIntItem(1);
                handler.AddIntItem(2);
                handler.AddIntItem(3);
                handler.EndArray();
                handler.EndElement();

                // initialize int array indexed by float 'anArrayIndexedByFloat'
                handler.StartElement("anArrayIndexedByFloat");
                handler.StartIndexedArray();
                handler.SetItemNumIndex(2.0);
                handler.AddIntItem(1);
                handler.SetItemNumIndex(2.5);
                handler.AddIntItem(2);
                handler.SetItemNumIndex(1.0);
                handler.AddIntItem(3);
                handler.SetItemNumIndex(1.5);
                handler.AddIntItem(4);
                handler.EndIndexedArray();
                handler.EndElement();

                // initialize int array indexed by string 'anArrayIndexedByString'
                handler.StartElement("anArrayIndexedByString");
                handler.StartIndexedArray();
                handler.SetItemStringIndex("idx1");
                handler.AddIntItem(1);
                handler.SetItemStringIndex("idx2");
                handler.AddIntItem(2);
                handler.EndIndexedArray();
                handler.EndElement();

                // initialize a tuple in the order the components are declared
                handler.StartElement("aTuple");
                handler.StartTuple();
                handler.AddIntItem(1);
                handler.AddNumItem(2.3);
                handler.AddStringItem("not named tuple");
                handler.EndTuple();
                handler.EndElement();

                // initialize a tuple using tuple component names.
                handler.StartElement("aNamedTuple");
                handler.StartNamedTuple();
                handler.SetItemName("f");
                handler.AddNumItem(3.45);
                handler.SetItemName("s");
                handler.AddStringItem("named tuple");
                handler.SetItemName("i");
                handler.AddIntItem(99);
                handler.EndNamedTuple();
                handler.EndElement();

                // initialize the tuple set 'simpleTupleSet'
                handler.StartElement("aTupleSet");
                handler.StartSet();
                // first tuple
                handler.StartTuple();
                handler.AddIntItem(1);
                handler.AddNumItem(2.5);
                handler.AddStringItem("a");
                handler.EndTuple();
                // second element
                handler.StartTuple();
                handler.AddIntItem(3);
                handler.AddNumItem(4.1);
                handler.AddStringItem("b");
                handler.EndTuple();
                handler.EndSet();
                handler.EndElement();

                // initialize element 3 and 2 of the tuple array 'simpleTupleArray' in that particular order
                handler.StartElement("aTupleArray");
                handler.StartIndexedArray();
                // initialize 3rd cell
                handler.SetItemIntIndex(3);
                handler.StartTuple();
                handler.AddIntItem(1);
                handler.AddNumItem(2.5);
                handler.AddStringItem("a");
                handler.EndTuple();
                // initialize second cell
                handler.SetItemIntIndex(2);
                handler.StartTuple();
                handler.AddIntItem(3);
                handler.AddNumItem(4.1);
                handler.AddStringItem("b");
                handler.EndTuple();
                handler.EndIndexedArray();
                handler.EndElement();

                // initialize int array indexed by tuple set 'anArrayIndexedByTuple'
                handler.StartElement("anArrayIndexedByTuple");
                handler.StartIndexedArray();
                handler.StartItemTupleIndex();
                handler.AddIntItem(3);
                handler.AddNumItem(4.1);
                handler.AddStringItem("b");
                handler.EndItemTupleIndex();
                handler.AddIntItem(1);
                handler.EndIndexedArray();
                handler.EndElement();

                // initialize a 2-dimension int array 'a2DIntArray'
                handler.StartElement("a2DIntArray");
                handler.StartArray();
                for (int i = 1; i <= 2; i++)
                {
                    handler.StartArray();
                    for (int j = 1; j <= 3; j++)
                    {
                        handler.AddIntItem(i * 10 + j);
                    }
                    handler.EndArray();
                }
                handler.EndArray();
                handler.EndElement();
            }
Exemplo n.º 10
0
            private void GetSetups(OplDataHandler handler)
            {
                // initialize the tuple set 'Products'
                handler.StartElement("Setups");
                handler.StartSet();

                List <Lot> allLots = new List <Lot>();

                // Loop through queue
                for (int i = 0; i < Queue.Length; i++)
                {
                    // Peek next lot in queue
                    Lot peekLot = Queue.PeekAt(i);
                    allLots.Add(peekLot);
                }
                foreach (Machine machine in LithographyArea.Machines)
                {
                    if (machine.Queue.Length > 0)
                    {
                        Lot lotAtMachine = machine.Queue.PeekFirst();
                        allLots.Add(lotAtMachine);
                    }
                }

                List <string> productNamesFrom = new List <string>();

                // Loop through queue
                foreach (Lot lotFrom in allLots)
                {
                    if (!productNamesFrom.Contains(lotFrom.MasksetLayer_RecipeStepCluster))
                    {
                        List <string> productNamesTo = new List <string>();

                        // Loop through queue
                        foreach (Lot lotTo in allLots)
                        {
                            if (!productNamesTo.Contains(lotTo.MasksetLayer_RecipeStepCluster))
                            {
                                if (lotFrom.ReticleID1 == lotTo.ReticleID1)
                                {
                                    // Add tuple
                                    handler.StartTuple();
                                    handler.AddStringItem("MTRX_ARMS");
                                    handler.AddIntItem(ProductNameToID[lotFrom.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem(ProductNameToID[lotTo.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem((int)LithographyArea.DeterministicNonProductiveTimesARMS["SameReticle"]);
                                    handler.EndTuple();

                                    // Add tuple
                                    handler.StartTuple();
                                    handler.AddStringItem("MTRX_RMS");
                                    handler.AddIntItem(ProductNameToID[lotFrom.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem(ProductNameToID[lotTo.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem((int)LithographyArea.DeterministicNonProductiveTimesRMS["SameReticle"]);
                                    handler.EndTuple();
                                }
                                else if (lotFrom.ReticleID1 != lotTo.ReticleID1 && lotFrom.IrdName == lotTo.IrdName)
                                {
                                    // Add tuple
                                    handler.StartTuple();
                                    handler.AddStringItem("MTRX_ARMS");
                                    handler.AddIntItem(ProductNameToID[lotFrom.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem(ProductNameToID[lotTo.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem((int)LithographyArea.DeterministicNonProductiveTimesARMS["DifferentReticle"]);
                                    handler.EndTuple();

                                    // Add tuple
                                    handler.StartTuple();
                                    handler.AddStringItem("MTRX_RMS");
                                    handler.AddIntItem(ProductNameToID[lotFrom.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem(ProductNameToID[lotTo.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem((int)LithographyArea.DeterministicNonProductiveTimesRMS["DifferentReticle"]);
                                    handler.EndTuple();
                                }
                                else
                                {
                                    // Add tuple
                                    handler.StartTuple();
                                    handler.AddStringItem("MTRX_ARMS");
                                    handler.AddIntItem(ProductNameToID[lotFrom.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem(ProductNameToID[lotTo.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem((int)LithographyArea.DeterministicNonProductiveTimesARMS["DifferentIRD"]);
                                    handler.EndTuple();

                                    // Add tuple
                                    handler.StartTuple();
                                    handler.AddStringItem("MTRX_RMS");
                                    handler.AddIntItem(ProductNameToID[lotFrom.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem(ProductNameToID[lotTo.MasksetLayer_RecipeStepCluster]);
                                    handler.AddIntItem((int)LithographyArea.DeterministicNonProductiveTimesRMS["DifferentIRD"]);
                                    handler.EndTuple();
                                }
                                productNamesTo.Add(lotTo.MasksetLayer_RecipeStepCluster);
                            }
                        }
                        productNamesFrom.Add(lotFrom.MasksetLayer_RecipeStepCluster);
                    }
                }
                handler.EndSet();
                handler.EndElement();
            }
Exemplo n.º 11
0
            private void GetModes(OplDataHandler handler)
            {
                // initialize the tuple set 'Products'
                handler.StartElement("Modes");
                handler.StartSet();

                List <Lot> allLots = new List <Lot>();

                // Loop through queue
                for (int i = 0; i < Queue.Length; i++)
                {
                    // Peek next lot in queue
                    Lot peekLot = Queue.PeekAt(i);
                    allLots.Add(peekLot);
                }
                foreach (Machine machine in LithographyArea.Machines)
                {
                    if (machine.Queue.Length > 0)
                    {
                        Lot lotAtMachine = machine.Queue.PeekFirst();
                        allLots.Add(lotAtMachine);
                    }
                }

                List <string> productNames = new List <string>();

                // Loop through queue
                foreach (Lot lot in allLots)
                {
                    if (!productNames.Contains(lot.MasksetLayer_RecipeStepCluster))
                    {
                        int modeNr = 0;

                        foreach (Machine machine in LithographyArea.Machines)
                        {
                            // Check if machine is Down
                            if (LithographyArea.MachineStates[machine.Name] == "Down")
                            {
                                continue;
                            }

                            // Get needed recipe for the lot
                            string recipe    = CPDispatcher.GetRecipe(lot, machine);
                            string recipeKey = machine.Name + "__" + recipe;

                            // Check if needed recipe is eligible on machine
                            bool recipeEligible = CPDispatcher.CheckMachineEligibility(recipeKey);

                            // Check if processingTime is known
                            bool processingTimeKnown = CPDispatcher.CheckProcessingTimeKnown(lot, machine, recipe);

                            if (recipeEligible && processingTimeKnown)
                            {
                                int?processingTime = null;

                                processingTime = (int)machine.GetDeterministicProcessingTimeFullLot(lot);

                                // Add tuple
                                handler.StartTuple();
                                handler.AddIntItem(ProductNameToID[lot.MasksetLayer_RecipeStepCluster]);
                                handler.AddIntItem(modeNr);
                                handler.AddStringItem(machine.Name);
                                handler.AddIntItem((int)processingTime);

                                handler.EndTuple();

                                modeNr += 1;
                            }
                        }
                        productNames.Add(lot.MasksetLayer_RecipeStepCluster);
                    }
                }

                handler.EndSet();
                handler.EndElement();
            }
Exemplo n.º 12
0
            private void GetAuxResources(OplDataHandler handler)
            {
                // initialize the tuple set 'Products'
                handler.StartElement("AuxResources");
                handler.StartSet();

                List <Lot> allLots = new List <Lot>();

                // Loop through queue
                for (int i = 0; i < Queue.Length; i++)
                {
                    // Peek next lot in queue
                    Lot peekLot = Queue.PeekAt(i);
                    allLots.Add(peekLot);
                }
                foreach (Machine machine in LithographyArea.Machines)
                {
                    if (machine.Queue.Length > 0)
                    {
                        Lot lotAtMachine = machine.Queue.PeekFirst();
                        allLots.Add(lotAtMachine);
                    }
                }

                // Get Reticles

                List <string> allReticles = new List <string>();

                // Loop through queue
                foreach (Lot lot in allLots)
                {
                    if (!allReticles.Contains(lot.ReticleID1))
                    {
                        if (lot.ReticleID1 == "4106")
                        {
                            // Add tuple
                            handler.StartTuple();
                            handler.AddStringItem(lot.ReticleID1);
                            handler.AddIntItem(2);
                            handler.EndTuple();
                        }
                        else
                        {
                            // Add tuple
                            handler.StartTuple();
                            handler.AddStringItem(lot.ReticleID1);
                            handler.AddIntItem(1);
                            handler.EndTuple();
                        }
                        allReticles.Add(lot.ReticleID1);
                    }
                }

                // Get IRDNames

                List <string> allIRDNames = new List <string>();

                // Loop through queue
                foreach (Lot lot in allLots)
                {
                    if (!allIRDNames.Contains(lot.IrdName))
                    {
                        // Add tuple
                        handler.StartTuple();
                        handler.AddStringItem(lot.IrdName);
                        int capacity = 2;
                        if (CPDispatcher.AvailableResources.ContainsKey(lot.IrdName))
                        {
                            capacity = CPDispatcher.AvailableResources[lot.IrdName];
                        }
                        handler.AddIntItem(capacity);
                        handler.EndTuple();

                        allIRDNames.Add(lot.IrdName);
                    }
                }

                handler.EndSet();
                handler.EndElement();
            }
Exemplo n.º 13
0
            private void GetResources(OplDataHandler handler)
            {
                // initialize the tuple set 'Products'
                handler.StartElement("Resources");
                handler.StartSet();

                // Loop through queue
                foreach (Machine machine in LithographyArea.Machines)
                {
                    // Check if machine is Down
                    if (LithographyArea.MachineStates[machine.Name] == "Down")
                    {
                        continue;
                    }

                    int initialProductID        = -1;
                    int endTimeInitialProductID = 0;

                    // Check if a lot is loaded on the machine
                    if (machine.Queue.Length > 0)
                    {
                        Lot lotAtMachine = machine.Queue.PeekFirst();
                        initialProductID = ProductNameToID[lotAtMachine.MasksetLayer_RecipeStepCluster];
                        double estimatedEndTime;

                        if (machine.CurrentLot == lotAtMachine)
                        {
                            estimatedEndTime = machine.CurrentStartRun + machine.GetDeterministicProcessingTime(lotAtMachine);

                            if (estimatedEndTime > LithographyArea.GetTime)
                            {
                                endTimeInitialProductID = (int)estimatedEndTime - (int)LithographyArea.GetTime;
                            }
                        }
                        else
                        {
                            estimatedEndTime        = machine.GetDeterministicProcessingTime(lotAtMachine);
                            endTimeInitialProductID = (int)estimatedEndTime;
                        }
                    }

                    if (machine.Name.Contains("#5") || machine.Name.Contains("#7") || machine.Name.Contains("#9"))
                    {
                        // Add tuple
                        handler.StartTuple();
                        handler.AddStringItem(machine.Name);
                        handler.AddStringItem("MTRX_RMS");
                        handler.AddIntItem(initialProductID);
                        handler.AddIntItem(endTimeInitialProductID);
                        handler.EndTuple();
                    }
                    else
                    {
                        // Add tuple
                        handler.StartTuple();
                        handler.AddStringItem(machine.Name);
                        handler.AddStringItem("MTRX_ARMS");
                        handler.AddIntItem(initialProductID);
                        handler.AddIntItem(endTimeInitialProductID);
                        handler.EndTuple();
                    }
                }

                handler.EndSet();
                handler.EndElement();
            }