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


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

class random_tree {

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

  static final int C_FALSE = 0;
  static final int C_TRUE = 1;

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

  static final int C_FG_CON2_NO = 0;
  static final int C_FG_CON2_YES = 1;
  static final int C_FG_COOH_NO = 0;
  static final int C_FG_COOH_YES = 1;
  static final int C_FG_COOR_NO = 0;
  static final int C_FG_COOR_YES = 1;
  static final int C_FG_F_NO = 0;
  static final int C_FG_F_YES = 1;
  static final int C_FG_PHOH_NO = 0;
  static final int C_FG_PHOH_YES = 1;

  /**** Attributes ****/

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


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

  int Classify()
  {
    int    Res;

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

    return Res;
  }


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

  /*
   * Return the number of domain violations
   */

  int DomCheck()
  {
    int Violations = 0;

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

    return Violations;
  }
}
