Search the Community
Showing results for tags 'table referencing'.
How do I access a table column by name using a table property defined for the model? In my model, I have multiple data tables each with the same named columns defined for each. Each table has a different number of rows. For a run or a set of replications, I want to select a table to use. I have defined a model-level table property named _SelectedTable to support this. During simulation runs, I want to access this selected table's data by row and column name. Specifically, I want to use this data to update model entity state variables. I also want to stop creating entities when all of the rows of the table have been accessed. I've tried two partial solutions to this problem (attached), but neither are ideal. 1. Create a large set of decide add-on processes to choose the decide the correct table and explicitly reference it by its name. This requires a lot of redundant steps and maintenance if tables are added or removed. The attached example contains just two tables. Controls OptionId and _SelectedTable must be set to either (Option1 and tableOption1) or (Option2 and tableOption2). The first control selects the Entity Type and the second selects the Table. 2. Using the column index number instead of the column name, I found I can use the table property to access the selected table. This method is prone to error if the table schema changes. It is also unclear which table properties, such as "AvailableRowCount" are accessible via this approach. The attached example contains two tables just as the previous. The control _SelectedTable chooses which table from which data is acccessed. In practice, the data tables will be substantially larger than the ones included in the attachments. Looking forward to constructive guidance, Ryan table_selection_by_name.spfx table_selection_by_column_number.spfx
Hello In my simulation model I need to scan rows for maximum value within a column, and then assign this maximum value to say a state variable so I can reference it in the responses to optimize using optquest. It would also be useful if I can add all the values within the column and use that instead for optimization. I am not quite able to figure out how to do this. Would appreciate any help in pointing me towards right direction! TIA!
I have 3 questions: 1) I have a data table, each row representing an entity to be created. I create several entities and assign each of them to each row in this data table, using a SetRow Process. I have read somewhere that after I set a row to an entity, it becomes or token? So what is a token exactly? 2) Also, after a created entity is set to a row in the data table, is there any special syntax I can use to make reference to values in other columns in this row? Or I still need to keep track of which row in the data table the entity is set to and make the references using the normal table referencing syntax accordingly? Thank you !