Jump to content

Recommended Posts

Posted

Hi


I wonder how I can write the results of multiple replications of a model in a single file. In other words, Simio doesn't write over previous run data.


Thanks

Posted

I thought I would be easy to change Write step, but the fact each replication is in a separate file has a reason.


Simio can run multiple replications at once. And using External it crates say 4 processess each with one replication. Each process can run in a different thread.

But these processess cannot write in one file simultanously.

So I recommend using this Makro to join files together.


Sub LoopThroughFiles()

Application.DisplayAlerts = False

i = 0

Dim StrFile As String

StrFile = Dir("C:\Users\.....\NameOfExcelFile*")

Do While Len(StrFile) > 0



Workbooks.Open Filename:=StrFile

Sheets("Sheet1").Activate

Range("A1").Select

Range(Selection, Selection.End(xlToRight)).Select

Range(Selection, Selection.End(xlDown)).Select

Selection.Copy

Workbooks("vysledky_makro.xlsm").Activate

Sheets("Sheet2").Activate

If Range("A1") = "" Then

Range("A1").Select

Else

Range("A1").End(xlDown).Offset(1, 0).Select

End If


Selection.PasteSpecial xlPasteAll

i = i + 1

Workbooks(StrFile).Close

StrFile = Dir

Loop

End Sub

Posted

Thanks for your reply Tulach. I dont know how to tell Simio to record result of each replication in a separate file and not overwrite the previous rep. Can you let me know how?


Thanks

Posted

You dont have to do anything. Just run Experiment and if your ExcelConnect is file results.xlsx Experimenter will produce files

results_Exp1_scen1_rep1.xlsx

results_Exp1_scen2_rep4.xlsx


and so on.


If you have problem with overwriten data in excel you should probably increment some State e.q. ExcelRow(int) after Each use of ExcelWrite step.

×
×
  • Create New...