source: observatorio/simulacion/ModuloDinamico/ip_relationship.H

simulacion
Last change on this file was 71c519d, checked in by Alejandro <amujica@…>, 9 years ago

Simulador al 90%

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*
2  Copyright (C) 2014
3  Alejandro Mujica (amujica@cenditel.gob.ve)
4  José Ruiz (jruiz@cenditel.gob.ve)
5  Julie Vera (jvera@cenditel.gob.ve)
6 
7  CENDITEL Fundación Centro Nacional de Desarrollo e Investigación en
8  Tecnologías Libres
9 
10  Este programa es software libre; Usted puede usarlo bajo los términos de la
11  licencia de software GPL versión 2.0 de la Free Software Foundation.
12 
13  Este programa se distribuye con la esperanza de que sea útil, pero SIN
14  NINGUNA GARANTÍA; tampoco las implícitas garantías de MERCANTILIDAD o
15  ADECUACIÓN A UN PROPÓSITO PARTICULAR.
16  Consulte la licencia GPL para más detalles. Usted debe recibir una copia
17  de la GPL junto con este programa; si no, escriba a la Free Software
18  Foundation Inc. 51 Franklin Street,5 Piso, Boston, MA 02110-1301, USA.
19*/
20
21/*
22  Autor:             Alejandro J. Mujica
23  Fecha de creación: 05/06/2014
24  Este archivo contiene la definición de la clase IP_Relationship y una
25  estructura que llamada IP_Simulation_Attributes que contiene los
26  atributos utilizados en la simulación para una relación.
27*/
28
29# ifndef IP_RELATIONSHIP_H
30# define IP_RELATIONSHIP_H
31
32# include <types.H>
33# include <simulation_attributes_macros.H>
34
35
36struct IP_Simulation_Attributes
37{
38  size_t state_number;
39
40  real purchase_price;
41
42  real bought_quantity;
43
44  IP_Simulation_Attributes()
45    : state_number(0), purchase_price(0.0), bought_quantity(0.0)
46  {
47    // Empty
48  }
49};
50
51
52/** Representa una relación insumo-producto entre dos bienes.
53 *
54 * Una instancia de esta clase se utiliza como información de los arcos del
55 * grafo que representa la red productiva.
56 *
57 * @author Alejandro J. Mujica
58 */
59class IP_Relationship
60{
61  /** Almacena el id del insumo.
62   *
63   * Cada comprador asigna un id a cada insumo y cada productor asigna un id
64   * a cada producto, un mismo producto, podría tener dos o más conceptos
65   * diferentes como insumos con id diferente, por esta razón se almacena
66   * el id del insumo en la relación, pues éste depende del comprador.
67   */
68  db_id_t input_id;
69 
70  real requested_quantity;
71
72  real purchase_price;
73
74  real bought_quantity;
75
76  DECLARE_SIMULATION_ATTRIBUTES(IP_Simulation_Attributes)
77
78public:
79  IP_Relationship();
80
81  IP_Relationship(const IP_Relationship &);
82
83  IP_Relationship(IP_Relationship &&);
84
85  const db_id_t & get_input_id() const;
86
87  void set_input_id(const db_id_t &);
88
89  const real & get_requested_quantity() const;
90
91  void set_requested_quantity(const real &);
92
93  const real & get_purchase_price() const;
94
95  void set_purchase_price(const real &);
96
97  const real & get_bought_quantity() const;
98
99  void set_bought_quantity(const real &);
100
101  IP_Relationship & operator = (const IP_Relationship &);
102
103  IP_Relationship & operator = (IP_Relationship &&);
104
105  DEFINE_SIMULATION_ATTRIBUTES_METHODS(IP_Simulation_Attributes)
106
107  std::string to_dot() const;
108};
109
110# endif /* IP_RELATIONSHIP_H */
111
Note: See TracBrowser for help on using the repository browser.