Beispiel #1
0
        private void CreatePointCardinal(IIntelligentObjects intelligentObjects)
        {
            TransferNode norte = new TransferNode(intelligentObjects, 0, -100),
                         sur   = new TransferNode(intelligentObjects, 0, 70),
                         oeste = new TransferNode(intelligentObjects, -90, 0),
                         este  = new TransferNode(intelligentObjects, 90, 0);

            norte.UpdateName("Norte");
            sur.UpdateName("Sur");
            oeste.UpdateName("Oeste");
            este.UpdateName("Este");
            new Path(intelligentObjects, norte.GetInput(), sur.GetInput());
            new Path(intelligentObjects, oeste.GetInput(), este.GetInput());
        }
Beispiel #2
0
        private void CreateRegions(IIntelligentObjects intelligentObjects)
        {
            TransferNode region1 = new TransferNode(intelligentObjects, COORDINATES[0], COORDINATES[1]),
                         region2 = new TransferNode(intelligentObjects, COORDINATES[2], COORDINATES[3]),
                         region3 = new TransferNode(intelligentObjects, COORDINATES[4], COORDINATES[5]),
                         region4 = new TransferNode(intelligentObjects, COORDINATES[6], COORDINATES[7]),
                         region5 = new TransferNode(intelligentObjects, COORDINATES[8], COORDINATES[9]),
                         region6 = new TransferNode(intelligentObjects, COORDINATES[10], COORDINATES[11]),
                         region7 = new TransferNode(intelligentObjects, COORDINATES[12], COORDINATES[13]),
                         region8 = new TransferNode(intelligentObjects, COORDINATES[14], COORDINATES[15]);

            region1.UpdateName("Region1_Metropolitana");
            region2.UpdateName("Region2_Norte");
            region3.UpdateName("Region3_Nor_Oriente");
            region4.UpdateName("Region4_Sur_Oriente");
            region5.UpdateName("Region5_Central");
            region6.UpdateName("Region6_Sur_Occidente");
            region7.UpdateName("Region7_Nor_Occidente");
            region8.UpdateName("Region8_Peten");
        }
Beispiel #3
0
        public void CreateModel(string finalModelPath)
        {
            try
            {
                System.IO.File.WriteAllBytes(BASE_MODEL_PATH, FileStore.Resource.BaseModel);
                ISimioProject       project            = SimioProjectFactory.LoadProject(BASE_MODEL_PATH, out string[] warnings);
                IModel              model              = project.Models[1];
                IIntelligentObjects intelligentObjects = model.Facility.IntelligentObjects;

                Source llegadaClientes = new Source(intelligentObjects, 0, 0);
                llegadaClientes.UpdateInterarrivalTime("Random.Uniform(1, 2.5)");
                llegadaClientes.UpdateName("LlegadaClientes");
                llegadaClientes.UpdateEntityType("Cliente");

                Server caja = new Server(intelligentObjects, 10, 0);
                caja.UpdateProcessingTime("Random.Uniform(2/3, 11/6)");
                caja.UpdateName("Caja");
                Path pathLlegadaCaja = new Path(intelligentObjects, llegadaClientes.GetOutput(), caja.GetInput());
                pathLlegadaCaja.UpdateDrawToScale("False");
                pathLlegadaCaja.UpdateLogicalLength("20");

                Source llegadaBotellas = new Source(intelligentObjects, 10, 15);
                llegadaBotellas.UpdateName("AlmacenBotella");
                llegadaBotellas.UpdateEntityType("Botella");
                llegadaBotellas.UpdateArrivalMode("On Event");

                INodeObject entradaCaja = (INodeObject)intelligentObjects["EntradaCaja"];
                new Path(intelligentObjects, entradaCaja, llegadaBotellas.GetOutput());

                Combiner entrega = new Combiner(intelligentObjects, 20, 0);
                entrega.UpdateName("Entrega");
                entrega.GetOutput().Properties["OutboundLinkRule"].Value = "By Link Weight";
                Path cajaEntrega = new Path(intelligentObjects, caja.GetOutput(), entrega.GetParentInput());
                cajaEntrega.UpdateDrawToScale("False");
                cajaEntrega.UpdateLogicalLength("4");

                Sink     sink       = new Sink(intelligentObjects, 60, -5);
                TimePath pathSalida = new TimePath(intelligentObjects, entrega.GetOutput(), sink.GetInput());
                pathSalida.UpdateSelectionWeight("0.48");
                pathSalida.UpdateTravelTime("0.3");
                TransferNode transferNode = new TransferNode(intelligentObjects, 25, -10);
                transferNode.UpdateName("IrSalida");
                new Path(intelligentObjects, transferNode.GetInput(), sink.GetInput());

                CreateServer(
                    intelligentObjects, 50, 40, "0.12",
                    "Random.Triangular(4, 8, 12)", "5",
                    null, "3", "Barra", entrega.GetOutput(), sink.GetInput()
                    );
                int i = 1;
                int x = 50;
                int y = 35;
                for (; i < 15; i++)
                {
                    CreateServer(
                        intelligentObjects, x, y, "0.025",
                        "Random.Triangular(12, 20, 25)",
                        i <= 8 ? "4" : "3", i <= 8 ? "10/60" : "12/60",
                        null, "Mesa_" + i, entrega.GetOutput(), sink.GetInput()
                        );
                    y -= 5;
                }
                SimioProjectFactory.SaveProject(project, finalModelPath, out warnings);
                System.IO.File.WriteAllLines(WARNINGS_FILE_PATH, warnings);
            } catch (Exception e)
            {
                System.IO.File.WriteAllText(WARNINGS_FILE_PATH, e.Message);
            }
        }
Beispiel #4
0
        private void CreateAirports(IIntelligentObjects intelligentObjects)
        {
            Source airportAurora         = new Source(intelligentObjects, COORDINATES[0] - 5, COORDINATES[1]);
            Source airportMundoMaya      = new Source(intelligentObjects, COORDINATES[14] + 10, COORDINATES[15] - 20);
            Source airportQuetzaltenango = new Source(intelligentObjects, COORDINATES[10] - 4, COORDINATES[11]);

            airportAurora.UpdateName("Aereo_Aurora");
            airportAurora.UpdateInterarrivalTime("Random.Exponential(35)");
            airportAurora.UpdateEntitiesPerArrival("70");
            airportAurora.UpdateEntityType("Turista");
            airportMundoMaya.UpdateName("Aereo_MundoMaya");
            airportMundoMaya.UpdateInterarrivalTime("Random.Exponential(50)");
            airportMundoMaya.UpdateEntitiesPerArrival("40");
            airportMundoMaya.UpdateEntityType("Turista");
            airportQuetzaltenango.UpdateName("Aereo_Quetzal");
            airportQuetzaltenango.UpdateInterarrivalTime("Random.Exponential(70)");
            airportQuetzaltenango.UpdateEntitiesPerArrival("30");
            airportQuetzaltenango.UpdateEntityType("Turista");

            TransferNode transferNodeAurora     = new TransferNode(intelligentObjects, COORDINATES[0] - 3, COORDINATES[1] + 2),
                         transferNodeMundoMaya  = new TransferNode(intelligentObjects, COORDINATES[14] + 6, COORDINATES[15] - 17),
                         transferQuetzaltenango = new TransferNode(intelligentObjects, COORDINATES[10] - 2, COORDINATES[11] + 2);

            transferNodeAurora.UpdateName("Llegando_Aurora");
            transferNodeAurora.UpdateOutboundLinkRule("By Link Weight");
            transferNodeMundoMaya.UpdateName("Llegando_MundoMaya");
            transferNodeMundoMaya.UpdateOutboundLinkRule("By Link Weight");
            transferQuetzaltenango.UpdateName("Llegando_Quetzal");
            transferQuetzaltenango.UpdateOutboundLinkRule("By Link Weight");

            Draw.RegionStation metropolitana = new Draw.RegionStation(
                "Metro", intelligentObjects, COORDINATES[0], COORDINATES[1] - 2,
                "Random.Poisson(2)", "200", "Random.Exponential(4)", "0.35"
                );
            Draw.RegionStation norte = new Draw.RegionStation(
                "Norte", intelligentObjects, COORDINATES[2], COORDINATES[3] - 2,
                "Random.Poisson(8)", "50", "Random.Exponential(5)", "0.40"
                );
            Draw.RegionStation nor_oriente = new Draw.RegionStation(
                "Nor_Oriente", intelligentObjects, COORDINATES[4], COORDINATES[5] - 2,
                "Random.Poisson(6)", "40", "Random.Exponential(3)", "0.20"
                );
            Draw.RegionStation sur_oriente = new Draw.RegionStation(
                "Sur_Oriente", intelligentObjects, COORDINATES[6], COORDINATES[7] - 2,
                "Random.Poisson(10)", "30", "Random.Exponential(4)", "0.40"
                );
            Draw.RegionStation central = new Draw.RegionStation(
                "Central", intelligentObjects, COORDINATES[8], COORDINATES[9] - 2,
                "Random.Poisson(3)", "100", "Random.Exponential(5)", "0.35"
                );
            Draw.RegionStation sur_occidente = new Draw.RegionStation(
                "Sur_Occidente", intelligentObjects, COORDINATES[10], COORDINATES[11] - 2,
                "Random.Poisson(4)", "120", "Random.Exponential(3)", "0.35"
                );
            Draw.RegionStation nor_occidente = new Draw.RegionStation(
                "Nor_Occidente", intelligentObjects, COORDINATES[12], COORDINATES[13] - 2,
                "Random.Poisson(12)", "30", "Random.Exponential(6)", "0.40"
                );
            Draw.RegionStation peten = new Draw.RegionStation(
                "Peten", intelligentObjects, COORDINATES[14] + 10, COORDINATES[15] - 14,
                "Random.Poisson(4)", "150", "Random.Exponential(4)", "0.5"
                );

            // conections
            metropolitana.SetDestinationStation(intelligentObjects, central.GetInput(), "63000", "0.30");
            metropolitana.SetDestinationStation(intelligentObjects, sur_oriente.GetInput(), "124000", "0.15");
            metropolitana.SetDestinationStation(intelligentObjects, nor_oriente.GetInput(), "241000", "0.20");

            norte.SetDestinationStation(intelligentObjects, transferNodeMundoMaya.GetInput(), "147000", "0.40");
            norte.SetDestinationStation(intelligentObjects, nor_oriente.GetInput(), "138000", "0.10");
            norte.SetDestinationStation(intelligentObjects, transferNodeMundoMaya.GetInput(), "145000", "0.10");

            nor_oriente.SetDestinationStation(intelligentObjects, transferNodeAurora.GetInput(), "241000", "0.30");
            nor_oriente.SetDestinationStation(intelligentObjects, norte.GetInput(), "138000", "0.15");
            nor_oriente.SetDestinationStation(intelligentObjects, sur_oriente.GetInput(), "231000", "0.05");
            nor_oriente.SetDestinationStation(intelligentObjects, transferNodeMundoMaya.GetInput(), "282000", "0.30");

            sur_oriente.SetDestinationStation(intelligentObjects, nor_oriente.GetInput(), "231000", "0.20");
            sur_oriente.SetDestinationStation(intelligentObjects, transferNodeAurora.GetInput(), "124000", "0.25");
            sur_oriente.SetDestinationStation(intelligentObjects, central.GetInput(), "154000", "0.15");

            central.SetDestinationStation(intelligentObjects, transferNodeAurora.GetInput(), "63000", "0.35");
            central.SetDestinationStation(intelligentObjects, sur_oriente.GetInput(), "154000", "0.05");
            central.SetDestinationStation(intelligentObjects, transferQuetzaltenango.GetInput(), "155000", "0.15");
            central.SetDestinationStation(intelligentObjects, nor_occidente.GetInput(), "269000", "0.10");

            sur_occidente.SetDestinationStation(intelligentObjects, nor_occidente.GetInput(), "87000", "0.30");
            sur_occidente.SetDestinationStation(intelligentObjects, central.GetInput(), "155000", "0.35");

            nor_occidente.SetDestinationStation(intelligentObjects, transferQuetzaltenango.GetInput(), "87000", "0.30");
            nor_occidente.SetDestinationStation(intelligentObjects, central.GetInput(), "269000", "0.10");
            nor_occidente.SetDestinationStation(intelligentObjects, norte.GetInput(), "145000", "0.20");

            peten.SetDestinationStation(intelligentObjects, norte.GetInput(), "147000", "0.25");
            peten.SetDestinationStation(intelligentObjects, nor_oriente.GetInput(), "282000", "0.25");

            new Path(intelligentObjects, airportAurora.GetOutput(), metropolitana.GetInput());
            new Path(intelligentObjects, airportMundoMaya.GetOutput(), peten.GetInput());
            new Path(intelligentObjects, airportQuetzaltenango.GetOutput(), sur_occidente.GetInput());

            Sink abandonoAurora         = new Sink(intelligentObjects, COORDINATES[0] - 6, COORDINATES[1] + 2);
            Sink abandonoMundoMaya      = new Sink(intelligentObjects, COORDINATES[14] + 3, COORDINATES[15] - 17);
            Sink abandonoQuetzaltenango = new Sink(intelligentObjects, COORDINATES[10] - 2, COORDINATES[11] + 1);

            abandonoAurora.UpdateName("Abandono_Aurora");
            abandonoMundoMaya.UpdateName("Abandono_MundoMaya");
            abandonoQuetzaltenango.UpdateName("Abandono_Quetzal");

            Path pathAbandonoAurora = new Path(intelligentObjects, transferNodeAurora.GetInput(), abandonoAurora.GetInput());

            pathAbandonoAurora.UpdateSelectionWeight("0.50");
            Path pathAbandonoMundoMaya = new Path(intelligentObjects, transferNodeMundoMaya.GetInput(), abandonoMundoMaya.GetInput());

            pathAbandonoMundoMaya.UpdateSelectionWeight("0.30");
            Path pathAbandonoQuetzal = new Path(intelligentObjects, transferQuetzaltenango.GetInput(), abandonoQuetzaltenango.GetInput());

            pathAbandonoQuetzal.UpdateSelectionWeight("0.40");

            Path path1 = new Path(intelligentObjects, transferNodeAurora.GetInput(), airportAurora.GetOutput());

            path1.UpdateSelectionWeight("0.50");
            Path path2 = new Path(intelligentObjects, transferNodeMundoMaya.GetInput(), airportMundoMaya.GetOutput());

            path2.UpdateSelectionWeight("0.70");
            Path path3 = new Path(intelligentObjects, transferQuetzaltenango.GetInput(), airportQuetzaltenango.GetOutput());

            path3.UpdateSelectionWeight("0.60");
        }