Use different table functions

A place for Ventity software questions & answers
Post Reply
moudi
Senior Member
Posts: 69
Joined: Thu Nov 18, 2010 9:18 am
Vensim version: DSS

Use different table functions

Post by moudi »

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 659 times
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Use different table functions

Post by tomfid »

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.
moudi
Senior Member
Posts: 69
Joined: Thu Nov 18, 2010 9:18 am
Vensim version: DSS

Re: Use different table functions

Post by moudi »

Great!

Do you have an idea how long it will take you to fix the problem?
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Use different table functions

Post by tomfid »

I have a working fix, I think. I just need to do a little more testing before posting. A day?
moudi
Senior Member
Posts: 69
Joined: Thu Nov 18, 2010 9:18 am
Vensim version: DSS

Re: Use different table functions

Post by moudi »

Wonderful! No hurry!
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Use different table functions

Post by tomfid »

Sorry for the delay, but it's available now.
moudi
Senior Member
Posts: 69
Joined: Thu Nov 18, 2010 9:18 am
Vensim version: DSS

Re: Use different table functions

Post by moudi »

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 603 times
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Use different table functions

Post by tomfid »

Here's an example of the format.
DiffLookup1 (3).zip
(10.48 KiB) Downloaded 664 times
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Use different table functions

Post by tomfid »

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 646 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.
moudi
Senior Member
Posts: 69
Joined: Thu Nov 18, 2010 9:18 am
Vensim version: DSS

Re: Use different table functions

Post by moudi »

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: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Use different table functions

Post by tomfid »

What build date do you see in Help>About Ventity?
moudi
Senior Member
Posts: 69
Joined: Thu Nov 18, 2010 9:18 am
Vensim version: DSS

Re: Use different table functions

Post by moudi »

12 May 2016
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Use different table functions

Post by tomfid »

I think that's the problem - you need the new June build 1123 - just visit http://vensim.com/ventity.html again.
moudi
Senior Member
Posts: 69
Joined: Thu Nov 18, 2010 9:18 am
Vensim version: DSS

Re: Use different table functions

Post by moudi »

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

Post by gsimpso4 »

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: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Use different table functions

Post by tomfid »

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

Specifically,
http://www.ventanasystems.co.uk/forum/d ... hp?id=2205

Are you after the cohorts or the lookups?
gsimpso4
Junior Member
Posts: 7
Joined: Thu Mar 09, 2017 9:37 am
Vensim version: Ventity

Re: Use different table functions

Post by gsimpso4 »

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: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Use different table functions

Post by tomfid »

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.
Post Reply