05-12-2016 04:56 PM
I am using SAS simulation studio 13.2 for the development of business model.
In simulation process, I would like to create or update data table.
For example, the below table shows the number of buses owned by company on time 0 (I read this data via Observation Source template).
|NO of Buses||5||8||10||15||16||20||11||4||3||2||1||1|
Every year, the company determines bus inventory decisions. For example, after 1 year if the company disposes five 5-year old buses and purchase three new buses, then the above table looks as below.
|NO of Buses||3||5||8||10||15||11||20||11||4||3||2||1||
I would like to update status of bus inventory every defined time period in simulation process.
Woule you please let me know how to do it?
Thank you for all comments.
05-20-2016 02:57 PM
Currently you cannot update specific fields in a data model (such as the one you are reading in to represent the bus inventories). You can only update the entire table. If you somehow can write a SAS data set with the new bus inventories, then you can use the InUpdateNow port on the Observation Source block to read the new data set, as specified by the InDataPolicy port (see the overview file of the Observation Source block for the format of the string required by the InDataPolicy port). Essentially, you would have some sort of controlling entity that cycles around each time period, creates the new file path string for the Observation Source (that points to the new bus inventory data set) and then signals the Observation Source to update.
If you cannot read the new bus inventories from a data set, maybe you could try creating a resource entity for each model year and then have an attribute for the current inventory. You can still read the data from an Observation Source block to create the entities, but you might have to rotate your inventory data set (have each row in the data set represent a different model year). You would then connect a Modifier block to the Observation Source to pull the Inventory value and set it as an attribute on the entity. Each time period, you can then seize each model year entity (using a simple Attribute Rule in a Seize block), immediately release the model year entity and send it to a Modifier block where you update the current inventory attribute.