Hi everyone,
I want to import my Arrivals Source from Excel into my Flexsim model.
One constraint is that each patient uses specific staff resources. Thus, I need to transform the string “Surgeon1” from my Excel file to the pointer “/Surgeon1” in my Flexsim source.
I have thus decided to proceed as follow:
- Import the Excel file in a Global Table G1
- Build a table G2 where the string values related to staff are transformed into pointers thank to Model.find() and the rest is just copied and pasted.
For now, my code looks like that :
/**Custom Code*/ Object current = param(1); Object patient = current; treenode activity = param(2); Token token = param(3); treenode processFlow = ownerobject(activity); Table G1 = Table("ImportExcel"); Table G2 = Table("SourceFlexsim"); int nb_rows_max = G1.numRows; int nb_columns_max = G1.numCols; int index_col_G1 =1; int index_row_G1 =1; for (int index_col_G1 =1; index_col_G1 <= nb_columns_max; index_col_G1+=1); { for (int index_row_G1; index_row_G1 <=nb_rows_max; index_row_G1+=1); { G2[index_row_G1][index_col_G1] = G1[index_row_G1][index_col_G1]; } };
However, only the first cell G1[1][1] is being copied in G2. Could you help me find a solution?
Also, will the model.find() method work in your opinion ?
Thanks in advance,
Leah