Price data reader
CLEM.FilePricing
Reads external price data and manages resource prices during the simulation

The Data reader components are used to read external data for use by CLEM. They can be placed anywhere within the simulation branch of the APSIM simulation. It is recommended to place them with the activities using them or below the CLEM component.
This Data reader is used to read a schedule of resource prices.

The following parameters are used to define this component

The name of the data file. Include the full path of the database if not contained in the same folder as the APSIMX file.
This reader can read delimited ASCII text files or Excel spreadsheets.
The specified file cannot be open in another application (e.g. Excel) when you run your simulation.

Name of the excel worksheet containing the crop or forage data if reading an Excel spreadsheet.
This property is ignored when not reading spreadsheets and can be left blank.
The following columns are expected in the table. The column name referring to the data can be supplied such that any table can be used to provide data.
Each row of the table must contain a date column, with associated price changes.

The name of the column in the specified table identifying the date of the price entry.
Default: DateFormat: dd/mm/yyyy

Any number of additional columns will be accepted. These columns hold the price of a given pricing component (see Resource pricing and Animal price group) within the simulation tree. If multiple components use the same name as provided, all will be changed an a warning will be provided. The name of the column in the specified table containing the land id, or particular version of the crop data. This will be linked to the land id supplied for the selected Land type.
Name must match the pricing component names in the Simulation tree

The first row of the datafile must be the names of the columns. Blank records are accepted.

Text files should be provided as Tab delimited

The following conditions must be met
- Column names in excel files cannot contain spaces
- There must not be any extra details (e.g. text) other than empty records in rows and columns outside the data area of the spreadsheet.

This section provides details of how the price changes are handled

At the start of the simulation the file will be opened and prices updated from the start of the file for any dates up to an including the first time step. This ensures that all changes have been applied at the start of the simulation
Any pricing components not included in the file will maintain the value provided.
Where multiple price changes are provided within the time-step (month) the price with the greatest date will be used.

At the start of each time step all price change entries up to and including the current month will be applied.
An PriceChanged event is fired whenever a price is changed in the model. For full transparency, you can report the price changes for any Pricing Component or from the Resource holder that will report any resource price change during the simulation. A similar report can be performed for a Market (see Price change report)

The model assumes
- the columns match the names of pricing components (Resource pricing and Animal price group)
- the user ensures that the price relates to the price style (buy, sell, both) set for the pricing component
- multiple pricing components will all be set to the value in the input file if the column name and component names match
- the date has been provided in the correct format and not date entries are missing
- all column names in the input file are unique
See also