Defining Offsets for Inputs and
Outputs to a Spreadsheet Element
In some cases, you may want to specify the location in the spreadsheet file to which you are linking in terms of an offset from a defined location, in which the offset is defined by model variables (such as Time or Realization A single model run within a Monte Carlo simulation. It represents one possible path the system could follow through time.).
For example, you could instruct GoldSim to change the location to which it exports data based on the realization number, with results from each realization being exported to a different column in the spreadsheet file.
You do this by selecting the Offset... button when you are selecting a spreadsheet location while defining inputs or outputs to a Spreadsheet file:
When you press this button, the following dialog is displayed:
You select whether you want to offset by Sheet, Column, and/or Row by clicking the appropriate checkboxes. For example, if you were exporting a scalar An output consisting of a single value or condition. GoldSim output to the spreadsheet file, and wanted to export the value to Sheet1!A1 for realization 1, Sheet1!B1 for realization 2, and so on, you would simply do the following:
- Specify Sheet1!A1 for the Location in Spreadsheet
- Define the Column offset
as follows:
In this case, the offset would be 0 for Realization 1 (and hence the value would be exported to Sheet1!A1), it would be 1 for Realization 2 (and hence the value would be exported to Sheet1!B1), and so on.
Note: The offsets can be any expression with links to other GoldSim outputs, but should be specified as dimensionless, integer values. GoldSim will not accept expressions in these fields that have dimensions An output attribute for an element that defines the dimensionality (in terms of Length, Time and other fundamental dimensions) of the output.. Offsets defined as real numbers are truncated.
Note: If as a result of an offset, you try to access a cell that is invalid (e.g., if you specify a negative offset from the first column), GoldSim will display a fatal error message at runtime.
If you wish to use a particular unit of time to define an offset, you must cast the output to a dimensionless number. For example, Time|day| will represent the number of days (which could be fractional, and hence will be truncated). Note that Run Properties A set of fundamental properties that track the progress of the simulation (e.g., Time, Realization) and can be referenced like outputs in expressions. like Day and Year are, by definition, dimensionless.
When you close the Offset dialog and have a defined offset, this is indicated in the Spreadsheet Location (Offset... is checked) and in the list of inputs and outputs (any offset ranges are indicated as such).
Warning: In order to properly use offsets, you must have a good understanding of the conditions and settings that control when GoldSim exchanges data with the spreadsheet file.
An example model which includes an illustration of the use of offsets for a Spreadsheet element An element that can dynamically link to an Excel spreadsheet. (Spreadsheet.gsm) can be found in the General Examples folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu).
Learn more
- Controlling When GoldSim Exchanges Data with the Spreadsheet File
- Defining Offsets for Inputs and Outputs to a Spreadsheet Element
- Defining the Properties of a Spreadsheet Element
- Exchanging Date Information with a Spreadsheet
- How Spreadsheet Files are Affected By GoldSim
- Importing Stochastic Element Definitions from a Spreadsheet
- Locking onto a Spreadsheet File
- Saving Spreadsheet Element Outputs
- Shifting Ranges for Inputs and Outputs to a Spreadsheet Element
- Spreadsheet Element Inputs - Exporting Data to the Spreadsheet
- Spreadsheet Element Outputs - Importing Data from the Spreadsheet
- Using the Spreadsheet Wizard to Define Spreadsheet Inputs
- Using the Spreadsheet Wizard to Define Spreadsheet Outputs
- Viewing a Spreadsheet Element in the Browser