Пример #1
0
        public void crearModelo()
        {
            ReadExcel   objExcel;
            INodeObject nodoInicio            = null;
            INodeObject nodoFin               = null;
            INodeObject nodoInicioMapa        = null;
            Path        objPath               = new Path();
            int         distanciaIni          = 0;
            int         distanciaNodoAnterior = 0;

            objExcel = new ReadExcel();
            var listPuntos = objExcel.readCSV("coordenadasmapalite.csv", true);

            foreach (var item in listPuntos)
            {
                TransferNode tn = new TransferNode(item.id, item.ejeX, item.ejeY);
                nodoFin = tn.getTransferNode();


                if (nodoInicioMapa == null)
                {
                    nodoInicioMapa = nodoFin;
                    distanciaIni   = item.distancia;
                }

                if (nodoInicio != null)
                {
                    objPath.idpath = item.id;
                    objPath.Enlazar(nodoInicio, nodoFin);
                    objPath.setDistancia(distanciaNodoAnterior);
                }
                nodoInicio            = nodoFin;
                distanciaNodoAnterior = item.distancia;
            }

            objPath.idpath = 1;
            objPath.Enlazar(nodoFin, nodoInicioMapa);
            objPath.setDistancia(distanciaNodoAnterior);
        }
Пример #2
0
        public Source(int id, int intEjeX, int intEjeY)
        {
            this.id   = id;
            this.ejeX = intEjeX;
            this.ejeY = intEjeY;
            this.tipo = Base.Tipo.Source.ToString();
            Path         objPath = new Path();
            TransferNode tn      = new TransferNode();

            //Creacion de TransferNode1
            model.Facility.IntelligentObjects.CreateObject("Source", new FacilityLocation(ejeX, 0, ejeY));

            model.Facility.IntelligentObjects["DefaultEntity"].Size = new FacilitySize(30250, 20679, 20205);
            model.Facility.IntelligentObjects[this.tipo + "1"].Size = new FacilitySize(30250, 20679, 20205);
            //Cambio de Nombre
            model.Facility.IntelligentObjects[this.tipo + "1"].Properties["EntityType"].Value       = "DefaultEntity";
            model.Facility.IntelligentObjects[this.tipo + "1"].Properties["InterarrivalTime"].Value = "Random.Poisson(3)";
            model.Facility.IntelligentObjects[this.tipo + "1"].ObjectName = "src" + id.ToString();

            objPath.idpath = id;
            objPath.EnlazarSourceTN(id.ToString(), ((IFixedObject)model.Facility.IntelligentObjects["src" + id.ToString()]).Nodes[0], tn.getTransferNode("gt5"));
            objPath.setDistancia(1);
        }