Page 1 of 1

Use different table functions

Posted: Thu Jun 09, 2016 10:03 am
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

Re: Use different table functions

Posted: Fri Jun 10, 2016 4:17 pm
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.

Re: Use different table functions

Posted: Tue Jun 14, 2016 5:38 am
by moudi
Great!

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

Re: Use different table functions

Posted: Wed Jun 15, 2016 5:45 pm
by tomfid
I have a working fix, I think. I just need to do a little more testing before posting. A day?

Re: Use different table functions

Posted: Thu Jun 16, 2016 12:24 pm
by moudi
Wonderful! No hurry!

Re: Use different table functions

Posted: Mon Jun 20, 2016 11:18 pm
by tomfid
Sorry for the delay, but it's available now.

Re: Use different table functions

Posted: Tue Jun 28, 2016 6:32 am
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

Re: Use different table functions

Posted: Wed Jun 29, 2016 7:21 pm
by tomfid
Here's an example of the format.
DiffLookup1 (3).zip
(10.48 KiB) Downloaded 73 times

Re: Use different table functions

Posted: Wed Jun 29, 2016 9:07 pm
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 77 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.

Re: Use different table functions

Posted: Thu Jun 30, 2016 9:21 am
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 ***

Re: Use different table functions

Posted: Thu Jun 30, 2016 4:48 pm
by tomfid
What build date do you see in Help>About Ventity?

Re: Use different table functions

Posted: Thu Jun 30, 2016 7:12 pm
by moudi
12 May 2016

Re: Use different table functions

Posted: Thu Jun 30, 2016 8:54 pm
by tomfid
I think that's the problem - you need the new June build 1123 - just visit http://vensim.com/ventity.html again.

Re: Use different table functions

Posted: Fri Jul 01, 2016 12:28 pm
by moudi
YES, this was the problem. Now the models work fine. Thanks!

Re: Use different table functions

Posted: Tue Mar 14, 2017 3:10 pm
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...

Re: Use different table functions

Posted: Tue Mar 14, 2017 4:30 pm
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?

Re: Use different table functions

Posted: Fri Mar 17, 2017 10:15 am
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...

Re: Use different table functions

Posted: Sun Mar 19, 2017 9:32 pm
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.