Changeset 46efa36 in observatorio


Ignore:
Timestamp:
Sep 12, 2014, 11:46:45 AM (10 years ago)
Author:
Alejandro <amujica@…>
Branches:
simulacion
Children:
d2fd216
Parents:
774f7b0
Message:

Correccion de error al generar las redes aguas abajo

Location:
simulacion/SimEscenariosEconomicos
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simulacion/SimEscenariosEconomicos/ioManager.H

    r6c0bcde r46efa36  
    594594        Aleph::pair<real, real> & p = it.get_current();
    595595
    596         good->setQuantity(p.first / p.second);
     596        good->setQuantity(p.second == 0 ? 0 : p.first / p.second);
    597597
    598598        it.next();
     
    638638                real needed = t->get_info()->getQuantity() * unit;
    639639
    640                 real proportion = a->get_info().quantity / sum;
     640                real proportion = (sum == 0 ? 0 : a->get_info().quantity / sum);
    641641
    642642                a->get_info().usedQuantity = needed * proportion;
  • simulacion/SimEscenariosEconomicos/queries.C

    rd9a5889 r46efa36  
    384384                         concat(DB::PRODUCT_TABLE_NAME, DB::ID)));
    385385    strQuery.addWhere(op(concat(DB::PRODUCT_INPUT_TABLE_NAME, DB::YEAR), year));
     386    strQuery.addWhere(op(concat(DB::PRODUCT_INPUT_TABLE_NAME, DB::QUANTITY),
     387                                "0", "<>"));
    386388
    387389    if (not query.exec(strQuery)) {
Note: See TracChangeset for help on using the changeset viewer.