Use different table functions

A place for Ventity software questions & answers
moudi
Senior Member
Posts: 63
Joined: Thu Nov 18, 2010 9:18 am

Use different table functions

Postby moudi » Thu Jun 09, 2016 10:03 am

Hi

I would like to have table functions that are different according to an attribute. In the example below the attribute is type (of widgets: round, square) and I would like to have to different table functions for each type (effect of X on Y). How can I do this? Is it possible in this structure, or do I need an additional entity?

Thankx and best regards
Attachments
test group widget1.zip
(6.63 KiB) Downloaded 49 times

tomfid
Administrator
Posts: 2042
Joined: Wed May 24, 2006 4:54 am
Location: Montana, USA
Contact:

Re: Use different table functions

Postby tomfid » Fri Jun 10, 2016 4:17 pm

I understand exactly what you're seeking, and it should work, but currently doesn't. I'll post an example and a new build as soon as it's fixed.

In the general case, where you have many WidgetIDs with different Type attributes, and you want the lookup to vary by Type rather than Widget, you'd create a Type entity containing the lookup and reference that from the Widget. I'll include that in the example.
/*
Advice to posters (it really helps us to help you)
viewtopic.php?f=2&t=4391

Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics

*/

moudi
Senior Member
Posts: 63
Joined: Thu Nov 18, 2010 9:18 am

Re: Use different table functions

Postby moudi » Tue Jun 14, 2016 5:38 am

Great!

Do you have an idea how long it will take you to fix the problem?

tomfid
Administrator
Posts: 2042
Joined: Wed May 24, 2006 4:54 am
Location: Montana, USA
Contact:

Re: Use different table functions

Postby tomfid » Wed Jun 15, 2016 5:45 pm

I have a working fix, I think. I just need to do a little more testing before posting. A day?
/*
Advice to posters (it really helps us to help you)
viewtopic.php?f=2&t=4391

Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics

*/

moudi
Senior Member
Posts: 63
Joined: Thu Nov 18, 2010 9:18 am

Re: Use different table functions

Postby moudi » Thu Jun 16, 2016 12:24 pm

Wonderful! No hurry!

tomfid
Administrator
Posts: 2042
Joined: Wed May 24, 2006 4:54 am
Location: Montana, USA
Contact:

Re: Use different table functions

Postby tomfid » Mon Jun 20, 2016 11:18 pm

Sorry for the delay, but it's available now.
/*
Advice to posters (it really helps us to help you)
viewtopic.php?f=2&t=4391

Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics

*/

moudi
Senior Member
Posts: 63
Joined: Thu Nov 18, 2010 9:18 am

Re: Use different table functions

Postby moudi » Tue Jun 28, 2016 6:32 am

Thanks!

However, how do I tell Ventity to use two different table functions, one for "round", the other for "square" (see the attached example)? I tried to use the external file with the format indicated for table functions. Ventity seems not to be able to read this format (a problem we encountered earlier). Maybe this is the problem. But, how do I organise the model to do what I want in a different way?

Thanks in advance and best regards
Attachments
test group widget2.zip
(16.53 KiB) Downloaded 40 times

tomfid
Administrator
Posts: 2042
Joined: Wed May 24, 2006 4:54 am
Location: Montana, USA
Contact:

Re: Use different table functions

Postby tomfid » Wed Jun 29, 2016 7:21 pm

Here's an example of the format.
DiffLookup1 (3).zip
(10.48 KiB) Downloaded 41 times
/*
Advice to posters (it really helps us to help you)
viewtopic.php?f=2&t=4391

Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics

*/

tomfid
Administrator
Posts: 2042
Joined: Wed May 24, 2006 4:54 am
Location: Montana, USA
Contact:

Re: Use different table functions

Postby tomfid » Wed Jun 29, 2016 9:07 pm

I looked at your sample. It seems that column A of the widget tab of your spreadsheet was hidden, with junk in it. Therefore no entities were created.

This works:
test group widget2b (3).zip
(23.14 KiB) Downloaded 45 times


If you want your lookup to vary by shape, you could add a Shape entitytype and define the lookup there, then reference that from the widget entity.
/*
Advice to posters (it really helps us to help you)
viewtopic.php?f=2&t=4391

Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics

*/

moudi
Senior Member
Posts: 63
Joined: Thu Nov 18, 2010 9:18 am

Re: Use different table functions

Postby moudi » Thu Jun 30, 2016 9:21 am

Hi

When trying the DiffLookup1 model I got this message:

Product: Ventity (beta)
Version: 1.0.1.0

Assembly Name Assembly Version
Accessibility 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
Antlr4.Runtime.v4.5 1.0.1.0 file:///C:/Program%20Files/Ventity%20(beta)/Antlr4.Runtime.v4.5.DLL
DevExpress.Charts.v15.2.Core 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.Charts.v15.2.Core.DLL
DevExpress.Data.v15.2 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.Data.v15.2.DLL
DevExpress.Office.v15.2.Core 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.Office.v15.2.Core.DLL
DevExpress.Printing.v15.2.Core 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.Printing.v15.2.Core.DLL
DevExpress.Spreadsheet.v15.2.Core 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.Spreadsheet.v15.2.Core.DLL
DevExpress.Utils.v15.2 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.Utils.v15.2.DLL
DevExpress.XtraBars.v15.2 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.XtraBars.v15.2.DLL
DevExpress.XtraCharts.v15.2 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.XtraCharts.v15.2.DLL
DevExpress.XtraEditors.v15.2 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.XtraEditors.v15.2.DLL
DevExpress.XtraTreeList.v15.2 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.XtraTreeList.v15.2.DLL
DevExpress.XtraVerticalGrid.v15.2 15.2.7.0 file:///C:/Program%20Files/Ventity%20(beta)/DevExpress.XtraVerticalGrid.v15.2.DLL
l0gecrsz 0.0.0.0 file:///C:/Users/wdgallat/AppData/Local/Temp/l0gecrsz.dll
mscorlib 4.0.0.0 file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
Northwoods.Go 5.1.0.45 file:///C:/Program%20Files/Ventity%20(beta)/Northwoods.Go.DLL
Sage 3.1.1.12724 file:///C:/Program%20Files/Ventity%20(beta)/Sage.DLL
System 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
System.ComponentModel.DataAnnotations 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.DataAnnotations/v4.0_4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll
System.Configuration 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
System.Core 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
System.Data 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
System.Data.DataSetExtensions 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
System.Data.Linq 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Data.Linq.dll
System.Drawing 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
System.Numerics 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
System.Web 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
System.Windows.Forms 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
System.Windows.Forms.DataVisualization 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.DataVisualization/v4.0_4.0.0.0__31bf3856ad364e35/System.Windows.Forms.DataVisualization.dll
System.Xml 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
System.Xml.Linq 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
UIAutomationClient 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/UIAutomationClient/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationClient.dll
VE_RuntimeManager 0.9.5977.32793 file:///C:/Program%20Files/Ventity%20(beta)/VE_RuntimeManager.DLL
Ventity 1.0.5977.32796 file:///C:/Program%20Files/Ventity%20(beta)/Ventity.exe
VentityGlobals 1.0.0.0 file:///C:/Program%20Files/Ventity%20(beta)/VentityGlobals.DLL
VentityImpl 1.0.0.0 file:///C:/Program%20Files/Ventity%20(beta)/VentityImpl.DLL
VentityMainForm 1.0.0.0 file:///C:/Program%20Files/Ventity%20(beta)/VentityMainForm.DLL
VentityModel 1.0.0.0 file:///C:/Program%20Files/Ventity%20(beta)/VentityModel.DLL
VentityRuntimeFunctions 1.0.0.0 file:///C:/Program%20Files/Ventity%20(beta)/VentityRuntimeFunctions.DLL
VenUtils 1.0.0.0 file:///C:/Program%20Files/Ventity%20(beta)/VenUtils.DLL
WindowsBase 4.0.0.0 file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll


--------------------------------------------------------------------------------
Level 0 Exception
--------------------------------------------------------------------------------
TYPE : IndexOutOfRangeException
MESSAGE : Index was outside the bounds of the array.
SOURCE : VE_RuntimeManager
METHOD : SetLookup
STACK TRACE : at VE_RuntimeManager.VE_Primitives.Entity.VE_EntityTypeBase.SetLookup(Int32 idx, Double[] xvalues, Double[] yvalues)
at VE_RuntimeManager.VE_Primitives.Model.EntityInstantiator.InstantiateEntity(IFastInputEntity inputEntity)
at VE_RuntimeManager.VE_Primitives.Model.EntityInstantiator.InstantiateFastInputEntitiesByRelativeTime(IModelInputData modelInputData)
at VE_RuntimeManager.VE_Primitives.Model.EntityInstantiator.InstantiateEntities(Int32 timeSlice)
at VE_RuntimeManager.VE_Primitives.Model.ExecutionCycle.m_metronome_TickEvent(IExecutive exec, Object userData)
at VE_RuntimeManager.VE_Primitives.Model.VMetronome.FireEvents(IExecutive exec, Object userData)
at Highpoint.Sage.SimCore.Metronome_Base.OnExecEvent(IExecutive exec, Object userData)
at Highpoint.Sage.SimCore.Executive.Start()
*** this is probably indicative of the original error ***

tomfid
Administrator
Posts: 2042
Joined: Wed May 24, 2006 4:54 am
Location: Montana, USA
Contact:

Re: Use different table functions

Postby tomfid » Thu Jun 30, 2016 4:48 pm

What build date do you see in Help>About Ventity?
/*
Advice to posters (it really helps us to help you)
viewtopic.php?f=2&t=4391

Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics

*/

moudi
Senior Member
Posts: 63
Joined: Thu Nov 18, 2010 9:18 am

Re: Use different table functions

Postby moudi » Thu Jun 30, 2016 7:12 pm

12 May 2016

tomfid
Administrator
Posts: 2042
Joined: Wed May 24, 2006 4:54 am
Location: Montana, USA
Contact:

Re: Use different table functions

Postby tomfid » Thu Jun 30, 2016 8:54 pm

I think that's the problem - you need the new June build 1123 - just visit http://vensim.com/ventity.html again.
/*
Advice to posters (it really helps us to help you)
viewtopic.php?f=2&t=4391

Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics

*/

moudi
Senior Member
Posts: 63
Joined: Thu Nov 18, 2010 9:18 am

Re: Use different table functions

Postby moudi » Fri Jul 01, 2016 12:28 pm

YES, this was the problem. Now the models work fine. Thanks!

gsimpso4
Junior Member
Posts: 7
Joined: Thu Mar 09, 2017 9:37 am
Vensim version: Ventity

Re: Use different table functions

Postby gsimpso4 » Tue Mar 14, 2017 3:10 pm

Hi, I'm trying to pull this solution - is the final version available?

I have looked at the zip(3) but can't understand how it's working.

Just coming up the learning curve..

...george...

tomfid
Administrator
Posts: 2042
Joined: Wed May 24, 2006 4:54 am
Location: Montana, USA
Contact:

Re: Use different table functions

Postby tomfid » Tue Mar 14, 2017 4:30 pm

I think the latest useful version to look at is in this thread:
http://www.ventanasystems.co.uk/forum/viewtopic.php?f=48&t=6555

Specifically,
http://www.ventanasystems.co.uk/forum/download/file.php?id=2205

Are you after the cohorts or the lookups?
/*
Advice to posters (it really helps us to help you)
viewtopic.php?f=2&t=4391

Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics

*/

gsimpso4
Junior Member
Posts: 7
Joined: Thu Mar 09, 2017 9:37 am
Vensim version: Ventity

Re: Use different table functions

Postby gsimpso4 » Fri Mar 17, 2017 10:15 am

Hi, thanks for that, I am interested in table lookup functions by group - not cohorts.

I have some price sensitivities, which vary by customer group.

There are two customer grouping attributes, each with three categories.

This seems to be analogous to the Age mortality rate table function in the example.

I see this on the Cohort diagram - but am puzzled how to assign different tables for different groups.

Perhaps we just define a default table function on the diagram, and rely on initialization to set the tables for the different groups.

I find a data source CohortPopGroup3BirthsExogenous.xlsx which seems to be defining table functions for different groups.

Is this right, or am I missing something?

thanks for your help, ...george...

tomfid
Administrator
Posts: 2042
Joined: Wed May 24, 2006 4:54 am
Location: Montana, USA
Contact:

Re: Use different table functions

Postby tomfid » Sun Mar 19, 2017 9:32 pm

Perhaps we just define a default table function on the diagram, and rely on initialization to set the tables for the different groups.

I find a data source CohortPopGroup3BirthsExogenous.xlsx which seems to be defining table functions for different groups.

Is this right, or am I missing something?


Exactly right. The builtin data tables currently don't support lookups, so you need to use Excel. We're pondering a more convenient entry format for the builtins.
/*
Advice to posters (it really helps us to help you)
viewtopic.php?f=2&t=4391

Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics

*/


Return to “Ventity”

Who is online

Users browsing this forum: No registered users and 1 guest