Пример #1
0
 ///-------------------------------------------------------------------------------------------------
 /// <summary>   Sets flux allocated value. </summary>
 /// <param name="ResField">     The resource field. </param>
 /// <param name="ConsField">    The cons field. </param>
 /// <param name="aValue">       The value. </param>
 ///-------------------------------------------------------------------------------------------------
 public void SetFluxAllocation(string ResField, string ConsField, double aValue)
 {
     CRF_Flux theFlux = TheCRFNetwork.FindFlux(ResField, ConsField);
     if (theFlux != null)
     {
         theFlux.SetAllocation(aValue);
     }
 }
Пример #2
0
 ///-------------------------------------------------------------------------------------------------
 /// <summary>   Gets flux allocated value. </summary>
 /// <param name="ResField">     The resource field. </param>
 /// <param name="ConsField">    The cons field. </param>
 /// <returns>   The flux allocated, 0 if not found. </returns>
 ///-------------------------------------------------------------------------------------------------
 public int GetFluxAllocated(string ResField, string ConsField)
 {
     int result = 0;
     CRF_Flux theFlux = TheCRFNetwork.FindFlux(ResField, ConsField);
     if (theFlux != null)
     {
         double value = theFlux.Allocated();
         try
         {
             int tempint = Convert.ToInt32(value);
             result = tempint;
         }
         catch (Exception ex)
         {
             // ouch
         }
     }
     return result;
 }