Changeset 76e705a in observatorio


Ignore:
Timestamp:
Nov 5, 2014, 4:35:48 PM (10 years ago)
Author:
Alejandro <amujica@…>
Branches:
simulacion
Children:
74b22f6
Parents:
80d314e
Message:

Agregada a los graficos la leyenda con los parametros bajo los cuales son generados

Location:
simulacion/SimEscenariosEconomicos
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • simulacion/SimEscenariosEconomicos/common.C

    r18610a4 r76e705a  
    2828*/
    2929
    30 # include <assert.h>
     30# include <ctime>
     31# include <cassert>
    3132# include <cstring>
    3233
     
    306307}
    307308
     309std::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  
    319319}
    320320
     321std::string currentTime();
     322
    321323# endif // COMMON_H
    322324
  • simulacion/SimEscenariosEconomicos/ioManager.H

    r78c6ae6 r76e705a  
    805805        readFields(fileName, roots, maxLevelUpstream, maxLevelDownstream, year);
    806806
     807        g.year = year;
     808
     809        g.maxLevelUpstream = maxLevelUpstream;
     810
     811        g.maxLevelDownstream = maxLevelDownstream;
     812
    807813        DynListQueue <Graph::Node *> upstreamQueue;
    808814
     
    931937        xmlpp::Element * graph = root->add_child(graphName);
    932938
     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
    933945        xmlpp::Element * nodes = graph->add_child(NODES);
    934946
     
    10661078
    10671079        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());
    10681088
    10691089        assert(nodeGraph != NULL);
     
    21442164        output << "digraph\n"
    21452165               << "{\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";
    21472172
    21482173        // Escribir nodos clusterizados por planta.
     
    22262251
    22272252    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,
    22302254                     NodeLabel && nodeLabel = NodeLabel(),
    22312255                     ArcLabel && arcLabel = ArcLabel()) {
  • simulacion/SimEscenariosEconomicos/productionNetwork.H

    r78c6ae6 r76e705a  
    157157
    158158public:
     159    std::string year;
     160
     161    size_t maxLevelUpstream;
     162
     163    size_t maxLevelDownstream;
     164
    159165    ProductionNetwork()
    160166        : BaseGraph(), companies(), plants() {
Note: See TracChangeset for help on using the changeset viewer.