<?php

/*******************************************
****    File generated by Tree2C V1.0   ****
**** (c) 2017-2019, Alessandro Pedretti ****
*******************************************/


/**** Model class ****/

class T2PHP_RANDOM_TREE {

  /**** Output values ****/

  const C_FALSE = 0;
  const C_TRUE = 1;

  /**** Values of the attributes ****/

  const C_FG_CON2_NO = 0;
  const C_FG_CON2_YES = 1;
  const C_FG_COOH_NO = 0;
  const C_FG_COOH_YES = 1;
  const C_FG_COOR_NO = 0;
  const C_FG_COOR_YES = 1;
  const C_FG_F_NO = 0;
  const C_FG_F_YES = 1;
  const C_FG_PHOH_NO = 0;
  const C_FG_PHOH_YES = 1;

  /**** Properties ****/

  public $Angles = 0.0;
  public $Atoms = 0.0;
  public $Bonds = 0.0;
  public $ChiralAtms = 0.0;
  public $Dipole = 0.0;
  public $EzBnds = 0.0;
  public $FG_CON2 = 0;
  public $FG_COOH = 0;
  public $FG_COOR = 0;
  public $FG_F = 0;
  public $FG_PhOH = 0;
  public $FlexTorsions = 0.0;
  public $Gyrrad = 0.0;
  public $HbAcc = 0.0;
  public $HbDon = 0.0;
  public $HeavyAtoms = 0.0;
  public $Lipole = 0.0;
  public $Mass = 0.0;
  public $Ovality = 0.0;
  public $Psa = 0.0;
  public $Rings = 0.0;
  public $Sas = 0.0;
  public $Sav = 0.0;
  public $Sdiam = 0.0;
  public $Torsions = 0.0;
  public $Vdiam = 0.0;
  public $VirtualLogP = 0.0;


  /**** Classification method ****/

  function Classify()
  {
    if ($this -> HbDon < 0.5000) {
      if ($this -> Sas < 756.1100) {
        if ($this -> FG_COOR == self::C_FG_COOR_YES) {
          if ($this -> Angles < 106.5000) {
            if ($this -> Atoms < 48.0000) {
              $Res = self::C_TRUE;
            } else {
              if ($this -> Atoms < 51.0000) {
                $Res = self::C_FALSE;
              } else {
                $Res = self::C_TRUE;
              }
            }
          } else {
            $Res = self::C_FALSE;
          }
        } else {
          if ($this -> HeavyAtoms < 13.5000) {
            if ($this -> Gyrrad < 2.8500) {
              $Res = self::C_TRUE;
            } else {
              $Res = self::C_FALSE;
            }
          } else {
            $Res = self::C_TRUE;
          }
        }
      } else {
        $Res = self::C_FALSE;
      }
    } else {
      if ($this -> Angles < 92.5000) {
        if ($this -> Gyrrad < 3.6800) {
          if ($this -> Torsions < 17.5000) {
            if ($this -> Sas < 283.4200) {
              $Res = self::C_TRUE;
            } else {
              if ($this -> FlexTorsions < 0.5000) {
                if ($this -> Sas < 301.9000) {
                  $Res = self::C_FALSE;
                } else {
                  $Res = self::C_TRUE;
                }
              } else {
                if ($this -> FG_CON2 == self::C_FG_CON2_YES) {
                  if ($this -> Lipole < 2.1200) {
                    $Res = self::C_TRUE;
                  } else {
                    $Res = self::C_FALSE;
                  }
                } else {
                  if ($this -> HbAcc < 2.5000) {
                    if ($this -> Rings < 1.5000) {
                      if ($this -> Sav < 575.0000) {
                        $Res = self::C_TRUE;
                      } else {
                        if ($this -> Sdiam < 8.5700) {
                          $Res = self::C_FALSE;
                        } else {
                          $Res = self::C_TRUE;
                        }
                      }
                    } else {
                      if ($this -> Torsions < 15.5000) {
                        $Res = self::C_FALSE;
                      } else {
                        if ($this -> HeavyAtoms < 15.5000) {
                          $Res = self::C_TRUE;
                        } else {
                          $Res = self::C_FALSE;
                        }
                      }
                    }
                  } else {
                    if ($this -> HeavyAtoms < 12.5000) {
                      $Res = self::C_FALSE;
                    } else {
                      if ($this -> Angles < 39.5000) {
                        $Res = self::C_TRUE;
                      } else {
                        if ($this -> Torsions < 14.5000) {
                          $Res = self::C_FALSE;
                        } else {
                          if ($this -> HeavyAtoms < 16.5000) {
                            if ($this -> ChiralAtms < 1.5000) {
                              $Res = self::C_FALSE;
                            } else {
                              $Res = self::C_TRUE;
                            }
                          } else {
                            $Res = self::C_TRUE;
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          } else {
            if ($this -> Vdiam < 7.3000) {
              $Res = self::C_FALSE;
            } else {
              if ($this -> Sas < 561.9500) {
                if ($this -> HeavyAtoms < 19.5000) {
                  if ($this -> Torsions < 19.5000) {
                    if ($this -> FG_COOH == self::C_FG_COOH_YES) {
                      $Res = self::C_FALSE;
                    } else {
                      $Res = self::C_TRUE;
                    }
                  } else {
                    $Res = self::C_TRUE;
                  }
                } else {
                  $Res = self::C_TRUE;
                }
              } else {
                $Res = self::C_FALSE;
              }
            }
          }
        } else {
          if ($this -> Ovality < 1.6900) {
            if ($this -> HbAcc < 3.5000) {
              if ($this -> Rings < 1.5000) {
                $Res = self::C_FALSE;
              } else {
                if ($this -> Mass < 303.4100) {
                  if ($this -> Ovality < 1.5900) {
                    $Res = self::C_FALSE;
                  } else {
                    $Res = self::C_TRUE;
                  }
                } else {
                  $Res = self::C_FALSE;
                }
              }
            } else {
              if ($this -> Mass < 356.3800) {
                $Res = self::C_FALSE;
              } else {
                if ($this -> EzBnds < 0.5000) {
                  $Res = self::C_FALSE;
                } else {
                  if ($this -> Mass < 362.3900) {
                    $Res = self::C_TRUE;
                  } else {
                    $Res = self::C_FALSE;
                  }
                }
              }
            }
          } else {
            if ($this -> Sdiam < 10.9700) {
              if ($this -> Lipole < 2.3800) {
                if ($this -> HbAcc < 3.5000) {
                  $Res = self::C_TRUE;
                } else {
                  $Res = self::C_FALSE;
                }
              } else {
                $Res = self::C_FALSE;
              }
            } else {
              if ($this -> VirtualLogP < 3.4100) {
                if ($this -> Dipole < 2.8300) {
                  $Res = self::C_FALSE;
                } else {
                  $Res = self::C_TRUE;
                }
              } else {
                $Res = self::C_TRUE;
              }
            }
          }
        }
      } else {
        if ($this -> FlexTorsions < 1.0000) {
          $Res = self::C_TRUE;
        } else {
          if ($this -> Ovality < 1.7300) {
            $Res = self::C_FALSE;
          } else {
            if ($this -> Psa < 59.6600) {
              if ($this -> HeavyAtoms < 31.0000) {
                if ($this -> Bonds < 51.5000) {
                  $Res = self::C_FALSE;
                } else {
                  $Res = self::C_TRUE;
                }
              } else {
                if ($this -> FlexTorsions < 9.0000) {
                  $Res = self::C_FALSE;
                } else {
                  $Res = self::C_TRUE;
                }
              }
            } else {
              if ($this -> FG_PhOH == self::C_FG_PHOH_YES) {
                if ($this -> Angles < 119.5000) {
                  $Res = self::C_TRUE;
                } else {
                  if ($this -> Angles < 230.0000) {
                    $Res = self::C_FALSE;
                  } else {
                    if ($this -> ChiralAtms < 21.5000) {
                      $Res = self::C_FALSE;
                    } else {
                      $Res = self::C_TRUE;
                    }
                  }
                }
              } else {
                if ($this -> FG_F == self::C_FG_F_YES) {
                  if ($this -> ChiralAtms < 1.5000) {
                    $Res = self::C_TRUE;
                  } else {
                    if ($this -> Vdiam < 9.0700) {
                      $Res = self::C_FALSE;
                    } else {
                      $Res = self::C_TRUE;
                    }
                  }
                } else {
                  if ($this -> Lipole < 2.3100) {
                    if ($this -> FlexTorsions < 8.5000) {
                      if ($this -> Sas < 977.1200) {
                        if ($this -> EzBnds < 0.5000) {
                          if ($this -> ChiralAtms < 0.5000) {
                            if ($this -> Mass < 441.2400) {
                              $Res = self::C_TRUE;
                            } else {
                              $Res = self::C_FALSE;
                            }
                          } else {
                            $Res = self::C_FALSE;
                          }
                        } else {
                          if ($this -> Bonds < 59.0000) {
                            $Res = self::C_FALSE;
                          } else {
                            $Res = self::C_TRUE;
                          }
                        }
                      } else {
                        $Res = self::C_TRUE;
                      }
                    } else {
                      $Res = self::C_FALSE;
                    }
                  } else {
                    $Res = self::C_FALSE;
                  }
                }
              }
            }
          }
        }
      }
    }

    return $Res;
  }


  /**** Domain check method ****/

  /*
   * Return the number of domain violations
   */

  function DomCheck()
  {
    $Violations = 0;

    if (($this -> Angles < 6.00000000) || ($this -> Angles > 374.00000000)) $Violations++;
    if (($this -> Atoms < 5.00000000) || ($this -> Atoms > 203.00000000)) $Violations++;
    if (($this -> Bonds < 4.00000000) || ($this -> Bonds > 206.00000000)) $Violations++;
    if (($this -> ChiralAtms < 0.00000000) || ($this -> ChiralAtms > 25.00000000)) $Violations++;
    if (($this -> Dipole < 0.00001200) || ($this -> Dipole > 22.36607000)) $Violations++;
    if (($this -> EzBnds < 0.00000000) || ($this -> EzBnds > 7.00000000)) $Violations++;
    if (($this -> FlexTorsions < 0.00000000) || ($this -> FlexTorsions > 28.00000000)) $Violations++;
    if (($this -> Gyrrad < 1.41856400) || ($this -> Gyrrad > 10.56297000)) $Violations++;
    if (($this -> HbAcc < 0.00000000) || ($this -> HbAcc > 26.00000000)) $Violations++;
    if (($this -> HbDon < 0.00000000) || ($this -> HbDon > 21.00000000)) $Violations++;
    if (($this -> HeavyAtoms < 3.00000000) || ($this -> HeavyAtoms > 101.00000000)) $Violations++;
    if (($this -> Lipole < 0.00000300) || ($this -> Lipole > 6.34667600)) $Violations++;
    if (($this -> Mass < 70.08984000) || ($this -> Mass > 1449.25400000)) $Violations++;
    if (($this -> Ovality < 1.16274900) || ($this -> Ovality > 2.74024100)) $Violations++;
    if (($this -> Psa < 0.00000000) || ($this -> Psa > 544.81690000)) $Violations++;
    if (($this -> Rings < 0.00000000) || ($this -> Rings > 10.00000000)) $Violations++;
    if (($this -> Sas < 203.40610000) || ($this -> Sas > 2006.11400000)) $Violations++;
    if (($this -> Sav < 252.97150000) || ($this -> Sav > 3811.29900000)) $Violations++;
    if (($this -> Sdiam < 5.14906200) || ($this -> Sdiam > 22.48208000)) $Violations++;
    if (($this -> Torsions < 0.00000000) || ($this -> Torsions > 94.00000000)) $Violations++;
    if (($this -> Vdiam < 4.77512900) || ($this -> Vdiam > 13.58132000)) $Violations++;
    if (($this -> VirtualLogP < -7.13032600) || ($this -> VirtualLogP > 9.48374900)) $Violations++;

    return $Violations;
  }
}
?>
