Changeset 666042a in observatorio for simulacion/ModuloDinamico


Ignore:
Timestamp:
Jan 7, 2015, 4:11:35 PM (9 years ago)
Author:
Alejandro <amujica@…>
Branches:
simulacion
Children:
bf76088
Parents:
7e7ebba
Message:

Ajuste, cuando un productor no declara precio de venta del ano en estudio, se utiliza el precio de compra declarado por el comprador

Location:
simulacion/ModuloDinamico
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • simulacion/ModuloDinamico/io_manager.H

    ra3eef50 r666042a  
    456456                    scode << input.get_id();
    457457
    458                     if (input.get_nationality() == "V")
     458                    if (input.get_nationality() != "E")
    459459                      scode << input.get_company_rif();
    460460                    else
     
    469469                        std::shared_ptr<Good> ptr_good;
    470470
    471                         if (input.get_nationality() == "V")
     471                        if (input.get_nationality() != "E")
    472472                          ptr_good = std::shared_ptr<Good>(new Input(input));
    473473                        else
     
    564564                        src = *ptr_src;
    565565
     566                      Product * ptr_product =
     567                        static_cast<Product *>(src->get_info().get());
     568
    566569                      IP_Relationship ip_relationship;
    567570
     
    573576                      );
    574577
    575                       ip_relationship.set_purchase_price(product.get_price());
     578                      if (ptr_product->get_price() == 0.0)
     579                        get_acquisition_price(input.get_nationality(),
     580                                              input.get_id(), year);
     581                      else
     582                        ip_relationship.set_purchase_price(
     583                          ptr_product->get_price()
     584                        );
     585
     586                      ip_relationship.set_bought_quantity(
     587                        get_declared_bought_quantity(
     588                          ptr_product->get_company_rif(),
     589                          ptr_product->get_company_name(),
     590                          input.get_id(),
     591                          year
     592                        )
     593                      );
    576594
    577595                      src->get_info()->set_level(
  • simulacion/ModuloDinamico/queries.C

    r6217e66 r666042a  
    294294                               DB::SUPPLIER_ID),
    295295                        concat(DB::SUPPLIER_TABLE_NAME, DB::ID)));
    296   str_query.addWhere(op(concat(DB::INPUT_SUPPLIER_TABLE_NAME, DB::YEAR_R),
    297                         year));
    298296
    299297  if (not query.exec(str_query))
  • simulacion/ModuloDinamico/simulator.C

    r8171889 r666042a  
    315315                                 ip_sim_attr.bought_quantity;
    316316
     317      if (possible_production == 0.0)
     318        {
     319          std::cout << "RQ: " << ip_rel.get_requested_quantity() << " - "
     320                    << "BQ: " << ip_sim_attr.bought_quantity << '\n';
     321        }
     322
    317323      // Se actualiza la máxima producción posible.
    318324      if (possible_production < max_possible_production)
     
    422428
    423429      ip_sim_attr_t.bought_quantity = internal_quantity * proportion;
     430
     431      I(ip_sim_attr_t.bought_quantity > 0.0);
    424432    }
    425433}
Note: See TracChangeset for help on using the changeset viewer.