1 | ////////////////////////////////////////////////////////////////////////////////////// |
---|
2 | // |
---|
3 | // Generación de excel para simulación con variables simulables de un objeto forecast |
---|
4 | // |
---|
5 | ////////////////////////////////////////////////////////////////////////////////////// |
---|
6 | |
---|
7 | |
---|
8 | ////////////////////////////////////////////////////////////////////////////////////// |
---|
9 | NameBlock ds = MMS::Container::GetForecast(1)::GetModel(?)::GetDataSet(?); |
---|
10 | |
---|
11 | Date fechaini = y2009m01d01; |
---|
12 | Date fechafin = y2014m12d20; |
---|
13 | TimeSet fechado = CtSem445; |
---|
14 | ////////////////////////////////////////////////////////////////////////////////////// |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | Serie dummy = SubSer(Serie CalInd(TimeSet W, TimeSet fechado), fechaini, fechafin); |
---|
19 | Set fechas = Dates(TimeSet fechado, fechaini, fechafin); |
---|
20 | |
---|
21 | |
---|
22 | Set conjVars = ds::GetVariables(?); |
---|
23 | |
---|
24 | /* |
---|
25 | Set 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 | |
---|
33 | Set Submodelos = MMS::Container::GetForecast(1)::GetModel(?)::GetSubmodels(?); |
---|
34 | |
---|
35 | Set 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 | /* |
---|
44 | Set 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 | |
---|
52 | Set auxClassified = Classify(aux, Real(NameBlock a, NameBlock b) |
---|
53 | { |
---|
54 | |
---|
55 | Real(Text a::GetName(?) < b::GetName(?)) |
---|
56 | |
---|
57 | |
---|
58 | |
---|
59 | }); |
---|
60 | |
---|
61 | Set conjVarsSimulables = EvalSet(Set auxClassified, NameBlock(Set grupo) |
---|
62 | { |
---|
63 | NameBlock grupo[1] |
---|
64 | }); |
---|
65 | |
---|
66 | Set conjVarsSimulables = Unique(aux); |
---|
67 | |
---|
68 | Set 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 | }); |
---|