Changeset 76e705a in observatorio
- Timestamp:
- Nov 5, 2014, 4:35:48 PM (10 years ago)
- Branches:
- simulacion
- Children:
- 74b22f6
- Parents:
- 80d314e
- Location:
- simulacion/SimEscenariosEconomicos
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
simulacion/SimEscenariosEconomicos/common.C
r18610a4 r76e705a 28 28 */ 29 29 30 # include <assert.h> 30 # include <ctime> 31 # include <cassert> 31 32 # include <cstring> 32 33 … … 306 307 } 307 308 309 std::string currentTime() 310 { 311 time_t now = time(0); 312 313 struct tm * st_now = localtime(&now); 314 315 std::stringstream sstr; 316 317 sstr << st_now->tm_mday << "/" << st_now->tm_mon + 1 << "/" 318 << st_now->tm_year + 1900 << " " << st_now->tm_hour << ":" 319 << st_now->tm_min << ":" << st_now->tm_sec; 320 321 return sstr.str(); 322 } 323 -
simulacion/SimEscenariosEconomicos/common.H
r7941763 r76e705a 319 319 } 320 320 321 std::string currentTime(); 322 321 323 # endif // COMMON_H 322 324 -
simulacion/SimEscenariosEconomicos/ioManager.H
r78c6ae6 r76e705a 805 805 readFields(fileName, roots, maxLevelUpstream, maxLevelDownstream, year); 806 806 807 g.year = year; 808 809 g.maxLevelUpstream = maxLevelUpstream; 810 811 g.maxLevelDownstream = maxLevelDownstream; 812 807 813 DynListQueue <Graph::Node *> upstreamQueue; 808 814 … … 931 937 xmlpp::Element * graph = root->add_child(graphName); 932 938 939 graph->set_attribute(YEAR, g.year); 940 941 graph->set_attribute(UP, toStr(g.maxLevelUpstream)); 942 943 graph->set_attribute(DOWN, toStr(g.maxLevelDownstream)); 944 933 945 xmlpp::Element * nodes = graph->add_child(NODES); 934 946 … … 1066 1078 1067 1079 xmlpp::Element * nodeGraph = searchXmlElementByName(root, graphName); 1080 1081 g.year = nodeGraph->get_attribute_value(YEAR); 1082 1083 g.maxLevelUpstream = 1084 std::atol(nodeGraph->get_attribute_value(UP).c_str()); 1085 1086 g.maxLevelDownstream = 1087 std::atol(nodeGraph->get_attribute_value(DOWN).c_str()); 1068 1088 1069 1089 assert(nodeGraph != NULL); … … 2144 2164 output << "digraph\n" 2145 2165 << "{\n" 2146 << " rankdir = LR;\n\n"; 2166 << " rankdir = LR;\n\n" 2167 << " label = \"Red generada el: " << currentTime() << "\\n" 2168 << "Año de estudio: " << g.year << "\\n" 2169 << "Niveles aguas arriba solicitados: " << g.maxLevelUpstream 2170 << "\\nNiveles aguas abajo solicitados: " << g.maxLevelDownstream 2171 << "\"\n"; 2147 2172 2148 2173 // Escribir nodos clusterizados por planta. … … 2226 2251 2227 2252 template <class NodeLabel = NodeLabel, class ArcLabel = ArcLabel> 2228 void generateDot(Graph & g, const std::string & fileName, 2229 bool writeHref = false, 2253 void generateDot(Graph & g, const std::string & fileName, bool writeHref = false, 2230 2254 NodeLabel && nodeLabel = NodeLabel(), 2231 2255 ArcLabel && arcLabel = ArcLabel()) { -
simulacion/SimEscenariosEconomicos/productionNetwork.H
r78c6ae6 r76e705a 157 157 158 158 public: 159 std::string year; 160 161 size_t maxLevelUpstream; 162 163 size_t maxLevelDownstream; 164 159 165 ProductionNetwork() 160 166 : BaseGraph(), companies(), plants() {
Note: See TracChangeset
for help on using the changeset viewer.