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

Ticket #1843: ExtraccionVariablesI.tol

File ExtraccionVariablesI.tol, 2.3 KB (added by jmarinero, 10 years ago)
Line 
1//////////////////////////////////////////////////////////////////////////////////////
2//
3// Generación de excel para simulación con variables simulables de un objeto forecast
4//
5//////////////////////////////////////////////////////////////////////////////////////
6
7
8//////////////////////////////////////////////////////////////////////////////////////
9NameBlock ds = MMS::Container::GetForecast(1)::GetModel(?)::GetDataSet(?);
10
11Date fechaini = y2009m01d01;
12Date fechafin = y2014m12d20;
13TimeSet fechado = CtSem445;
14//////////////////////////////////////////////////////////////////////////////////////
15
16
17
18Serie dummy = SubSer(Serie CalInd(TimeSet W, TimeSet fechado), fechaini, fechafin);
19Set fechas = Dates(TimeSet fechado, fechaini, fechafin);
20
21
22Set conjVars = ds::GetVariables(?);
23
24/*
25Set conjVarsSimulables = Select(Set conjVars, Real(NameBlock var) //NameBlock var = conjVars[1236]
26{
27  WriteLn("Nombre del input:       " + var::GetName(?));
28  Text texto_esSimulable = var::GetAttribute_Default("_.simulable", Text "0");
29  Real Eval("Real " + Text texto_esSimulable)
30});
31*/
32
33Set Submodelos = MMS::Container::GetForecast(1)::GetModel(?)::GetSubmodels(?);
34
35Set aux = BinGroup("<<",EvalSet(Submodelos, Set(NameBlock sbm)
36{ //NameBlock sbm = Submodelos[1];
37  Set BinGroup("<<", Set EvalSet(sbm::GetExpTerms_Active(?), Set (NameBlock nb)
38  {
39    Set nb::GetInput(?)::GetVariable(?)::GetDependences(?)
40  }))
41}));
42
43/*
44Set conjVarsSimulables = Unique(Select(Set aux, Real(NameBlock var) //NameBlock var = conjVars[1236]
45{
46  WriteLn("Nombre del input:       " + var::GetName(?));
47  Text texto_esSimulable = var::GetAttribute_Default("_.simulable", Text "0");
48  Real Eval("Real " + Text texto_esSimulable)
49}));
50*/
51
52Set auxClassified = Classify(aux, Real(NameBlock a, NameBlock b)
53{
54
55Real(Text a::GetName(?) < b::GetName(?))
56
57
58
59});
60
61Set conjVarsSimulables = EvalSet(Set auxClassified, NameBlock(Set grupo)
62{
63NameBlock grupo[1]
64});
65
66Set conjVarsSimulables = Unique(aux);
67
68Set tablita = EvalSet(Set conjVarsSimulables, Set(NameBlock varS)
69{
70  Serie sumada = Serie dummy << Serie varS::GetData.Extended(?)  >> Serie dummy;
71  Set devol =
72    [[
73      Text nombre = varS::GetName(?);
74      Serie sumada
75    ]] <<
76    EvalSet(Set fechas, Real(Date fecha){Real SerDat(Serie sumada, Date fecha)})
77});