/farmR/src/java/dox/constraints.dox

https://code.google.com/p/javawfm/ · Unknown · 139 lines · 138 code · 1 blank · 0 comment · 0 complexity · a9b2e54e63068d8e497df8d01141a6d4 MD5 · raw file

  1. /*! \page constraints Constraints
  2. *
  3. * \section coding Coding Constraints
  4. *
  5. * Each constraint is given its own class in the JFM. All
  6. * constraint classes are subclasses of the abstract \link jfm.lp.ConstraintBuilder ConstraintBuilder \endlink
  7. * class, which defines the abstract method \link jfm.lp.ConstraintBuilder.build() build() \endlink.
  8. *
  9. *
  10. * Every constraint will be associated with a particular \link jfm.lp.ModelComponent ModelComponent \endlink
  11. * . One typically defines a constraint class as a private class to the associated
  12. * model component class. Because of this tight associated between model components and
  13. * constraints it is not possible to arbitrarily swap constraints around (not that one would
  14. * want to), but it is possible to control which of the constraints for a model
  15. * component are turned on or off.
  16. *
  17. * \section builtin Built in Constraints
  18. *
  19. * In this documentation, and in the JFM, constraints are grouped into sets that can be
  20. * written down in a single equation. Usually the entire set is itself just called a
  21. * constraint, although in reality it may consist of many rows in the constraint matrix.
  22. *
  23. *
  24. * In the following documentation we use an abbreviated notation to describe sets of constraints,
  25. *
  26. * \f[ \{ \Phi(i,k) \} \forall i,k \in \mathbf{P} \f]
  27. *
  28. * where the constraint equation, \f$ \Phi(i,k) \f$ is a function of \f$ i,k\f$ and we use the \f$ \forall \f$
  29. * symbol to denote that there is a constraint of this type for every possible \f$ i \f$ and
  30. * \f$ k \f$. The set of possible \f$ i \f$ in this case is just assumed to be the complete
  31. * set for whatever \f$ i \f$ describes (eg, crops, operations). We use an abbreviated set notation
  32. * to denote that \f$ k \f$ in this case must come from a restricted set of possibilities which we
  33. * denote by a boldface capital ( eg. \f$ \mathbf{P} \f$ ).
  34. *
  35. *
  36. * Some further notational definitions are;
  37. *
  38. * - \f$ a_c \f$ : The area of crop \f$ c \f$. \n
  39. * - \f$ x_{c,o,k} \f$ : The area of operation \f$ o \f$ on crop \f$ c \f$ in period \f$ k \f$.
  40. * - \f$ B_d \f$ : The number of years break required between crops of disease type \f$ d \f$.
  41. * - \f$ r_{t,f,k} \f$ : The area rotating from crop \f$ f \f$ to crop \f$ t \f$ in period \f$ k \f$.
  42. * - \f$ R_{c,o,k,w} \f$ is the number of hours required for worker \f$ w \f$ on crop \f$ c \f$
  43. * , operation \f$ o \f$ and in period \f$ k \f$.
  44. * - \f$ H_{w,k} \f$ is the number of hours available for worker \f$ w \f$ in period \f$ k \f$.
  45. * - \f$ N_w \f$ is the number of workers of type \f$ w \f$.
  46. * - \f$ \mathbf{P}_{c,o} \f$ : Is the set of periods in which operation \f$ o \f$ can be carried out on crop \f$ c \f$.
  47. * - \f$ \mathbf{R}_{t,f} \f$ is the set of crops \f$ t \f$ for which the rotation from crop \f$ f \f$ is allowed.
  48. * \subsection clist Complete list of constraints in JFM
  49. *
  50. * \subsubsection Cropping
  51. *
  52. * - 1 \anchor cnstrTotalArea \link jfm.model.Cropping.TotalAreaConstraint Total Area \endlink. Constrains the
  53. * sum of areas of all crops to be equal to the total area cropped.
  54. * \f[ \left \{ \sum_{c} a_{c} = A \right \} \forall c \f]
  55. * where \f$ A \f$ is the total area cropped.
  56. *
  57. * - 2 \link jfm.model.Cropping.OperationAreaConstraint Operation Area \endlink Constrains the
  58. * area of the first operation on any crop to equal the crop area.
  59. * \f[ \left \{ \sum_{k \in \mathbf{P}_{c,1} } x_{c,1,k} = a_c \right \} \forall c \f]
  60. *
  61. * - 3 \link jfm.model.Cropping.NonSequentialOperationConstraint Non Sequential Operation Area \endlink
  62. * Constrain the total area of each operation on a crop (regardless of sequence) to equal the crop area.
  63. * \f[
  64. * \left \{ \sum_{k \in \mathbf{P}_{c,o} } x_{c,o,k} = a_c \right \} \forall c,o
  65. * \f]
  66. *
  67. * - 4 \link jfm.model.Cropping.OperationSequencingConstraint Constraint on Operation sequencing \endlink
  68. * Constrain the operational areas to conform to sequencing requirements. The sum of operation areas in a given period cannot exceed
  69. * the sum of areas of the preceeding operation up to that period
  70. * \f[
  71. * \left \{ \sum_{k \leq K} x_{c,o,k} \leq \sum_{k \leq K} x_{c,(o-1),k} \right \} \forall c, (o > 1 ), K \in \mathbf{P}_K
  72. * \f]
  73. * where the set \f$ \mathbf{P}_K = \mathbf{P}_{c,o} \cap \mathbf{P}_{c,o-1} \f$ is
  74. * the set of periods in which both operations \f$ o \f$ and \f$ o-1 \f$ can be carried out
  75. * on crop \f$ c \f$. Note that the set \f$ \mathbf{P}_K \f$ should be a continuous sequence.
  76. *
  77. *
  78. * - 5 \link jfm.model.Cropping.OperationMinAreaConstraint Minimum area of constraints required in period \endlink
  79. * Constrain the area of certain operations in each period to be at least some minimum (rarely used constraint ).
  80. * \f[
  81. * x_{c,o,k} \geq x_{c,o,k}^{min}
  82. * \f]
  83. *
  84. * - 6 \link jfm.model.Cropping.DiseaseConstraint Constraint on crop areas due to Disease \endlink. Constrain
  85. * the area of crops with a certain disease type and/or associated disease to be no greater than the area of all
  86. * other crops divided by the number of years break required between crops with the disease.
  87. * \f[
  88. * \left \{ \sum_{c \in \mathbf{C}^d} a_c B_d + \sum_{c \in \mathbf{C}^{d'}} a_c Min(B_{d'},B_d)
  89. \leq \sum_{c \notin \mathbf{C}^d \cup \mathbf{C}^{d'} } \right \} \forall d
  90. * \f]
  91. * where the set of crops with a particular disease is written as \f$ \mathbf{C}^d \f$.
  92. *
  93. - 7 \link jfm.model.Cropping.AreaLimitConstraint Limits on individual crops \endlink. Constrains the area of specific individual crops.
  94. * \f[
  95. * a^{min}_c \leq a_c \leq a_c^{max}
  96. * \f]
  97. *
  98. * \subsubsection Rotations
  99. *
  100. * - 8 \link jfm.model.Rotations.LastOpRotationConstraint Rotation sequencing for the last operation on a crop \endlink.
  101. * Constrain the total area rotating from a particular crop to all other crops to be equal to the total area
  102. * of the last operation of that crop (in a specific period).
  103. * \f[
  104. * \left \{ \sum_t r_{t,f,k} = x_{f,o',k} \right \} \forall f \in \mathbf{R}_{t,f},k \in \mathbf{P}_{f,o'}
  105. * \f]
  106. * where \f$ o' \f$ is the last operation on the from crop \f$ f \f$.
  107. *
  108. * - 9 \link jfm.model.Rotations.NonSeqFirstOpRotationConstraint Rotation constraints on non-sequential operations \endlink.
  109. * Constrain the area of the first operation in the to crop \f$ t \f$ to be no greater than the
  110. * area rotating from all other crops. This is a less restrictive constraint than (10), but is
  111. * required for cases where there are no overlapping periods between the last operation of \f$ f \f$
  112. * and the first operation of \f$ t \f$.
  113. * \f[
  114. * \left \{ \sum_k x_{t,1,k} \leq \sum_f r_{t,f,k} \right \} \forall t \in \mathbf{R}_{t,f}
  115. * \f]
  116. *
  117. * - 10 \link jfm.model.Rotations.SeqFirstOpRotationConstraint Rotation constraint on first operation \endlink. Constrain
  118. * the total area of the first operation on a crop up to a period to be no more than the total amount
  119. * rotating to that crop up to that period.
  120. * \f[
  121. * \left \{ \sum_{k\leq K} x_{t,1,k} \leq \sum_f r_{t,f,k} \right \} \forall t \in \mathbf{R}_{t,f}, K\in \mathbf{K}_{t,f}
  122. * \f]
  123. * where the set \f$ \mathbf{K}_{t,f} = \mathbf{P}_{t,1} \cap \mathbf{P}_{f,o'} \f$ is the set of periods in which
  124. * the last operation of crop \f$ f \f$ overlaps with the to crop \f$ t \f$. In the case where the intersection
  125. * is null the constraint (9) ensures continuity of operations from one crop to the next.
  126. *
  127. * \subsubsection Workers
  128. *
  129. * - 11 \link jfm.model.Workers.ResourcesConstraint Constraint on available resources \endlink. Constrain the
  130. * total number of hours required for a worker type to be no more than the number of hours available.
  131. * \f[
  132. * \left \{ \sum_{o,c} R_{c,o,k,w} \leq N_w H_{w,k} \right \} \forall k,w
  133. * \f]
  134. *
  135. *
  136. *
  137. *
  138. */