示例#1
0
        /// <summary>
        /// Method called when the add-in is run.
        /// </summary>
        public void Execute(IDesignContext context)
        {
            // This example code places some new objects from the Standard Library into the active model of the project.
            if (context.ActiveModel != null)
            {
                // Example of how to place some new fixed objects into the active model.
                // This example code places three new fixed objects: a Source, a Server, and a Sink.
                IIntelligentObjects intelligentObjects = context.ActiveModel.Facility.IntelligentObjects;
                IFixedObject        sourceObject       = intelligentObjects.CreateObject("Source", new FacilityLocation(-10, 0, -10)) as IFixedObject;
                IFixedObject        serverObject       = intelligentObjects.CreateObject("Server", new FacilityLocation(0, 0, 0)) as IFixedObject;
                IFixedObject        sinkObject         = intelligentObjects.CreateObject("Sink", new FacilityLocation(10, 0, 10)) as IFixedObject;

                // Example of how to place some new link objects into the active model (to add network paths between nodes).
                // This example code places two new link objects: a Path connecting the Source 'output' node to the Server 'input' node,
                // and a Path connecting the Server 'output' node to the Sink 'input' node.
                INodeObject sourceOutputNode = sourceObject.Nodes[0];
                INodeObject serverInputNode  = serverObject.Nodes[0];
                INodeObject serverOutputNode = serverObject.Nodes[1];
                INodeObject sinkInputNode    = sinkObject.Nodes[0];
                ILinkObject pathObject1      = intelligentObjects.CreateLink("Path", sourceOutputNode, serverInputNode, null) as ILinkObject;
                ILinkObject pathObject2      = intelligentObjects.CreateLink("Path", serverOutputNode, sinkInputNode, null) as ILinkObject;

                // Example of how to edit the property of an object.
                // This example code edits the 'ProcessingTime' property of the added Server object.
                serverObject.Properties["ProcessingTime"].Value = "100";
            }
        }
示例#2
0
        public IIntelligentObject createObject(String type, String name, int possX, int possY, int possZ)
        {
            IIntelligentObjects _objects = this.model.Facility.IntelligentObjects;
            IIntelligentObject  _object  = _objects.CreateObject(type, new FacilityLocation(possX, possZ, possY));

            _object.ObjectName = name;
            return(_object);
        }
示例#3
0
        private void crear()
        {
            IIntelligentObjects _objetos = _modelo.Facility.IntelligentObjects;
            int x = 0;
            int z = 0;
            int y = 1;
            IIntelligentObject combiner = _objetos.CreateObject("Combiner", new FacilityLocation(x, z, y));

            combiner.ObjectName = "fabi";
            INodeObject             input      = seekForName("MemberInput@" + combiner.ObjectName) as INodeObject;
            INodeObject             output     = seekForName("ParentInput@" + combiner.ObjectName) as INodeObject;
            List <FacilityLocation> listpoints = new List <FacilityLocation>();
            FacilityLocation        fl         = new FacilityLocation(35, 36, 86);

            listpoints.Add(fl);
            IIntelligentObject connect1 = _objetos.CreateLink("Connector", input, output, listpoints);
        }
 public TransferNode(IIntelligentObjects intelligentObjects, int x, int y)
 {
     @object = intelligentObjects.CreateObject("TransferNode", new FacilityLocation(x, 0, y));
 }
 public BasicNode(IIntelligentObjects intelligentObjects, int x, int y, string distance)
 {
     @object  = intelligentObjects.CreateObject("BasicNode", new FacilityLocation(x, 0, y));
     Distance = (double.Parse(distance) * 1000) + "";
 }
 public BasicNode(IIntelligentObjects intelligentObjects, int x, int y)
 {
     @object  = intelligentObjects.CreateObject("BasicNode", new FacilityLocation(x, 0, y));
     Distance = "0";
 }
示例#7
0
 public Source(IIntelligentObjects intelligentObjects, int x, int y)
 {
     @object = intelligentObjects.CreateObject("Source", new FacilityLocation(x, 0, y));
 }
示例#8
0
        //--------------- Métodos para creación de obejtos diversos --------------------------------

        public void createTransferNode(string nombre, int x, int y)
        {
            intelligentObjects.CreateObject("TransferNode", new FacilityLocation(x, 0, y));
            model.Facility.IntelligentObjects["TransferNode1"].ObjectName = nombre;
        }
示例#9
0
 private static IIntelligentObject CrearObjecto(string tipo, double x, double y)
 {
     return(intelligentObjects.CreateObject(tipo, new FacilityLocation(x, 0, y)));
 }
示例#10
0
 public Combiner(IIntelligentObjects intelligentObjects, int x, int y)
 {
     @object = intelligentObjects.CreateObject("Combiner", new FacilityLocation(x, 0, y));
 }
示例#11
0
 public void createObject(String type, int x, int y)
 {
     intelligentObjects.CreateObject(type, new FacilityLocation(x, 0, y));
 }
示例#12
0
        /// <summary>
        /// Method called when the add-in is run.
        /// </summary>
        public void Execute(IDesignContext context)
        {
            var warnings = new List <String>();

            // This example code places some new objects from the Standard Library into the active model of the project.
            if (context.ActiveModel != null)
            {
                IIntelligentObjects intelligentObjects = context.ActiveModel.Facility.IntelligentObjects;
                IFixedObject        bed          = intelligentObjects.CreateObject("Bed", new FacilityLocation(0, 0, 0)) as IFixedObject;
                IFixedObject        sourceObject = intelligentObjects.CreateObject("Source", new FacilityLocation(-10, 0, -10)) as IFixedObject;
                IFixedObject        serverObject = intelligentObjects.CreateObject("Server", new FacilityLocation(0, 0, 0)) as IFixedObject;
                IFixedObject        sinkObject   = intelligentObjects.CreateObject("Sink", new FacilityLocation(10, 0, 10)) as IFixedObject;
                IEntityInstanceReferencePropertyDefinition modelentitiy = intelligentObjects.CreateObject("Patient", new FacilityLocation(-20, 0, -10))
                                                                          as IEntityInstanceReferencePropertyDefinition;
                ITransporterInstanceReferencePropertyDefinition regnurse = intelligentObjects.CreateObject("Worker", new FacilityLocation(-30, 0, -30))
                                                                           as ITransporterInstanceReferencePropertyDefinition;
                //var RNurseName = context.ActiveModel.Facility.IntelligentObjects["Worker1"];
                //RNurseName.Properties["Name"].Value = "RegularNurse";
                //var modelentitiy = context.ActiveModel.Facility.IntelligentObjects["Patient"];
                // Example of how to place some new link objects into the active model (to add network paths between nodes).
                // This example code places two new link objects: a Path connecting the Source 'output' node to the Server 'input' node,
                // and a Path connecting the Server 'output' node to the Sink 'input' node.
                INodeObject sourceOutputNode = sourceObject.Nodes[0];
                INodeObject serverInputNode  = serverObject.Nodes[0];
                INodeObject serverOutputNode = serverObject.Nodes[1];
                INodeObject sinkInputNode    = sinkObject.Nodes[0];
                INodeObject bedinputnode     = bed.Nodes[0];
                INodeObject bedoutputnode    = bed.Nodes[1];
                ILinkObject pathObject1      = intelligentObjects.CreateLink("Path", sourceOutputNode, serverInputNode, null) as ILinkObject;
                ILinkObject pathObject2      = intelligentObjects.CreateLink("Path", serverOutputNode, bedinputnode, null) as ILinkObject;
                ILinkObject pathObject3      = intelligentObjects.CreateLink("Path", bedoutputnode, sinkInputNode, null) as ILinkObject;

                // Example of how to edit the property of an object.
                // This example code edits the 'ProcessingTime' property of the added Server object.
                serverObject.Properties["ProcessingTime"].Value = "0";
                sourceObject.Properties["EntityType"].Value     = "Patient1";
                var defaultEntity = context.ActiveModel.Facility.IntelligentObjects["Patient1"];

                defaultEntity.Properties["RegNurseCheckTime"].Value       = "HospitalData.RNRounding";
                defaultEntity.Properties["TherapistCheckTime"].Value      = "HospitalData.TherapistRounding";
                defaultEntity.Properties["AssistantNurseCheckTime"].Value = "HospitalData.ANRounding";
                defaultEntity.Properties["BedStayTime"].Value             = "HospitalData.BedStayTime";
                defaultEntity.Properties["TherapistVisitTime"].Value      = "HospitalData.TherapistVisitTime";
                defaultEntity.Properties["RegNurseVisitTime"].Value       = "HospitalData.RegNurseVisitTime";
                defaultEntity.Properties["AssistantNurseNextVisit"].Value = "HospitalData.AssistantNurseNextVisit";
                ITable entitydatatable = context.ActiveModel.Tables.Create("HospitalData");
                var    i            = entitydatatable.Columns.AddEntityReferenceColumn("PatientTypes");
                var    mix          = entitydatatable.Columns.AddRealColumn("Mix", 0.0);
                var    admisiontime = entitydatatable.Columns.AddExpressionColumn("AdmissionTime", "0.0");
                (admisiontime as IUnitizedTableColumn).UnitType = SimioUnitType.Time;
                var rnrounding        = entitydatatable.Columns.AddExpressionColumn("RNRounding", "0.0");
                var nurserounding     = entitydatatable.Columns.AddExpressionColumn("ANRounding", "0.0");
                var therapistrounding = entitydatatable.Columns.AddExpressionColumn("TherapistRounding", "0.0");
                var bedtime           = entitydatatable.Columns.AddExpressionColumn("BedStayTime", "0.0");
                var RVisitTime        = entitydatatable.Columns.AddExpressionColumn("RegNurseVisitTime", "0.0");
                var TVisitTime        = entitydatatable.Columns.AddExpressionColumn("TherapistVisitTime", "0.0");
                var AVisitTime        = entitydatatable.Columns.AddExpressionColumn("AssistantNurseNextVisit", "0.0");
                //Add Resource Type List

                var resourceType = context.ActiveModel.NamedLists["ResourceType"];
                if (resourceType != null)
                {
                    warnings.Add(string.Format(FormatListMessage(resourceType.Name)));
                }
                else
                {
                    resourceType = context.ActiveModel.NamedLists.AddObjectList("ResourceType");
                    var firstRow = resourceType.Rows.Create();
                    firstRow.Properties[0].Value = "Source";
                    var secondRow = resourceType.Rows.Create();
                    secondRow.Properties[0].Value = "Server";
                    var thirdRow = resourceType.Rows.Create();
                    thirdRow.Properties[0].Value = "Patient";
                    var fourthRow = resourceType.Rows.Create();
                    fourthRow.Properties[0].Value = "RegNurse";
                    var fifthRow = resourceType.Rows.Create();
                    fifthRow.Properties[0].Value = "Therapist";
                    var sixthrow = resourceType.Rows.Create();
                    sixthrow.Properties[0].Value = "Ass.Nurse";
                    var seventhRow = resourceType.Rows.Create();
                    seventhRow.Properties[0].Value = "Sink";
                    var eigthRow = resourceType.Rows.Create();
                    eigthRow.Properties[0].Value = "Bed";
                    var ninthRow = resourceType.Rows.Create();
                    ninthRow.Properties[0].Value = "Worker";
                }
                //Adding Resource Table
                ITable resourceTable = context.ActiveModel.Tables["Resources"];
                if (resourceTable != null)
                {
                    warnings.Add(string.Format(FormatListMessage(resourceTable.Name)));
                }
                else
                {
                    resourceTable = context.ActiveModel.Tables.Create("Resources");
                    var j = resourceTable.Columns.AddObjectReferenceColumn("ResourceName");
                    j.FilterToResources = false;
                    j.IsKey             = true;
                    var resourceTypes = resourceTable.Columns.AddListReferenceColumn("ResourceType");
                    resourceTypes.ListName      = ("ResourceType");
                    resourceTypes.DefaultString = ("Bed");
                }
                ITable link = context.ActiveModel.Tables["LinkBetweenResources"];
                if (link != null)
                {
                    warnings.Add(string.Format(FormatLinkMessage(link.Name)));
                }
                else
                {
                }
                //var modelentity1 = context.ActiveModel.Facility.IntelligentObjects["Patient"];

                //modelentity1.Properties["BedStayTime"].Value = "5";
            }

            #endregion
        }
示例#13
0
        public void crearEntradaSalida()
        {
            intelligentObjects.CreateObject("Source", new FacilityLocation(-5.75, 0, -1));
            intelligentObjects.CreateObject("Sink", new FacilityLocation(47.5, 0, -1));

            model.Facility.IntelligentObjects["Source1"].ObjectName = "Entrada";
            model.Facility.IntelligentObjects["Sink1"].ObjectName   = "Salida";
        }
示例#14
0
 public void crearObjeto(string tipo, double x, double y)
 {
     intelligentObjects.CreateObject(tipo, new FacilityLocation(x, 0, y));
 }