Antares Simulator
Power System Simulator
accumulator.hxx
1 /*
2  * Copyright 2007-2025, RTE (https://www.rte-france.com)
3  * See AUTHORS.txt
4  * SPDX-License-Identifier: MPL-2.0
5  * This file is part of Antares-Simulator,
6  * Adequacy and Performance assessment for interconnected energy networks.
7  *
8  * Antares_Simulator is free software: you can redistribute it and/or modify
9  * it under the terms of the Mozilla Public Licence 2.0 as published by
10  * the Mozilla Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Antares_Simulator is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * Mozilla Public Licence 2.0 for more details.
17  *
18  * You should have received a copy of the Mozilla Public Licence 2.0
19  * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20  */
21 #ifndef ANTARES_WINDOWS_INSPECTOR_ACCUMULATOR_HXX__
22 #define ANTARES_WINDOWS_INSPECTOR_ACCUMULATOR_HXX__
23 
24 #include <antares/study/filter.h>
25 #include <array>
26 #include "constants.h"
27 
28 namespace Antares::Window::Inspector
29 {
30 struct Unique
31 {
32  template<class T>
33  static bool Apply(T& value, const T& item)
34  {
35  return (value == item);
36  }
37 };
38 
39 struct Add
40 {
41  template<class T>
42  static bool Apply(T& value, const T& item)
43  {
44  value += item;
45  return true;
46  }
47 };
48 
49 template<class PredicateT, class TraitsT = Unique>
51 {
52 public:
53  template<class ListT>
54  static void Apply(wxPGProperty* property, const ListT& list)
55  {
56  assert(list.size() != 0);
57  assert(property != NULL);
58  if (list.size() == 1)
59  {
60  auto study = *list.begin();
61  property->SetValueFromString(PredicateT::ConvertToString(PredicateT::Value(study)));
62  }
63  else
64  {
65  auto i = list.cbegin();
66  const auto end = list.cend();
67  typename PredicateT::Type value = PredicateT::Value(*i);
68  ++i;
69  for (; i != end; ++i)
70  {
71  if (!TraitsT::Apply(value, PredicateT::Value(*i)))
72  {
73  property->SetValueToUnspecified();
74  return;
75  }
76  }
77  property->SetValueFromString(PredicateT::ConvertToString(value));
78  }
79  }
80 };
81 
82 template<class PredicateT>
84 {
85 public:
86  template<class ListT>
87  static void ApplyTextColor(wxPGProperty* property, const ListT& list)
88  {
89  assert(list.size() != 0);
90  assert(property != NULL);
91  if (list.size() == 1)
92  {
93  auto study = *list.begin();
94  property->GetGrid()->SetPropertyTextColour(property->GetBaseName(),
95  PredicateT::TextColor(study));
96  }
97  else
98  {
99  auto i = list.cbegin();
100  const auto end = list.cend();
101  ++i;
102  for (; i != end; ++i)
103  {
104  property->GetGrid()->SetPropertyTextColour(property->GetBaseName(),
105  PredicateT::TextColor(*i));
106  }
107  }
108  }
109 
110  template<class ListT>
111  static void ApplyGreyColor(wxPGProperty* property_MargCost,
112  wxPGProperty* property_OperCost,
113  wxPGProperty* property_FuelEff,
114  wxPGProperty* property_VarOMcost,
115  const ListT& list)
116  {
117  assert(list.size() != 0);
118  assert(property_MargCost != NULL);
119  assert(property_OperCost != NULL);
120  assert(property_FuelEff != NULL);
121  assert(property_VarOMcost != NULL);
122  if (list.size() == 1)
123  {
124  auto study = *list.begin();
125  property_MargCost->GetGrid()->EnableProperty(property_MargCost->GetBaseName(),
126  PredicateT::Enable(study));
127  property_OperCost->GetGrid()->EnableProperty(property_OperCost->GetBaseName(),
128  PredicateT::Enable(study));
129  property_FuelEff->GetGrid()->EnableProperty(property_FuelEff->GetBaseName(),
130  !PredicateT::Enable(study));
131  property_VarOMcost->GetGrid()->EnableProperty(property_VarOMcost->GetBaseName(),
132  !PredicateT::Enable(study));
133  }
134  else
135  {
136  auto i = list.cbegin();
137  const auto end = list.cend();
138  ++i;
139  for (; i != end; ++i)
140  {
141  property_MargCost->GetGrid()->EnableProperty(property_MargCost->GetBaseName(),
142  PredicateT::Enable(*i));
143  property_OperCost->GetGrid()->EnableProperty(property_OperCost->GetBaseName(),
144  PredicateT::Enable(*i));
145  property_FuelEff->GetGrid()->EnableProperty(property_FuelEff->GetBaseName(),
146  !PredicateT::Enable(*i));
147  property_VarOMcost->GetGrid()->EnableProperty(property_VarOMcost->GetBaseName(),
148  !PredicateT::Enable(*i));
149  }
150  }
151  }
152 };
153 
155 {
156  struct Color
157  {
158  Color(const int c[3])
159  {
160  color[0] = c[0];
161  color[1] = c[1];
162  color[2] = c[2];
163  }
164 
165  int color[3];
166 
167  bool operator==(const Color& rhs) const
168  {
169  return rhs.color[0] == color[0] && rhs.color[1] == color[1] && rhs.color[2] == color[2];
170  }
171  };
172 
173  using Type = Color;
174 
175  static Type Value(const Data::Area* area)
176  {
177  return Color(area->ui->color);
178  }
179 
180  static wxString ConvertToString(const Type v)
181  {
182  return wxString() << wxT("(") << v.color[0] << wxT(',') << v.color[1] << wxT(',')
183  << v.color[2] << wxT(")");
184  }
185 };
186 
188 {
189  using Type = Data::SimulationMode;
190 
191  static Type Value(const Data::Study::Ptr& study)
192  {
193  return (!(!study) ? study->parameters.mode : Data::SimulationMode::Economy);
194  }
195 
196  static wxString ConvertToString(const Type v)
197  {
198  switch (v)
199  {
200  case Data::SimulationMode::Economy:
201  return wxT("Economy");
202  case Data::SimulationMode::Adequacy:
203  return wxT("Adequacy");
204  case Data::SimulationMode::Expansion:
205  return wxT("Expansion");
206  case Data::SimulationMode::Unknown:
207  return wxEmptyString;
208  }
209  return wxEmptyString;
210  }
211 };
212 
214 {
215  using Type = uint;
216 
217  static Type Value(const Data::Study::Ptr& study)
218  {
219  if (!(!study))
220  {
221  auto& parameters = study->parameters;
222  if (parameters.derated)
223  {
224  return 2;
225  }
226  if (parameters.useCustomScenario)
227  {
228  return 1;
229  }
230  }
231  return 0;
232  }
233 
234  static wxString ConvertToString(const Type v)
235  {
236  switch (v)
237  {
238  case 0:
239  return wxT("Automatic");
240  case 1:
241  return wxT("Custom");
242  case 2:
243  return wxT("Derated");
244  }
245  return wxT("Automatic");
246  }
247 };
248 
250 {
251  using Type = uint;
252 
253  static Type Value(const Data::Study::Ptr& study)
254  {
255  return !study ? 0 : (uint)study->parameters.firstMonthInYear;
256  }
257 
258  static wxString ConvertToString(const Type v)
259  {
260  if (v < 12)
261  {
262  return calendarMonths[v];
263  }
264  return wxT("invalid");
265  }
266 };
267 
269 {
270  using Type = bool;
271 
272  static Type Value(const Data::Study::Ptr& study)
273  {
274  return !study ? false : study->parameters.leapYear;
275  }
276 
277  static wxString ConvertToString(const Type v)
278  {
279  return v ? wxT("true") : wxT("false");
280  }
281 };
282 
284 {
285  using Type = uint;
286 
287  static Type Value(const Data::Study::Ptr& study)
288  {
289  return !study ? (uint)Antares::monday : (uint)study->parameters.firstWeekday;
290  }
291 
292  static wxString ConvertToString(const Type v)
293  {
294  if (v < 7)
295  {
296  return calendarWeeks[v];
297  }
298  return wxT("invalid");
299  }
300 };
301 
303 {
304  using Type = bool;
305 
306  static Type Value(const Data::Study::Ptr& study)
307  {
308  return !(!study) ? study->parameters.userPlaylist : false;
309  }
310 
311  static wxString ConvertToString(const Type v)
312  {
313  switch (v)
314  {
315  case 0:
316  return wxT("Automatic");
317  case 1:
318  return wxT("Custom");
319  }
320  return wxT("Automatic");
321  }
322 };
323 
325 {
326  using Type = bool;
327 
328  static Type Value(const Data::Study::Ptr& study)
329  {
330  return !(!study) ? study->parameters.yearByYear : false;
331  }
332 
333  static wxString ConvertToString(const Type v)
334  {
335  return v ? wxT("True") : wxT("False");
336  }
337 };
338 
340 {
341  using Type = bool;
342 
343  static Type Value(const Data::Study::Ptr& study)
344  {
345  return !(!study) ? study->parameters.synthesis : false;
346  }
347 
348  static wxString ConvertToString(const Type v)
349  {
350  return v ? wxT("True") : wxT("False");
351  }
352 };
353 
355 {
356  using Type = bool;
357 
358  static Type Value(const Data::Study::Ptr& study)
359  {
360  return !(!study) ? study->parameters.geographicTrimming : false;
361  }
362 
363  static wxString ConvertToString(const Type v)
364  {
365  return (!v) ? wxT("None") : wxT("Custom");
366  }
367 };
368 
370 {
371  using Type = bool;
372 
373  static Type Value(const Data::Study::Ptr& study)
374  {
375  return !(!study) ? study->parameters.thematicTrimming : false;
376  }
377 
378  static wxString ConvertToString(const Type v)
379  {
380  return (!v) ? wxT("None") : wxT("Custom");
381  }
382 };
383 
385 {
386  using Type = bool;
387 
388  static Type Value(const Data::Study::Ptr& study)
389  {
390  return !(!study) ? study->parameters.storeTimeseriesNumbers : false;
391  }
392 
393  static wxString ConvertToString(const Type v)
394  {
395  return v ? wxT("True") : wxT("False");
396  }
397 };
398 
400 {
401  using Type = wxString;
402 
403  static Type Value(const Data::Study::Ptr& study)
404  {
405  return wxString() << ((!(!study) ? study->parameters.simulationDays.first : 0) + 1);
406  }
407 
408  static wxString ConvertToString(const Type v)
409  {
410  return v;
411  }
412 };
413 
415 {
416  using Type = uint;
417 
418  static Type Value(const Data::Study::Ptr& study)
419  {
420  return !(!study) ? study->parameters.simulationDays.end : 8760;
421  }
422 
423  static wxString ConvertToString(const Type v)
424  {
425  return wxString() << v;
426  }
427 };
428 
430 {
431  using Type = uint;
432 
433  static Type Value(const Data::Study::Ptr& study)
434  {
435  return !(!study) ? study->parameters.nbYears : 1;
436  }
437 
438  static wxString ConvertToString(const Type v)
439  {
440  return wxString() << v;
441  }
442 };
443 
445 {
446  using Type = String;
447 
448  static Type Value(const Data::Study::Ptr& study)
449  {
450  return !(!study) ? study->parameters.horizon : Type();
451  }
452 
453  static wxString ConvertToString(const Type v)
454  {
455  return wxStringFromUTF8(v);
456  }
457 };
458 
460 {
461  using Type = Antares::DayOfTheWeek;
462 
463  static Type Value(const Data::Study::Ptr& study)
464  {
465  return !study ? Antares::monday : study->parameters.dayOfThe1stJanuary;
466  }
467 
468  static wxString ConvertToString(const Type v)
469  {
470  return wxStringFromUTF8(Antares::Date::DayOfTheWeekToString(v));
471  }
472 };
473 
474 template<bool Orientation>
475 struct PLinkArea
476 {
477  using Type = wxString;
478 
479  static Type Value(const Data::AreaLink* link)
480  {
481  if (Orientation)
482  {
483  return wxStringFromUTF8(link->from->name);
484  }
485  else
486  {
487  return wxStringFromUTF8(link->with->name);
488  }
489  }
490 
491  static wxString ConvertToString(const Type v)
492  {
493  return v;
494  }
495 };
496 
498 {
499  using Type = bool;
500 
501  static Type Value(const Data::AreaLink* link)
502  {
503  return link->useHurdlesCost;
504  }
505 
506  static wxString ConvertToString(const Type v)
507  {
508  return v ? wxT("True") : wxT("False");
509  }
510 };
511 
513 {
514  using Type = bool;
515 
516  static Type Value(const Data::AreaLink* link)
517  {
518  return link->usePST;
519  }
520 
521  static wxString ConvertToString(const Type v)
522  {
523  return v ? wxT("True") : wxT("False");
524  }
525 };
526 
528 {
529  using Type = bool;
530 
531  static Type Value(const Data::AreaLink* link)
532  {
533  return link->useLoopFlow;
534  }
535 
536  static wxString ConvertToString(const Type v)
537  {
538  return v ? wxT("True") : wxT("False");
539  }
540 };
541 
543 {
544  using Type = bool;
545 
546  static Type Value(const Data::AreaLink* link)
547  {
548  return link->displayComments;
549  }
550 
551  static wxString ConvertToString(const Type v)
552  {
553  return v ? wxT("True") : wxT("False");
554  }
555 };
556 
558 {
559  using Type = wxString;
560 
561  static Type Value(const Data::AreaLink* link)
562  {
563  return wxStringFromUTF8(link->comments);
564  }
565 
566  static wxString ConvertToString(const Type v)
567  {
568  return v;
569  }
570 };
571 
573 {
574  using Type = int;
575 
576  static Type Value(const Data::AreaLink* link)
577  {
578  return link->style;
579  }
580 
581  static wxString ConvertToString(const Type v)
582  {
583  wxString ret;
584  switch (v)
585  {
586  case 0:
587  ret = "Plain";
588  break;
589  case 1:
590  ret = "Dot";
591  break;
592  case 2:
593  ret = "Dash";
594  break;
595  case 3:
596  ret = "Dot & Dash";
597  break;
598  default:
599  ret = "Plain";
600  break;
601  }
602  return ret;
603  }
604 };
605 
607 {
608  using Type = int;
609 
610  static Type Value(const Data::AreaLink* link)
611  {
612  return Math::MinMax(link->linkWidth, 1, 6);
613  }
614 
615  static wxString ConvertToString(const Type v)
616  {
617  return DoubleToWxString(v);
618  }
619 };
620 
622 {
623  struct Color
624  {
625  Color(const int c[3])
626  {
627  color[0] = c[0];
628  color[1] = c[1];
629  color[2] = c[2];
630  }
631 
632  int color[3];
633 
634  bool operator==(const Color& rhs) const
635  {
636  return rhs.color[0] == color[0] && rhs.color[1] == color[1] && rhs.color[2] == color[2];
637  }
638  };
639 
640  using Type = Color;
641 
642  static Type Value(const Data::AreaLink* link)
643  {
644  return Color(link->color);
645  }
646 
647  static wxString ConvertToString(const Type v)
648  {
649  return wxString() << wxT("(") << v.color[0] << wxT(',') << v.color[1] << wxT(',')
650  << v.color[2] << wxT(")");
651  }
652 };
653 
655 {
656  using Type = double;
657 
658  static Type Value(const Data::Area* area)
659  {
660  return area->thermal.unsuppliedEnergyCost;
661  }
662 
663  static wxString ConvertToString(const Type v)
664  {
665  return DoubleToWxString(v);
666  }
667 };
668 
670 {
671  using Type = Data::AdequacyPatch::AdequacyPatchMode;
672 
673  static Type Value(const Data::Area* area)
674  {
675  return area->adequacyPatchMode;
676  }
677 
678  static wxString ConvertToString(const Type v)
679  {
680  switch (v)
681  {
682  case Data::AdequacyPatch::virtualArea:
683  return wxT("virtual area");
684  case Data::AdequacyPatch::physicalAreaOutsideAdqPatch:
685  return wxT("physical area outside patch");
686  case Data::AdequacyPatch::physicalAreaInsideAdqPatch:
687  return wxT("physical area inside patch");
688  }
689  return wxEmptyString;
690  }
691 };
692 
693 template<enum Data::AreaNodalOptimization O>
695 {
696  using Type = bool;
697 
698  static Type Value(const Data::Area* area)
699  {
700  return (0 != (area->nodalOptimization & O));
701  }
702 
703  static wxString ConvertToString(const Type v)
704  {
705  return (v) ? wxT("True") : wxT("False");
706  }
707 };
708 
709 template<bool SynthesisT, enum Data::FilterFlag F>
711 {
712  using Type = bool;
713 
714  static Type Value(const Data::Area* area)
715  {
716  if (SynthesisT)
717  {
718  return (0 != (area->filterSynthesis & F));
719  }
720  else
721  {
722  return (0 != (area->filterYearByYear & F));
723  }
724  }
725 
726  static wxString ConvertToString(const Type v)
727  {
728  return (v) ? wxT("True") : wxT("False");
729  }
730 };
731 
732 template<bool SynthesisT, enum Data::FilterFlag F>
734 {
735  using Type = bool;
736 
737  static Type Value(const Data::AreaLink* link)
738  {
739  if (SynthesisT)
740  {
741  return (0 != (link->filterSynthesis & F));
742  }
743  else
744  {
745  return (0 != (link->filterYearByYear & F));
746  }
747  }
748 
749  static wxString ConvertToString(const Type v)
750  {
751  return (v) ? wxT("True") : wxT("False");
752  }
753 };
754 
756 {
757  using Type = double;
758 
759  static Type Value(const Data::Area* area)
760  {
761  return area->thermal.spilledEnergyCost;
762  }
763 
764  static wxString ConvertToString(const Type v)
765  {
766  return DoubleToWxString(v);
767  }
768 };
769 
770 // ----------------
771 // THERMAL/RENEWABLE CLUSTERS
772 // ----------------
774 {
775  using Type = bool;
776 
777  static Type Value(const Data::Cluster* cluster)
778  {
779  return cluster->enabled;
780  }
781 
782  static wxString ConvertToString(const Type v)
783  {
784  return v ? wxT("True") : wxT("False");
785  }
786 };
787 
789 {
790  using Type = uint;
791 
792  static Type Value(const Data::Cluster* cluster)
793  {
794  return cluster->unitCount;
795  }
796 
797  static wxString ConvertToString(const Type v)
798  {
799  return wxString() << v;
800  }
801 };
802 
804 {
805  using Type = double;
806 
807  static Type Value(const Data::Cluster* cluster)
808  {
809  return cluster->nominalCapacity;
810  }
811 
812  static wxString ConvertToString(const Type v)
813  {
814  return DoubleToWxString(v);
815  }
816 };
817 
819 {
820  using Type = double;
821 
822  static Type Value(const Data::Cluster* cluster)
823  {
824  return cluster->nominalCapacity * cluster->unitCount;
825  }
826 
827  static wxString ConvertToString(const Type v)
828  {
829  return DoubleToWxString(v);
830  }
831 };
832 
834 {
835  using Type = wxString;
836 
837  static Type Value(const Data::Cluster* cluster)
838  {
839  return wxStringFromUTF8(cluster->getGroup());
840  }
841 
842  static wxString ConvertToString(const Type v)
843  {
844  return v;
845  }
846 };
847 
849 {
850  using Type = wxString;
851 
852  static Type Value(const Data::Cluster* cluster)
853  {
854  return wxStringFromUTF8(cluster->parentArea->name);
855  }
856 
857  static wxString ConvertToString(const Type v)
858  {
859  return v;
860  }
861 };
862 
863 // ----------------
864 // THERMAL CLUSTERS
865 // ----------------
867 {
868  static wxColor TextColor(Data::ThermalCluster* cluster)
869  {
870  if (not cluster->checkMinStablePower())
871  {
872  return wxColor(255, 0, 0);
873  }
874 
875  if (cluster->minStablePower > cluster->nominalCapacity * (1 - cluster->spinning / 100.))
876  {
877  return wxColor(255, 0, 0);
878  }
879 
880  return wxColour(86, 98, 115);
881  }
882 
883  static bool IsValid(Data::ThermalCluster* cluster)
884  {
885  return cluster->checkMinStablePower();
886  }
887 };
888 
890 {
891  using Type = bool;
892 
893  static Type Value(const Data::ThermalCluster* cluster)
894  {
895  return cluster->mustrun;
896  }
897 
898  static wxString ConvertToString(const Type v)
899  {
900  return v ? wxT("True") : wxT("False");
901  }
902 };
903 
905 {
906  using Type = double;
907 
908  static Type Value(const Data::ThermalCluster* cluster)
909  {
910  return cluster->emissions.factors[Antares::Data::Pollutant::CO2];
911  }
912 
913  static wxString ConvertToString(const Type v)
914  {
915  return DoubleToWxString(v);
916  }
917 };
918 
920 {
921  using Type = double;
922 
923  static Type Value(const Data::ThermalCluster* cluster)
924  {
925  return cluster->plannedVolatility;
926  }
927 
928  static wxString ConvertToString(const Type v)
929  {
930  return DoubleToWxString(v);
931  }
932 };
933 
935 {
936  using Type = double;
937 
938  static Type Value(const Data::ThermalCluster* cluster)
939  {
940  return cluster->forcedVolatility;
941  }
942 
943  static wxString ConvertToString(const Type v)
944  {
945  return DoubleToWxString(v);
946  }
947 };
948 
950 {
951  using Type = double;
952 
953  static Type Value(const Data::ThermalCluster* cluster)
954  {
955  return cluster->spinning;
956  }
957 
958  static wxString ConvertToString(const Type v)
959  {
960  return DoubleToWxString(v);
961  }
962 };
963 
965 {
966  using Type = double;
967 
968  static Type Value(const Data::ThermalCluster* cluster)
969  {
970  return cluster->fuelEfficiency;
971  }
972 
973  static wxString ConvertToString(const Type v)
974  {
975  return DoubleToWxString(v);
976  }
977 };
978 
980 {
981  static wxColor TextColor(Data::ThermalCluster* cluster)
982  {
983  if (not cluster->checkMinStablePower())
984  {
985  return wxColor(255, 0, 0);
986  }
987 
988  if (cluster->minStablePower > cluster->nominalCapacity * (1 - cluster->spinning / 100.))
989  {
990  return wxColor(255, 0, 0);
991  }
992 
993  return wxColour(86, 98, 115);
994  }
995 
996  static bool IsValid(Data::ThermalCluster* cluster)
997  {
998  return cluster->checkMinStablePower();
999  }
1000 };
1001 
1003 {
1004  using Type = double;
1005 
1006  static Type Value(const Data::ThermalCluster* cluster)
1007  {
1008  return cluster->marketBidCost;
1009  }
1010 
1011  static wxString ConvertToString(const Type v)
1012  {
1013  return DoubleToWxString(v);
1014  }
1015 };
1016 
1018 {
1019  using Type = double;
1020 
1021  static Type Value(const Data::ThermalCluster* cluster)
1022  {
1023  return cluster->spreadCost;
1024  }
1025 
1026  static wxString ConvertToString(const Type v)
1027  {
1028  return DoubleToWxString(v);
1029  }
1030 };
1031 
1033 {
1034  using Type = uint;
1035 
1036  static Type Value(const Data::ThermalCluster* cluster)
1037  {
1038  return (uint)cluster->costgeneration;
1039  }
1040 
1041  static wxString ConvertToString(const Type v)
1042  {
1043  return (v < costgenerationCount) ? costgeneration[v] : nullptr;
1044  }
1045 };
1046 
1048 {
1049  using Type = double;
1050 
1051  static Type Value(const Data::ThermalCluster* cluster)
1052  {
1053  return cluster->marginalCost;
1054  }
1055 
1056  static wxString ConvertToString(const Type v)
1057  {
1058  return DoubleToWxString(v);
1059  }
1060 };
1061 
1063 {
1064  static bool Enable(Data::ThermalCluster* cluster)
1065  {
1066  if (cluster->costgeneration == Data::useCostTimeseries)
1067  {
1068  return false;
1069  }
1070 
1071  return true;
1072  }
1073 };
1074 
1076 {
1077  using Type = double;
1078 
1079  static Type Value(const Data::ThermalCluster* cluster)
1080  {
1081  return cluster->startupCost;
1082  }
1083 
1084  static wxString ConvertToString(const Type v)
1085  {
1086  return DoubleToWxString(v);
1087  }
1088 };
1089 
1091 {
1092  using Type = double;
1093 
1094  static Type Value(const Data::ThermalCluster* cluster)
1095  {
1096  return cluster->fixedCost;
1097  }
1098 
1099  static wxString ConvertToString(const Type v)
1100  {
1101  return DoubleToWxString(v);
1102  }
1103 };
1104 
1106 {
1107  using Type = double;
1108 
1109  static Type Value(const Data::ThermalCluster* cluster)
1110  {
1111  return cluster->variableomcost;
1112  }
1113 
1114  static wxString ConvertToString(const Type v)
1115  {
1116  return DoubleToWxString(v);
1117  }
1118 };
1119 
1121 {
1122  using Type = double;
1123 
1124  static Type Value(const Data::ThermalCluster* cluster)
1125  {
1126  return cluster->minStablePower;
1127  }
1128 
1129  static wxString ConvertToString(const Type v)
1130  {
1131  return DoubleToWxString(v);
1132  }
1133 };
1134 
1136 {
1137  static wxColor TextColor(Data::ThermalCluster* cluster)
1138  {
1139  if (not cluster->checkMinStablePower())
1140  {
1141  return wxColor(255, 0, 0);
1142  }
1143 
1144  if (cluster->minStablePower > cluster->nominalCapacity * (1 - cluster->spinning / 100.))
1145  {
1146  return wxColor(255, 0, 0);
1147  }
1148 
1149  return wxColour(86, 98, 115);
1150  }
1151 
1152  static bool IsValid(Data::ThermalCluster* cluster)
1153  {
1154  return cluster->checkMinStablePower();
1155  }
1156 };
1157 
1159 {
1160  using Type = uint;
1161 
1162  static Type Value(const Data::ThermalCluster* cluster)
1163  {
1164  return cluster->minUpTime;
1165  }
1166 
1167  static wxString ConvertToString(const Type v)
1168  {
1169  return wxString() << v;
1170  }
1171 };
1172 
1174 {
1175  using Type = uint;
1176 
1177  static Type Value(const Data::ThermalCluster* cluster)
1178  {
1179  return cluster->minDownTime;
1180  }
1181 
1182  static wxString ConvertToString(const Type v)
1183  {
1184  return wxString() << v;
1185  }
1186 };
1187 
1189 {
1190  using Type = uint;
1191 
1192  static Type Value(const Data::ThermalCluster* cluster)
1193  {
1194  return (uint)cluster->forcedLaw;
1195  }
1196 
1197  static wxString ConvertToString(const Type v)
1198  {
1199  return (v < LawCount) ? Laws[v] : nullptr;
1200  }
1201 };
1202 
1204 {
1205  using Type = uint;
1206 
1207  static Type Value(const Data::ThermalCluster* cluster)
1208  {
1209  return cluster->plannedLaw;
1210  }
1211 
1212  static wxString ConvertToString(const Type v)
1213  {
1214  return (v < LawCount) ? Laws[v] : nullptr;
1215  }
1216 };
1217 
1219 {
1220  using Type = uint;
1221 
1222  static Type Value(const Data::ThermalCluster* cluster)
1223  {
1224  return (uint)cluster->tsGenBehavior;
1225  }
1226 
1227  static wxString ConvertToString(const Type v)
1228  {
1229  return (v < localGenTSCount) ? localGenTS[v] : nullptr;
1230  }
1231 };
1232 
1234 {
1235  using Type = uint;
1236 
1237  static Type Value(const Data::RenewableCluster* cluster)
1238  {
1239  return cluster->tsMode;
1240  }
1241 
1242  static wxString ConvertToString(const Type v)
1243  {
1244  return (v < renewableTSModeCount) ? renewableTSMode[v] : nullptr;
1245  }
1246 };
1247 
1248 // -------------------
1249 // BINDING CONSTRAINTS
1250 // -------------------
1252 {
1253  using Type = wxString;
1254 
1255  static Type Value(const std::shared_ptr<Data::BindingConstraint> constraint)
1256  {
1257  return wxStringFromUTF8(constraint->name());
1258  }
1259 
1260  static wxString ConvertToString(const Type v)
1261  {
1262  return v;
1263  }
1264 };
1265 
1267 {
1268  using Type = wxString;
1269 
1270  static Type Value(const std::shared_ptr<Data::BindingConstraint> constraint)
1271  {
1272  return wxStringFromUTF8(constraint->comments());
1273  }
1274 
1275  static wxString ConvertToString(const Type v)
1276  {
1277  return v;
1278  }
1279 };
1280 
1282 {
1283  using Type = bool;
1284 
1285  static Type Value(const std::shared_ptr<Data::BindingConstraint> constraint)
1286  {
1287  return constraint->enabled();
1288  }
1289 
1290  static wxString ConvertToString(const Type v)
1291  {
1292  return v ? wxT("True") : wxT("False");
1293  }
1294 };
1295 
1297 {
1299 
1300  static Type Value(const std::shared_ptr<Data::BindingConstraint> constraint)
1301  {
1302  return constraint->type();
1303  }
1304 
1305  static wxString ConvertToString(const Type v)
1306  {
1307  return wxStringFromUTF8(Data::BindingConstraint::TypeToCString(v));
1308  }
1309 };
1310 } // namespace Antares::Window::Inspector
1311 
1312 #endif // ANTARES_WINDOWS_INSPECTOR_ACCUMULATOR_HXX__
Definition for a single area.
Definition: area.h:51
AreaName name
Name of the area.
Definition: area.h:212
Type
Definition: BindingConstraint.h:55
static const char * TypeToCString(Type t)
Convert a binding constraint type into a mere C-String.
Definition: BindingConstraint.cpp:107
Definition: cluster.h:46
double nominalCapacity
Capacity of reference per unit (MW) (pMax)
Definition: cluster.h:114
Area * parentArea
The associate area (alias)
Definition: cluster.h:111
Definition: cluster.h:40
A single thermal cluster.
Definition: cluster.h:76
double spinning
Spinning (%)
Definition: cluster.h:225
double marketBidCost
Market bid cost (euros/MWh)
Definition: cluster.h:283
uint minDownTime
Min. Down time (1..168)
Definition: cluster.h:219
StatisticalLaw plannedLaw
Law (ts-generator)
Definition: cluster.h:238
bool mustrun
Mustrun.
Definition: cluster.h:178
double spreadCost
Spread (euros/MWh)
Definition: cluster.h:277
double startupCost
Startup cost (euros/startup)
Definition: cluster.h:281
CostGeneration costgeneration
Cost generation.
Definition: cluster.h:273
double variableomcost
Variable O&M cost (euros/MWh)
Definition: cluster.h:285
double marginalCost
Marginal cost (euros/MWh)
Definition: cluster.h:275
double fuelEfficiency
Efficiency (%)
Definition: cluster.h:228
double minStablePower
Min. Stable Power (MW)
Definition: cluster.h:198
uint minUpTime
Min. Up time (1..168)
Definition: cluster.h:217
StatisticalLaw forcedLaw
Law (ts-generator)
Definition: cluster.h:236
double fixedCost
Fixed cost (euros/hour)
Definition: cluster.h:279
bool checkMinStablePower()
Check the validity of Min Stable Power.
Definition: cluster.cpp:482
double plannedVolatility
Planned volatility.
Definition: cluster.h:233
double forcedVolatility
Forced Volatility.
Definition: cluster.h:231
Definition: accumulator.hxx:84
Definition: accumulator.hxx:51
Definition: accumulator.hxx:40
Definition: accumulator.hxx:670
Definition: accumulator.hxx:157
Definition: accumulator.hxx:155
Definition: accumulator.hxx:711
Definition: accumulator.hxx:695
Definition: accumulator.hxx:849
Definition: accumulator.hxx:905
Definition: accumulator.hxx:1219
Definition: accumulator.hxx:965
Definition: accumulator.hxx:774
Definition: accumulator.hxx:1091
Definition: accumulator.hxx:834
Definition: accumulator.hxx:819
Definition: accumulator.hxx:1189
Definition: accumulator.hxx:1204
Definition: accumulator.hxx:1048
Definition: accumulator.hxx:1174
Definition: accumulator.hxx:1159
Definition: accumulator.hxx:890
Definition: accumulator.hxx:1018
Definition: accumulator.hxx:1003
Definition: accumulator.hxx:950
Definition: accumulator.hxx:1076
Definition: accumulator.hxx:789
Definition: accumulator.hxx:1267
Definition: accumulator.hxx:1282
Definition: accumulator.hxx:1252
Definition: accumulator.hxx:1297
Definition: accumulator.hxx:476
Definition: accumulator.hxx:624
Definition: accumulator.hxx:622
Definition: accumulator.hxx:558
Definition: accumulator.hxx:734
Definition: accumulator.hxx:498
Definition: accumulator.hxx:528
Definition: accumulator.hxx:513
Definition: accumulator.hxx:573
Definition: accumulator.hxx:607
Definition: accumulator.hxx:1234
Definition: accumulator.hxx:188
Definition: accumulator.hxx:460
Definition: accumulator.hxx:214
Definition: accumulator.hxx:400
Definition: accumulator.hxx:415
Definition: accumulator.hxx:284
Definition: accumulator.hxx:445
Definition: accumulator.hxx:269
Definition: accumulator.hxx:385
Definition: accumulator.hxx:303
Definition: accumulator.hxx:340
Definition: accumulator.hxx:325
Definition: accumulator.hxx:430
Definition: accumulator.hxx:31