public void CreateServer( IIntelligentObjects intelligentObjects, int x, int y, string probabilidad, string processingTime, string initialCapacity, string tiempo, string distancia, string nombre, INodeObject deEntrega, INodeObject aSink ) { Server server = new Server(intelligentObjects, x, y); server.UpdateProcessingTime(processingTime); server.UpdateInitialCapacity(initialCapacity); server.UpdateInputBufferDecisionType("Probabilistic"); server.UpdateInputBufferBalkConditionOrProbability("0.08"); server.UpdateInputBufferBalkNodeName("IrSalida"); server.UpdateName(nombre); if (tiempo != null) { TimePath path = new TimePath(intelligentObjects, deEntrega, server.GetInput()); path.UpdateSelectionWeight(probabilidad); path.UpdateTravelTime(tiempo); } else { Path path = new Path(intelligentObjects, deEntrega, server.GetInput()); path.UpdateSelectionWeight(probabilidad); path.UpdateDrawToScale("False"); path.UpdateLogicalLength(distancia); } TimePath timePath = new TimePath(intelligentObjects, server.GetOutput(), aSink); timePath.UpdateTravelTime("18/60"); }
private IIntelligentObject seekForName(String name) { //IIntelligentObject entity = null; IIntelligentObjects list = model.Facility.IntelligentObjects; return(list[name]); }
/// <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"; } }
private void CreateMap(IIntelligentObjects intelligentObjects) { CreateRegions(intelligentObjects); List <BasicNode> list = Util.ReadCSV.GetCoordanates(intelligentObjects); int countList = list.Count; if (countList > 0) { BasicNode last = list[countList - 1]; BasicNode current; Path path; for (int i = 0; i < countList; i++) { current = list[i]; if (current == last) { path = new Path(intelligentObjects, last.GetInput(), list[0].GetInput()); } else { path = new Path(intelligentObjects, current.GetInput(), list[i + 1].GetInput()); } path.UpdateDrawToScale("False"); path.UpdateLogicalLength(current.Distance); current.UpdateName("P" + (i + 1)); } } }
public void SetDestinationStation(IIntelligentObjects intelligentObjects, INodeObject destinationstation, string distance, string probability) { Path path = new Path(intelligentObjects, station.GetOutput(), destinationstation); path.UpdateDrawToScale("False"); path.UpdateLogicalLength(distance); path.UpdateSelectionWeight(probability); }
public Form1() { proyectoApi = SimioProjectFactory.LoadProject(rutabase, out warnings); modelo = proyectoApi.Models[1]; intelligentObjects = modelo.Facility.IntelligentObjects; InitializeComponent(); }
public Form1() { APIProject = SimioProjectFactory.LoadProject(rutabase, out warnings); modelo = APIProject.Models[1]; InteligentObject = modelo.Facility.IntelligentObjects; InitializeComponent(); }
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); }
public ApiSimio(String rbase, String rfinal) { rutabase = rbase; rutafinal = rfinal; proyectoApi = SimioProjectFactory.LoadProject(rutabase, out warnings); model = proyectoApi.Models[1]; intelligentObjects = model.Facility.IntelligentObjects; }
public Objetos() { //creamos el constructor de la clase en el cual se creara el proyecto y // vamos a utilizar el modelo base para poder crear los elementos necesarios // para la consturccion de los datos correspondientes. proyectoApi = SimioProjectFactory.LoadProject(rutabase, out warnings); model = proyectoApi.Models[1]; intelligentObjects = model.Facility.IntelligentObjects; }
private void CreateCard201504420(IIntelligentObjects intelligentObjects) { Draw.NumberCreator.CreateTwo(intelligentObjects, 0, -340); Draw.NumberCreator.CreateZero(intelligentObjects, 40, -340); Draw.NumberCreator.CreateOne(intelligentObjects, 80, -340); Draw.NumberCreator.CreateFive(intelligentObjects, 110, -340); Draw.NumberCreator.CreateZero(intelligentObjects, 150, -340); Draw.NumberCreator.CreateFour(intelligentObjects, 190, -340); Draw.NumberCreator.CreateFour(intelligentObjects, 230, -340); Draw.NumberCreator.CreateTwo(intelligentObjects, 270, -340); Draw.NumberCreator.CreateZero(intelligentObjects, 310, -340); }
private static void CrearNombreYApellido() { try { proyectoApi = SimioProjectFactory.LoadProject(BASE, out warnings); intelligentObjects = proyectoApi.Models[1].Facility.IntelligentObjects; CrearNombre(); CrearApellido(); SimioProjectFactory.SaveProject(proyectoApi, FINAL_NOMBRE, out warnings); } catch { } }
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()); }
private IIntelligentObject seekForName(String name) { //IIntelligentObject entity = null; IIntelligentObjects list = _modelo.Facility.IntelligentObjects; foreach (var entity in list) { if (entity.ObjectName == name) { return(entity); } } return(null); }
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 void CreateCards() { 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; CreateCarnet201503918(intelligentObjects); CreateCard201504420(intelligentObjects); SimioProjectFactory.SaveProject(project, CARD_MODEL_PATH, out warnings); System.IO.File.WriteAllLines(WARNINGS_FILE_PATH, warnings); } catch (Exception e) { System.IO.File.WriteAllText(WARNINGS_FILE_PATH, e.Message); } }
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; CreateMap(intelligentObjects); CreateShips(intelligentObjects); CreatePointCardinal(intelligentObjects); CreateAirports(intelligentObjects); 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); } }
private void CreateShips(IIntelligentObjects intelligentObjects) { if (intelligentObjects["P19"] is INodeObject P19 && intelligentObjects["P20"] is INodeObject P20) { Source sourceShips = new Source(intelligentObjects, 20, -83); sourceShips.UpdateEntityType("Nave"); sourceShips.UpdateInterarrivalTime("Random.Exponential(15)"); sourceShips.UpdateMaximumArrivals("15"); sourceShips.UpdateName("DespliegueDeNaves"); Path path1 = new Path(intelligentObjects, sourceShips.GetOutput(), P20); path1.UpdateLogicalLength("34355"); Sink sink = new Sink(intelligentObjects, 20, -85); sink.UpdateName("AterrizajeDeNaves"); Path path = new Path(intelligentObjects, P19, sink.GetInput()); path.UpdateDrawToScale("False"); path.UpdateLogicalLength("34355"); path.UpdateSelectionWeight("200"); } }
public void Execute(IDesignContext context) { if (context.ActiveModel != null)// if there are tables in the facility { IIntelligentObjects intelligentObjects = context.ActiveModel.Facility.IntelligentObjects; string filename = @"C:\Users\Simiotest\Resources.csv"; // Displays an OpenFileDialog so the user can select a Cursor. OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "CSV Files|*.csv"; openFileDialog1.Title = "Select a CSV File"; // Show the Dialog. // If the user clicked OK in the dialog and // a .CUR file was selected, open it. if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { // Assign the cursor in the Stream to the Form's Cursor property. filename = openFileDialog1.FileName; } using (CsvFileReader reader = new CsvFileReader(filename)) { CsvRow row = new CsvRow(); while (true) { String columnNames = reader.ReadLine(); String[] colNameTypeStr = columnNames.Split(','); foreach (String properties in colNameTypeStr) { if (properties == "") { continue; } String[] colNameTypeArr = properties.Split(';'); Tuple <String, String, String> objectProperties = new Tuple <String, String, String>(colNameTypeArr[0], colNameTypeArr[1], colNameTypeArr[2]); var objectname = context.ActiveModel.Facility.IntelligentObjects[objectProperties.Item1]; objectname.Properties[objectProperties.Item2].Value = objectProperties.Item3; } } } } }
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"); }
private static void CrearCarnet() { try { proyectoApi = SimioProjectFactory.LoadProject(BASE, out warnings); intelligentObjects = proyectoApi.Models[1].Facility.IntelligentObjects; CrearDos(10, 50); CrearCero(50, 50); CrearUno(90, 50); CrearCinco(120, 50); CrearCero(160, 50); CrearCuatro(200, 50); CrearCuatro(240, 50); CrearDos(280, 50); CrearCero(320, 50); SimioProjectFactory.SaveProject(proyectoApi, FINAL_CARNET, out warnings); } catch { } }
public RegionStation( string name, IIntelligentObjects intelligentObjects, int x, int y, string interarrivalTime, string capacityStation, string processingTime, string probability ) { source = new Source(intelligentObjects, x, y); source.UpdateInterarrivalTime(interarrivalTime); source.UpdateName("Llegada_" + name); source.UpdateEntityType("Turista"); station = new Server(intelligentObjects, x + 2, y + 2); station.UpdateInitialCapacity(capacityStation); station.UpdateProcessingTime(processingTime); station.UpdateName("Estacion_" + name); station.GetOutput().Properties["OutboundLinkRule"].Value = "By Link Weight"; exit = new Sink(intelligentObjects, x + 4, y); exit.UpdateName("Salida_" + name); new Path(intelligentObjects, source.GetOutput(), station.GetInput()); Path path = new Path(intelligentObjects, station.GetOutput(), exit.GetInput()); path.UpdateDrawToScale("False"); path.UpdateLogicalLength("0"); path.UpdateSelectionWeight(probability); }
/// <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. var TableNameUserSpecified = context.ActiveModel.Properties["TableName"].Value; var columnNameObject = context.ActiveModel.Properties["ObjectsRefColumnName"].Value; var columnObjectCreator = context.ActiveModel.Properties["ObjectsColumnName"].Value; var Xlocation = context.ActiveModel.Properties["XLocation"].Value; var ZLocation = context.ActiveModel.Properties["ZLocation"].Value; if (context.ActiveModel != null) { if (context.ActiveModel.Properties["TableName"].Value != "null") { IIntelligentObjects intelligentObjects = context.ActiveModel.Facility.IntelligentObjects; var table = context.ActiveModel.Tables[TableNameUserSpecified]; context.ActiveModel.BulkUpdate(model => { foreach (IRow row in table.Rows) { //var Xlocationdefn = context.ActiveModel.Facility.IntelligentObjects[row.Properties[Xlocation].Value]; //(Xlocationdefn as IUnitizedTableColumn).UnitType = SimioUnitType.Length; //var Zlocationdefn = context.ActiveModel.Facility.IntelligentObjects[row.Properties[ZLocation].Value]; //(Zlocationdefn as IUnitizedTableColumn).UnitType = SimioUnitType.Length; var io = context.ActiveModel.Facility.IntelligentObjects[row.Properties[columnNameObject].Value]; io = context.ActiveModel.Facility.IntelligentObjects.CreateObject(row.Properties[columnObjectCreator].Value, new FacilityLocation(Double.Parse(row.Properties[Xlocation].Value), 0, Double.Parse(row.Properties[ZLocation].Value))); io.ObjectName = row.Properties[columnNameObject].Value; } }); } #endregion } }
/// <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; 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"); //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; // j.DefaultValueInstantiation = DefaultValueInstantiation.AutoCreateInstance; j.AutoCreatedOffsetX = "XLocation"; j.AutoCreatedOffsetY = "0.0"; j.AutoCreatedOffsetZ = "ZLocation"; var resourceTypes = resourceTable.Columns.AddObjectTypeReferenceColumn("ResourceType"); // resourceTypes. = ("ResourceType"); resourceTypes.DefaultString = ("Bed"); var xl = resourceTable.Columns.AddRealColumn("XLocation", 0.0); (xl as IUnitizedTableColumn).UnitType = SimioUnitType.Length; var zl = resourceTable.Columns.AddRealColumn("ZLocation", 0.0); (zl as IUnitizedTableColumn).UnitType = SimioUnitType.Length; } ITable linkTable = context.ActiveModel.Tables["LinkTable"]; if (linkTable != null) { warnings.Add(string.Format(FormatListMessage(resourceTable.Name))); } else { linkTable = context.ActiveModel.Tables.Create("LinkTable"); var nodeLists1 = linkTable.Columns.AddNodeReferenceColumn("Node1"); var nodeLists2 = linkTable.Columns.AddNodeReferenceColumn("Node2"); } } #endregion }
public BasicNode(IIntelligentObjects intelligentObjects, int x, int y) { @object = intelligentObjects.CreateObject("BasicNode", new FacilityLocation(x, 0, y)); Distance = "0"; }
public IIntelligentObjects getObjectList() { IIntelligentObjects list = model.Facility.IntelligentObjects; return(list); }
public llenarCarnet() { apiCarnet = SimioProjectFactory.LoadProject(ruta, out warnings); model = apiCarnet.Models[1]; intelligentObjects = model.Facility.IntelligentObjects; }
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 objetos() { practica4 = SimioProjectFactory.LoadProject(ruta, out warnings); model = practica4.Models[1]; intelligentObjects = model.Facility.IntelligentObjects; }
public TransferNode(IIntelligentObjects intelligentObjects, int x, int y) { @object = intelligentObjects.CreateObject("TransferNode", new FacilityLocation(x, 0, y)); }