close Warning: Can't synchronize with repository "(default)" (/var/svn/mms does not appear to be a Subversion repository.). Look in the Trac log for more information.

Ticket #487: datasets.tol

File datasets.tol, 2.7 KB (added by lmperez, 14 years ago)
Line 
1//////////////////////////////////////////////////////////////////////////////
2// File:    datasets.tol
3// Purpose: It creates a set of useful generic datasets
4//////////////////////////////////////////////////////////////////////////////
5
6
7//////////////////////////////////////////////////////////////////////////////
8// Includes
9//////////////////////////////////////////////////////////////////////////////
10
11Set Include("C:/Users/lmperez.BAYESFORECAST/Desktop/functions.tol");
12
13//////////////////////////////////////////////////////////////////////////////
14// Functions
15//////////////////////////////////////////////////////////////////////////////
16
17//////////////////////////////////////////////////////////////////////////////
18Set Add.Standard.Variables(MMS::@DataSet DS.I, Set variables)
19//////////////////////////////////////////////////////////////////////////////
20{
21  Set EvalSet(variables,Anything (Set idef)
22  {
23    Anything DS.I::ReplaceVariable([[
24      Text _.name        = Name(idef->X);
25      Text _.type        = "Serie";
26      Text _.description = "";
27      Text _.expression  = "Standard.Variables::"+_.name
28    ]])
29  })
30};
31
32//////////////////////////////////////////////////////////////////////////////
33// Standard Inputs
34//////////////////////////////////////////////////////////////////////////////
35
36Set Standard.Festives  = Build.Festives.Struct(Festive.National("Brazil"),6);
37Set Standard.Christmas = Build.Weekly.HolidayStruct(D(1)*M(12),6);
38Set Standard.Summer    = Build.Weekly.HolidayStruct(D(1)*M(7),6);
39
40//////////////////////////////////////////////////////////////////////////////
41// Datasets
42//////////////////////////////////////////////////////////////////////////////
43
44MMS::@DataSet DS.I.Standard.Festives = MMS::Container::ReplaceDataSet([[
45  Text _.name        = "Standard.Festives";
46  Text _.description = "Set of standard input festive variables"
47]]);
48
49MMS::@DataSet DS.I.Standard.Christmas = MMS::Container::ReplaceDataSet([[
50  Text _.name        = "Standard.Christmas";
51  Text _.description = "Set of standard input Christmas variables"
52]]);
53
54MMS::@DataSet DS.I.Standard.Summer = MMS::Container::ReplaceDataSet([[
55  Text _.name        = "Standard.Summer";
56  Text _.description = "Set of standard input summer variables"
57]]);
58
59Set Add.Standard.Variables(DS.I.Standard.Festives,  Standard.Festives);
60Set Add.Standard.Variables(DS.I.Standard.Christmas, Standard.Christmas);
61Set Add.Standard.Variables(DS.I.Standard.Summer,    Standard.Summer);
62
63
64//////////////////////////////////////////////////////////////////////////////
65// End
66//////////////////////////////////////////////////////////////////////////////