Jump to content

Search the Community

Showing results for 'write csv'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Simio Public Forums
    • Welcome and How To Become a Simio Insider
    • Simio News and Announcements
    • Simio Product Details
    • Simio-Related Positions Desired or Positions Available
    • Help Getting Started with Simio
  • Forums for Simio Insiders Only (See Public Forums Welcome topic to sign up)
    • SI General Discussions
    • SI Sprint Releases
    • SI Shared Items
    • SI Ideas and Suggestions
    • SI Known Issues and Workarounds
    • SI Performance Tips
    • SI Non-US Cultures
    • SI Student Competition
    • SI Educational
    • SI Libraries and Objects
    • SI Animation and Visualization
    • SI Distributions, Functions, and Expressions
    • SI Simio Tabs
    • SI Experimentation and Optimization
    • SI Functional Approaches
    • SI Industries / Domains
    • SI Types of Simulation
    • SI Emulation
    • SI API

Categories

  • Files
    • Academic Information
    • Product Information
    • Case Studies

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


First Name


Last Name


Company/University Name


OCCUPATION


ICQ


WEBSITE


YAHOO


AOL


LOCATION


FACEBOOK


GOOGLEPLUS


SKYPE


TWITTER


YOUTUBE

  1. Hi Indsiders, after 30 hours of simulation i get this error message from a DB Write Step: Exception from Step "StepName" execution.Object reference not set to an instance of an object. I dont know why i get this error, cause all entities before where able to execute this step. Is someone able to give me an adivise with this informations ? Beste regards, Benjamin
  2. Hi All,

    I have a server and I have to write out in a csv whenever the resource state of the server changes like from processing to blocked  or from blocked to processing and so on, I do not have a RPS version. any suggestions to this will be really helpful. Thanks

    Unmesh

    1. gocken

      gocken

      Hi Chandak, 
      from definitions tab add a monitor element (i.e., monitor1) in your model and set its state variable name property to i.e., Server1.ResourceState. Also, from definitions tab include an excelconnect element which is a user defined element. set its excel workbook property as i.e., resource_state.xlsx (create a resource_state.xlsx file in the same folder where your .spfx file will run). In processes tab create a new process i.e., Process 1 and in there place an assign step and an excel write step (from user defined steps). Define a state variable i.e., row_index. in assign step set state variable name property as row_index and set new value property as row_index+1. In excel write step set excelconnect property as ExcelConnect1, set worksheet as "sheet 1" (resource_state.xlsx excel file's sheet name), set row as row_index, leave starting column property as default, and add two items such as "ResourceState" and "Run.TimeNow". at last, select process1 and set triggering event name as Monitor1.Event. 
      also, in order to get different resource states in your excel file you can define a work schedule or a failure mechanism on your server object. Hope it works?  

    2. Unmesh.Chandak

      Unmesh.Chandak

      Dear Gocken,

      Thank you so much for your response. That is really helpful. Appreciate it.

      Regards,

      Unmesh

  3. Today, I found this topic talks about updating data in real-time when simulation is running. I thought it could be useful for me in the future so I decided to try it myself. But, when I used the Read/ExcelRead Step, I found it only "read" the external file at the first time: It seems the Read Step creates a copy of the external file at the first read and then it will use the copy for the future reads within the simulation. For example, at the start of my simulation, I used a button to call ExcelRead Step to read a excel file. Then, I manually changed some values in the excel file and I called the ExcelRead Step again. However, the second ExcelRead Step didn't read the changed values.If I want to use the changed values, I need to restart the simulation. For the Write/ExcelWrite Step, only when I stop the simulation, the external file will be updated. If I don't stop the simulation, no matter how many times I call Write/ExcelWrite Step, the external file is not changed. Are these kinds of behavior bugs? Because from the above topic, I think the Read and Write step can update the external file within the simulation. My Simio version is 12.207.20659. Thanks to everyone in advance!
  4. Hi All, I am using the write step in my logic but i am unable to write a string in csv, how can i do that? it is unable to convert element reference to string below is the error. Thank you.
  5. How can I use the TableName.PropertyName.RandomRow function in these two situations? 1. If the column of the weights (PropertyName) is determined during the simulation. 2. If I don't want all the rows to be taken into account. For example, only the rows that meet a condition based on other columns in the table. Given Table1 as in the following figure : StringProperty# columns are the filters and RealProperty# columns the weights used for function Random.Row. So, for situation : 1. I want to select one of the RealProperty# columns during the simulation but if I do that I can not use RandomRow because I need to write down the column name (PropertyName). Any suggestions for that? 2. I only want to use the weights that are associated between the rows that have A and X in the first two columns and that, therefore, the selected row is between one of those. Thank you in advance.
  6. Hey, I've got a quick question on how to route to a combiner with the longest waiting time in their parent queue. I think it should be quite easy, but i cant seem to make it work. What i have been doing is setting the selection goal of my routing node to largest value, and select from a list. This largest value I think should be the the longest waiting time in the contents of the parentinput queue. I have tried this multiple ways both using assosiated object and without. When i recall the number waiting it seems to work, but with recalling the waiting time i'm doing something wrong. My current expression is: Candidate.Node.AssociatedObject.Combiner.ParentInputBuffer.Contents.TimeWaiting(ModelEntity) or Candidate.Combiner.ParentInputBuffer.Contents.TimeWaiting( object ) both seem to work for content.numberwaiting. I think i am describing the ( object ) part wrong but cant find how i should write for the modelentity otherwise. I have tried to recall a specific entititype like so --> TimeWaiting(Truck) this also does not work. Does somebody know how i can acces the ParentInputBuffer.Contents.TimeWaiting? Greeting Piet
  7. Yes it is possible. There are very good simbits about this also with loopback rules and predecessor method. Write task sequence in simbits you will see it. Hope it helps.
  8. This script will combine output files from Experiments that use the Write Step. It will average the cells across all selected sheets, and is designed to work with .CSVs that are the same shape. In R Studio, the code needs to be ran as "source" y = 1 x = 1 fileIterate = 1 readline(prompt="Press Enter To Select Files: ") fileSave <- choose.files(default = "", caption = "Select files", multi = TRUE, filters = Filters, index = nrow(Filters)) readline(prompt="Press Enter To Select Output Folder: ") outputFolder <- choose.dir(default = "", caption = "Select folder") fileName <- readline(prompt="Enter Output File Name: ") buildFile <- read.csv(fileSave[fileIterate], header = TRUE, sep = ",") fileIterate = fileIterate + 1 while(fileIterate <= length(fileSave)) { holderFile <- read.csv(fileSave[fileIterate], header = TRUE, sep = ",") while( y <= ncol(buildFile)){ while(x <= nrow(buildFile)){ buildFile[x,y] <- mean(holderFile[x,y],buildFile[x,y]) x = x + 1; } y = y +1; x = 1; } x = 1 y = 1 fileIterate = fileIterate + 1 } fileName <- paste(fileName, ".csv") outputTheFile <- paste(outputFolder, fileName,sep = "\\") write.csv(buildFile, file = outputTheFile)
  9. Hi, Sometimes when a long question is asked, no one answers. Here is a short question: how can I enable the Write add-on step to report all replications into one excel file rather than reporting replications into multiple excel files, one for each replication? Thank you,
  10. One easy way is to build an output table and write there the timenow every time the vehicle fails o it's repaired. Here's an example. Hope this helps Rds. Mauricio Example Failing Vehicle.spfx
  11. This fixed the outstanding bug where writing in an experiment would dump all csv files in the simulation root directory, ignoring the relative directories you specify in the file path in the file element. The fix was trivial, and I am sure I have raised it several times both on this forum. I made the fix a few months ago, and have kept meaning to post it here (if indeed I have not already). The problem with unofficial fixes is that it is another moving part to update, keep track of, and adds to installation complexity. I have lost previous fixes twice (due to fresh re-installs). Essentially "fileNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(fileName);" was the culprit. I changed the "_writerFileName" directive from using the above variable to: _writerFileName = "fileName + "_" + simioScenarioName + "_Rep" + simioReplicationNumber + fileExtension;" I could do something neater (as the current output will have a ".csv" in the middle of the name), but did not spend any time on this. It would be appreciated if this was fixed and applied to the official write block (even if as a toggleable option), as due to the over-zealous licensing terms, the DLL will not load on an unlicensed client... meaning I have to choose between having the bug fixed and not dumping hundreds of thousands of CSV files in my simulation root... or causing clients considerable inconvenience by writing hundreds of thousands of CSV files into their simulation root. Here is the relevant code extract in the file element: if (String.IsNullOrEmpty(fileName) == false) { string fileRoot = null; string fileDirectoryName = null; string fileNameWithoutExtension = null; string fileExtension = null; try { fileRoot = System.IO.Path.GetPathRoot(fileName); fileDirectoryName = System.IO.Path.GetDirectoryName(fileName); fileNameWithoutExtension = System.IO.Path.GetFileNameWithoutExtension(fileName); fileExtension = System.IO.Path.GetExtension(fileName); } catch (ArgumentException e) { data.ExecutionContext.ExecutionInformation.ReportError(String.Format("Failed to create runtime file element. Message: {0}", e.Message)); } string simioProjectFolder = _data.ExecutionContext.ExecutionInformation.ProjectFolder; string simioExperimentName = _data.ExecutionContext.ExecutionInformation.ExperimentName; string simioScenarioName = _data.ExecutionContext.ExecutionInformation.ScenarioName; string simioReplicationNumber = _data.ExecutionContext.ExecutionInformation.ReplicationNumber.ToString(); if (String.IsNullOrEmpty(fileDirectoryName) || String.IsNullOrEmpty(fileRoot)) { fileDirectoryName = simioProjectFolder; fileName = fileDirectoryName + "\\" + fileName; } _readerFileName = fileName; if (String.IsNullOrEmpty(simioExperimentName)) _writerFileName = fileName; else _writerFileName = fileName + "_" + simioScenarioName + "_Rep" + simioReplicationNumber + fileExtension; } Using relative file paths worked at one stage, and was later broken. Below are two threads with work around un-offical dlls that probably implement the fix nicer. 10/07/2012 - http://www.simio.com/forums/viewtopic.php?f=19&t=829 07/12/2012 - http://www.simio.com/forums/viewtopic.php?f=20&t=987 TextFileReadWrite_compiled.zip TextFileReadWrite_source.zip
  12. NOTE....Code has been removed from this post. Please use the DB Read and DB Write steps that are provided when Simio is installed. There is a DBReadWrite simbit. The code is provided in C:\Users\Public\Documents\Simio\Examples\UserExtensions\DbReadWrite
  13. NOTE....Code has been removed from this post. Please use the Excel Read and Excel Write steps that are provided when Simio is installed. There is a ExcelReadWrite simbit. The code is provided in C:\Users\Public\Documents\Simio\Examples\UserExtensions\ExcelReadWrite ExcelReadWrite.zip
  14. Hi, See attached model that uses an output table to log information on each entity. You could just as easily you an ExcelWrite/Write Step to do the same thing. Cheers, Lucas. Data Table Entity Log.spfx
  15. Hi Jim, May be there are many possible ways to follow to get the information you want. But, I suggest you to use a search step for searching a server's (or any other object's) processing queue to get such information. You can search not only the server's processing queue but also the whole "entity population" to get whole state variable's defined on them at any arbitrary time thoughout the simulation run. All you have to do is to define additional expressions on search step. In the example file attached a simple model is developed to get entities' state variables residing at server1's processing queue. Here note that, you have to click button at arbitrary times. Then, if 3 or more entities exist at server1.processing queue, the search step founds the first 3 of them (since a forward search is performedin this sample model) then later an excel write step writes entities created time (you can get many state variables of entities written on the same excel file). You can change search limit, queue state name, include a match condition etc. If you want to get such information at the beginning or at the end of the simulation run you should use this same logic at appropriate processes (onrunending, onruninitialized etc...). Also, you can get these information written on either a database or an output table as well. Hope this helps? getting a snaphot of Entity WIP via a button.spfx entities_processing.xlsx
  16. Hi Gocken, Thank you for your kind and quick response! I really like this use of a button! Unfortunately, I was not clear enough. As entities move through the system they carry quite a lot of state information. Our desire is at end or replication or an arbitrary time like a button click which a neat idea, to take an inventory of all the entities AND their states. This would mean capturing all the entities in each processing queue and through a write step. writing them out, either to an output table or a CSV. This operation is a bit complex. It does not seem one can search a processing queue to sequentially write out its members properties. I believe it is possible to maintain the residence of servers by maintaining that in a special output table which is tedious to maintain and set up. I greatly appreciate your response! Best Regards, Jim
  17. Hi again Liz. I found the problem but it wasn't easy to figure out with the RowForKey formula. I used the search function with tablerows as collection type. When I filtered the trace on the search and tally process, I found that the the table index of the found item and index of the search function was not the same in some cases especially for "small" type products. Further even the available row count of the products table was not returning the correct number rows in the table. The products table has 810 rows but it was finding 197 rows only in the search function. I had a separate "productsize" table which consists of "size" key string property and some other real type properties such as forklift capacity for each product size. I had used this productsize.size as foreign key in my main products table. I figured that the search function automatically filters to the products those matches the size of the product eventhough in search function match condition I only write ModelEntity.EntityType==Products.ProductName. When I removed the foreign key from the products table the problem was solved. Thanks for your help anyway. It was very useful and saved a ton of time from me.
  18. Thank you so much Liz! I understand exactly what you mean. However we thought that using Tallies would give more correct results for the average value calculations. I am also thining that running and add on process on "run ending" would allow me to calculate the distances statistics for all the entities even if they are not destroyed. Now I know how to calculate it but there are around 800 different product types. So I have to write 800 if conditions saying if decide, entity.type.name == "A" is true, Tally "distanceonforkliftA", on false exit, if decide entity.type.name == "B", Tally "distanceonforkliftB" etc. Is there a way to automatically create tally statistics for each entity instance?
  19. Hello everyone, I met a problem during the use of 'CallMatlab' UserExtension process. I am using Simio 8, MATLAB 2019a, and Windows 10, following the process introduced here: The problem is that when Simio is trying to call MATLAB function, some files are not registered and a certain dll cannot be found. Has anyone met such a problem before? Or is there anyway to write the CallMatlab myself? Thank you. Shu
  20. Hi, Your issue is that Input@STBR_01_54 is a reference to a Simio object. You want to write out the string name of the object. You should use Input@STBR_01_54.Name Regards, Lucas
  21. Thanks Adam for the reply. I know a fair amount about Processes; I just needed a clarification about some aspects related to large models created using tables. The example I mentioned in the original post may be simple but it could easily scale to include 100's of locations. I will give some examples of these aspects that get tricky in such large models below. Thanks Glenn for the clarification. The tip about finding where processes are being referenced in a model is great! The MultiEchelonSupplyChain example may look simple, but it has the potential to be complex. When I asked the question what I had in mind is a similar model but with 100s of locations like DistributionCenter and Retailer (Basic Nodes). Imagine you want 300+ basic nodes (like in my case) to have the same add-on process. Imagine having 300+ inventory elements that you want to write statistics for using a Write step. It's tedious to do things manually. As for referencing the same add-on process for 100s of objects (basic nodes in my case), I found a trick, which is to add the add-on process to one of the objects and then sub-class it so that the process becomes a default for the newly sub-classed object. Then change all the other objects to the new sub-classed object. As for writing statistics for 300+ inventory elements, I couldn't find a way to automate the process. To be clear, I want (for each inventory element) to write statistics at various points throughout the simulation run. The standard reported stats for inventory elements are only "Totals" or "Averages" or a function of the two. What I want is to see how a statistic changes over time, so I need to write to a CSV file using a Write step. When working with large models, there's a need for automating some modeling aspects. Creating objects and elements can be easily automated using tables. It's dealing with these created objects and elements that sometimes needs tricks and workarounds to automate.
  22. Hi everybody! I have a problem at the moment that defines a state variable in an output table. In my example, I defined an integer state variable which tried to give a reference for the row in the output table. Then, I assign on server state assignments the time in process and tried to write it on the output table. I attach the file so it can be better understood. thanks for helping me!
  23. As we approach our final stage of our bachelor studies, it is necessary to write a bachelor thesis. In this context we are developing a Simio Plugin, which enables advanced model-management and more important, model-comparison. Our main objective is to provide the Simio Community a properly working Plugin, which improves the modelling process itself and the usability within large Simio-projects. What could you expect? Functionality We separate the plugin in two logical components. The first one is called Modelmanagement. The features of this component are the following: • Versioning models • Clone an existing model The interesting part on this feature is the clone mechanic. You are now able to create an identic clone of an existing Simio-model, which can be altered afterwards. This functionality is key to the comparison process. With this clone-function, each clone now represents a version of your base-model. The clones can be altered autonomically. It enables to test and experiment with the behavior of your model, without many workarounds. It may help you to even optimize your model. The second and more focused feature is the ModelComparer. Once you are done cloning and altering your models, this feature helps you to compare several experiments. The comparison isn’t only limited to experiments within one model, you can compare all the cloned experiments as well. Our model-comparison compares responses of several, different experiments. You can now compare all your clones to determine which one is the most efficient. What are we delivering at this point and why? Attached to this post you can find several files. To ease the installation and setup process of the Plugin, we also created an installer. The installer will setup the required changes and files for our Plugin. It is easy to use and enables the full functionality, like a normal software-installer. Second, we wrote a short manual to show you the features of the Plugin and illustrated it with pictures. Our goal is to gahter feedback as early as possible. Currently, we are in the middle of development and are eager to improve the tool even more. We ask you for your feedback, because it is very important for us to find out, if the tool is viable, how its usability is and if the provided functionality is even appreciated within the community. As we mentioned we are halfway through the development-process, the possibility is given, that some bugs or errors may occur. We also would be very pleased if you could take the time to report these and your experience with the tool and fill in the online survey. Your feedback is very appreciated! Link to the online Survey: http://30raqy.findmind.ch Thank you, Philipp Bütikofer Anthony Delay HSR - Hochschule für Technik Rapperswil Oberseestrasse 10 8640 Rapperswil ModelComparison.zip UserManual.pdf SimioToolsInstaller.zip
  24. Thanks Gustavo, actually what worked for me was ContainerEntity.Location.Parent.Name! Anyway thank you very much. I have another doubt which I think is far more complicated. I have two "streets" with a container entity moving moving along each of them. This streets have both fillers and emptiers, and I wish to write in excel every time a container entity goes from a filler to an emptier and how long that took. For example if my container on street 1 goes from filler_2 to emptier_6 I would like a row in excel with those 3 columns: starting filler, ending emptier and time between. I achieved this without problem for one of the streets (adding add on process triggers to all of the fillers and another for all of the emptiers). The thing is when I add this same processes to the emptiers/fillers of street 2, my excel goes crazy and obviously because of two reasons: the time I register to calculate time between is being updated in both streets every time a container goes out of an emptier, and exactly the same happens with the row that this 3 things have to be written in the excel. I don't know hoy I can manage to construct the variables time and row_count without them getting confused and hence my excel becoming useless. Thanks, again!!!
  25. Gustavo, how can I register ContainerEntity.CurrentStation as a string? As to write it in excel with excel write step afterwards. Thanks again!
×
×
  • Create New...