vcProductCreatorTableMode
Configuration for table feed mode in vcProductCreator. Holds a list of rows, each defining which vcProductType to instantiate and at what simulation time. The rows are automatically sorted in ascending order by the product creation time. The rows can be loaded from a file or defined using methods of this class. Modifying the rows during simulation is allowed but may result in e.g. inaccurate timing of when the products are created.
To add new rows use vcProductCreatorTableRow.new(), configure the row and then call the addRow method.
Properties
Name | Type | Access | Description |
File | String | RW |
Uri pointing to an xls file where to load the rows. Changing the value will cause an immediate attempt to read the file and replace all ProductRows if successful. Any errors are printed to output.(Deprecated) Use the ReadRowsFromFile and ReplaceAllRows methods. |
RowCount | Integer | R | Gets the current product row count. |
ProductRows | List of vcProductCreatorTableRow | R | List of all currently defined product rows. The rows are returned as copies. |
Methods
Name | Return Type | Parameters | Description |
addRow | Integer | vcProductCreatorTableRow newRow |
Adds a new row as a copy. The row gets inserted immediately after all existing rows with the same or smaller product creation time. Returns index of the new row. Throws an exception if the new row contains invalid values. |
clearRows | None | None | Deletes all product rows. |
deleteRow | None | Integer index |
Deletes the product row at given index. The index must be in inclusive range 0 to RowCount – 1 |
getProperty | vcProperty | String name |
Returns a property matching a given name; otherwise returns None. |
getRow |
Integer index |
Returns a copy of a product row at the given index. The index must be in inclusive range 0 to RowCount – 1 |
|
readRowsFromFile |
List of vcProductCreatorTableRow |
String fileUri, Boolean showErrorMessages |
Attempts to load rows from an xls file and returns them as a list if successful. Does not modify this table mode configuration. Returns None if reading or parsing the file failed. If showErrorMessages is True, any errors are printed to the output. |
replaceAllRows | None | List of vcProductCreatorTableRow newRows |
Deletes all rows and then adds the new rows as copies. The rows are sorted by the creation time using a stable sort algorithm. Throws an exception if any of the new rows contains invalid values. |