Changeset 46efa36 in observatorio
- Timestamp:
- Sep 12, 2014, 11:46:45 AM (10 years ago)
- Branches:
- simulacion
- Children:
- d2fd216
- Parents:
- 774f7b0
- Location:
- simulacion/SimEscenariosEconomicos
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
simulacion/SimEscenariosEconomicos/ioManager.H
r6c0bcde r46efa36 594 594 Aleph::pair<real, real> & p = it.get_current(); 595 595 596 good->setQuantity(p. first / p.second);596 good->setQuantity(p.second == 0 ? 0 : p.first / p.second); 597 597 598 598 it.next(); … … 638 638 real needed = t->get_info()->getQuantity() * unit; 639 639 640 real proportion = a->get_info().quantity / sum;640 real proportion = (sum == 0 ? 0 : a->get_info().quantity / sum); 641 641 642 642 a->get_info().usedQuantity = needed * proportion; -
simulacion/SimEscenariosEconomicos/queries.C
rd9a5889 r46efa36 384 384 concat(DB::PRODUCT_TABLE_NAME, DB::ID))); 385 385 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", "<>")); 386 388 387 389 if (not query.exec(strQuery)) {
Note: See TracChangeset
for help on using the changeset viewer.