entity actions from data
entity actions from data
What's the best way to calibrate with entities and time-series data in Ventity while still maintaining collections? For example, how can I use time series data in which a particular cow moves to a new pasture or dies and leaves the farm and new cows are imported?
Re: entity actions from data
Good question. I think it depends what the data looks like - do you have an example?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: entity actions from data
Thanks for the reply. Here is an example of data. We start out with 10 cattle in the first month. In the second month, a few cattle have moved pastures e.x. c001 is now in p002 and some are dead (c008 and c010), and we bought a new cow c011 to pasture p004 and pasture p003 is now empty. Let's assume the simulation plots are the number of cattle of each gender in each pasture. How do I add this time series data as a sample realization/simulation run?
Date CattleID Pasture Gender Alive
1/1/2021 C001 P002 F 1
1/1/2021 C002 P004 M 1
1/1/2021 C003 P002 M 1
1/1/2021 C004 P001 F 1
1/1/2021 C005 P003 M 1
1/1/2021 C006 P004 F 1
1/1/2021 C007 P001 F 1
1/1/2021 C008 P003 F 1
1/1/2021 C009 P001 M 1
1/1/2021 C010 P002 M 1
2/1/2021 C001 P001 F 1
2/1/2021 C002 P004 M 1
2/1/2021 C003 P001 M 1
2/1/2021 C004 P001 F 1
2/1/2021 C005 P002 M 1
2/1/2021 C006 P004 F 1
2/1/2021 C007 P001 F 1
2/1/2021 C011 P004 F 1
2/1/2021 C009 P001 M 1
Date CattleID Pasture Gender Alive
1/1/2021 C001 P002 F 1
1/1/2021 C002 P004 M 1
1/1/2021 C003 P002 M 1
1/1/2021 C004 P001 F 1
1/1/2021 C005 P003 M 1
1/1/2021 C006 P004 F 1
1/1/2021 C007 P001 F 1
1/1/2021 C008 P003 F 1
1/1/2021 C009 P001 M 1
1/1/2021 C010 P002 M 1
2/1/2021 C001 P001 F 1
2/1/2021 C002 P004 M 1
2/1/2021 C003 P001 M 1
2/1/2021 C004 P001 F 1
2/1/2021 C005 P002 M 1
2/1/2021 C006 P004 F 1
2/1/2021 C007 P001 F 1
2/1/2021 C011 P004 F 1
2/1/2021 C009 P001 M 1
Re: entity actions from data
Any ideas? I'm new to ventity but know how to do this in OO languages using functions.
Re: entity actions from data
It looks like the data essentially matches the Tidy template, if you change "Date" to "DateTime". See Defining Entities>Data Entities>Data Sources in the Help system.
Given the data, are you looking to compare it to what the model is generating, or to use the cow location data as a driver for what happens in the pastures (for example)?
Given the data, are you looking to compare it to what the model is generating, or to use the cow location data as a driver for what happens in the pastures (for example)?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: entity actions from data
Thanks, good question. I am looking to use it as a driver for now. I anticipate I will also use it to compare what the model is generating in other models.
Re: entity actions from data
Thank you so much @tomfid! Data Entities is what I needed.
Re: entity actions from data
I'm working on an example for you but ran into a bug so I'm not sure how long it'll take.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: entity actions from data
That's fantastic. I appreciate it-it will be very helpful.
Re: entity actions from data
I am getting the following exception when I try to use CalendarTime from the excel file. Is there a specific calendar format I need to be using while importing data from excel?
--------------------------------------------------------------------------------
Level 0 Exception
--------------------------------------------------------------------------------
TYPE : OverflowException
MESSAGE : Array dimensions exceeded supported range.
SOURCE : VentityGlobals
METHOD : GetActiveTimeControl
STACK TRACE : at VentityGlobals.RuntimeContext.GetActiveTimeControl(IModelRunConfig runConfig)
at VE_RuntimeManager.ModelInput.ModelTimeSeriesData.CalculateInterpolatedValues(IModelTimeSeriesData timeSeriesData, RuntimeContext runtimeContext, IModelRunConfig modelRunConfig)
at VE_RuntimeManager.ModelInput.ModelTimeSeriesData.FromScenarioTimeSeriesDataSource(RuntimeContext runtimeContext, IScenariosDataSource scenariosDataSource, IRuntimeAdapter runtimeAdapter, IModelRunConfig modelRunConfig)
at VE_RuntimeManager.ModelInput.ModelTimeSeriesDataManager.GetModelTimeSeriesData(RuntimeContext runtimeContext, String uid, IRuntimeAdapter runtimeAdapter, IModelRunConfig modelRunConfig)
at VE_RuntimeManager.FastDataManager.LoadTimeSeriesData(RuntimeContext runtimeContext, IRuntimeAdapter adapter, IModelRunConfig modelRunConfig)
at VE_RuntimeManager.RuntimeManager.CreateRunTask(RuntimeContext runtimeContext, IRuntimeAdapter adapter, IModelRunConfig modelRunConfig, Boolean baseRun)
at VE_RuntimeManager.RuntimeManager.<CreateRunTasks>d__14.MoveNext()
at VE_RuntimeManager.RuntimeManager.<Run>d__11.MoveNext()
at VentityMainForm.AppMainForm.<>c__DisplayClass394_0.<RunModel>b__2()
*** this is probably indicative of the original error ***
--------------------------------------------------------------------------------
Level 0 Exception
--------------------------------------------------------------------------------
TYPE : OverflowException
MESSAGE : Array dimensions exceeded supported range.
SOURCE : VentityGlobals
METHOD : GetActiveTimeControl
STACK TRACE : at VentityGlobals.RuntimeContext.GetActiveTimeControl(IModelRunConfig runConfig)
at VE_RuntimeManager.ModelInput.ModelTimeSeriesData.CalculateInterpolatedValues(IModelTimeSeriesData timeSeriesData, RuntimeContext runtimeContext, IModelRunConfig modelRunConfig)
at VE_RuntimeManager.ModelInput.ModelTimeSeriesData.FromScenarioTimeSeriesDataSource(RuntimeContext runtimeContext, IScenariosDataSource scenariosDataSource, IRuntimeAdapter runtimeAdapter, IModelRunConfig modelRunConfig)
at VE_RuntimeManager.ModelInput.ModelTimeSeriesDataManager.GetModelTimeSeriesData(RuntimeContext runtimeContext, String uid, IRuntimeAdapter runtimeAdapter, IModelRunConfig modelRunConfig)
at VE_RuntimeManager.FastDataManager.LoadTimeSeriesData(RuntimeContext runtimeContext, IRuntimeAdapter adapter, IModelRunConfig modelRunConfig)
at VE_RuntimeManager.RuntimeManager.CreateRunTask(RuntimeContext runtimeContext, IRuntimeAdapter adapter, IModelRunConfig modelRunConfig, Boolean baseRun)
at VE_RuntimeManager.RuntimeManager.<CreateRunTasks>d__14.MoveNext()
at VE_RuntimeManager.RuntimeManager.<Run>d__11.MoveNext()
at VentityMainForm.AppMainForm.<>c__DisplayClass394_0.<RunModel>b__2()
*** this is probably indicative of the original error ***
Re: entity actions from data
Can you share the project files?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: entity actions from data
Attached is a dummy example creating a data entity from the excel file with dates and selecting calendar time in run control.