SHARE
TWEET

Untitled

a guest Jul 16th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package dival_700;
  2.  
  3. rule "calcola P1 pumax pdmax"
  4.  
  5. salience 80
  6. when
  7.   $ddc: diametro_da_calcolare()
  8.   //$t: testate()
  9.   //$t: pressionevalle(diametro==$ddc.getDiametro().doubleValue())
  10.   $t: diametrosede(diametro==$ddc.getDiametro().doubleValue())
  11.   $v : variabile(nome=="pumax")
  12.   $vp2max_pdmax : variabile_interna(nome==String.format("_p2max_pdmax%s%s",$t.getSede(), $ddc.getDiametro()))
  13.   $vp2min_pdmax : variabile_interna(nome==String.format("_p2min_pdmax%s%s",$t.getSede(), $ddc.getDiametro()))
  14.   $vac : variabile(nome=="ac")
  15.  
  16.   $totalMIN_p2min_pdmax : Double()
  17.              from accumulate(
  18. diametri(
  19.     (p1 <= _VToD($v))  &&  ac==_VToD($vac)   &&
  20.     (p2== _V_I_ToD($vp2min_pdmax) && sede==$t.getSede() && $ddc.getDiametro().doubleValue==diametro)  
  21. , $value : p1 ),
  22.                               max( $value ) )
  23.   $totalMAX_p2min_pdmax : Double()
  24.              from accumulate(
  25. diametri(
  26.     (p1 >= _VToD($v))  &&  ac==_VToD($vac)   &&
  27.     (p2== _V_I_ToD($vp2min_pdmax ) && sede==$t.getSede() && $ddc.getDiametro().doubleValue==diametro)  
  28. , $value : p1 ),
  29.                               min( $value ) )
  30.   $totalMIN_p2max_pdmax : Double()
  31.              from accumulate(
  32. diametri(
  33.     (p1 <= _VToD($v) )  &&  ac==_VToD($vac)   &&
  34.     (p2== _V_I_ToD($vp2max_pdmax) && sede==$t.getSede() && $ddc.getDiametro().doubleValue==diametro)  
  35. , $value : p1 ),
  36.                               max( $value ) )
  37.  
  38.   $totalMAX_p2max_pdmax : Double()
  39.              from accumulate(
  40. diametri(
  41.     (p1 >= _VToD($v))  &&  ac==_VToD($vac)   &&
  42.     (p2== _V_I_ToD($vp2max_pdmax) && sede==$t.getSede() && $ddc.getDiametro().doubleValue==diametro)  
  43. , $value : p1 ),
  44.                               min( $value ) )
  45.  
  46. then
  47.  
  48.  
  49. //System.out.println("totalMIN_p2min_pdmax _p1min_pumax_p2min_pdmax " + String.format("%f",$totalMIN_p2min_pdmax));
  50.  
  51. if(Math.abs($totalMIN_p2min_pdmax) > 1000 || $totalMIN_p2min_pdmax==null ) { $totalMIN_p2min_pdmax=_VToD($v);}
  52.  
  53. variabile_interna $vimin_p2min_pdmax = new variabile_interna();
  54. $vimin_p2min_pdmax.setNome(String.format("_p1min_pumax_p2min_pdmax%s%s",$t.getSede(), $ddc.getDiametro()));
  55. $vimin_p2min_pdmax.setValore(String.format("%f",$totalMIN_p2min_pdmax));
  56. //System.out.println("setto variabile interna _p1min_pumax_p2min_pdmax " + String.format("%f",$totalMIN_p2min_pdmax));
  57. //stampalog(pfLogger,"setto variabile interna _p1min_pumax_p2min_pdmax" + $t.getSede() + " " + String.format("%f",$totalMIN_p2min_pdmax));
  58. insertLogical($vimin_p2min_pdmax);
  59.  
  60.  
  61. //System.out.println("totalMAX_p2min_pdmax _p1max_pumax_p2min_pdmax " + String.format("%f",$totalMAX_p2min_pdmax));
  62.  
  63. if(Math.abs($totalMAX_p2min_pdmax) > 1000 || $totalMAX_p2min_pdmax==null ) { $totalMAX_p2min_pdmax=_VToD($v);}
  64. variabile_interna $vimax_p2min_pdmax = new variabile_interna();
  65. $vimax_p2min_pdmax.setNome(String.format("_p1max_pumax_p2min_pdmax%s%s",$t.getSede(), $ddc.getDiametro()));
  66. $vimax_p2min_pdmax.setValore(String.format("%f",$totalMAX_p2min_pdmax));
  67. //System.out.println("setto variabile interna _p1max_pumax_p2min_pdmax " + String.format("%f",$totalMAX_p2min_pdmax));
  68. //stampalog(pfLogger,"setto variabile interna _p1max_pumax_p2min_pdmax " + String.format("%f",$totalMAX_p2min_pdmax));
  69. insertLogical($vimax_p2min_pdmax);
  70.  
  71.  
  72.  
  73. //System.out.println("totalMAX_p2max_pdmax _p1max_pumax_p2max_pdmax " + String.format("%f",$totalMAX_p2max_pdmax));
  74.  
  75. if(Math.abs($totalMAX_p2max_pdmax) > 1000 || $totalMAX_p2max_pdmax==null ) { $totalMAX_p2max_pdmax=_VToD($v);}
  76.  
  77. variabile_interna $vimax_p2max_pdmax = new variabile_interna();
  78. $vimax_p2max_pdmax.setNome(String.format("_p1max_pumax_p2max_pdmax%s%s",$t.getSede(), $ddc.getDiametro()));
  79. $vimax_p2max_pdmax.setValore(String.format("%f",$totalMAX_p2max_pdmax));
  80. //System.out.println("setto variabile interna _p1max_pumax_p2max_pdmax " + String.format("%f",$totalMAX_p2max_pdmax));
  81. //stampalog(pfLogger,"setto variabile interna _p1max_pumax_p2max_pdmax " + String.format("%f",$totalMAX_p2max_pdmax));
  82. insertLogical($vimax_p2max_pdmax);
  83.  
  84.  
  85. //System.out.println("totalMIN_p2max_pdmax _p1min_pumax_p2max_pdmax " + String.format("%f",$totalMIN_p2max_pdmax));
  86.  
  87. //if(Math.abs($totalMIN_p2max_pdmax) > 1000 || $totalMIN_p2max_pdmax==null ) { $totalMIN_p2max_pdmax=_VToD($v);}
  88. if(Math.abs($totalMIN_p2max_pdmax) > 1000 || $totalMIN_p2max_pdmax==null ) { $totalMIN_p2max_pdmax=$totalMAX_p2max_pdmax;}
  89.  
  90. variabile_interna $vimin_p2max_pdmax = new variabile_interna();
  91. $vimin_p2max_pdmax.setNome(String.format("_p1min_pumax_p2max_pdmax%s%s",$t.getSede(), $ddc.getDiametro()));
  92. $vimin_p2max_pdmax.setValore(String.format("%f",$totalMIN_p2max_pdmax));
  93. //System.out.println("setto variabile interna _p1min_pumax_p2max_pdmax " + String.format("%f",$totalMIN_p2max_pdmax));
  94. //stampalog(pfLogger,"setto variabile interna _p1min_pumax_p2max_pdmax " + String.format("%f",$totalMIN_p2max_pdmax));
  95. insertLogical($vimin_p2max_pdmax);
  96.  
  97.  
  98. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top