#!/usr/bin/env python3.5

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


#**** Model class ****

class T2PY_RANDOM_TREE:

  #**** Output values ****

  C_FALSE = 0
  C_TRUE = 1

  #**** Values of the attributes ****

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

  #**** Properties ****

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


  #**** Classification method ****

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

  def DomCheck(self):
    Violations = 0

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

    return Violations
