
/*******************************************
****           Java example             ****
**** (c) 2017-2019, Alessandro Pedretti ****
*******************************************/


public class random_forest_test
{
  public static void main(String[] args)
  {
	random_forest Model = new random_forest();

    /**** Prediction example 1 ****/

    Model.Angles       = 108.0f;
    Model.Atoms        = 60.0f;
    Model.Bonds        = 63.0f;
    Model.Charge       = 0.0f;
    Model.ChiralAtms   = 0.0f;
    Model.Dipole       = 2.54652f;
    Model.EzBnds       = 2.0f;
    Model.FlexTorsions = 10.0f;
    Model.Gyrrad       = 7.528516f;
    Model.HbAcc        = 4.0f;
    Model.HbDon        = 2.0f;
    Model.HeavyAtoms   = 32.0f;
    Model.Impropers    = 21.0f;
    Model.Lipole       = 2.13308f;
    Model.Mass         = 448.5804f;
    Model.Ovality      = 1.894926f;
    Model.Psa          = 92.87458f;
    Model.Rings        = 4.0f;
    Model.Sas          = 809.6651f;
    Model.Sav          = 1316.951f;
    Model.Sdiam        = 12.73983f;
    Model.Surface      = 509.8912f;
    Model.Torsions     = 32.0f;
    Model.Vdiam        = 9.254815f;
    Model.VirtualLogP  = 4.190687f;
    Model.Volume       = 415.0514f;

    System.out.printf("\n* Example #1\n");
    System.out.printf("  Domain violations: %d (must be 0)\n", Model.DomCheck());
    System.out.printf("  Predicted class:   %d (real 0)\n", Model.Classify());


    /**** Prediction example 2 ****/

    Model.Angles       = 27.0f;
    Model.Atoms        = 18.0f;
    Model.Bonds        = 18.0f;
    Model.Charge       = 0.0f;
    Model.ChiralAtms   = 0.0f;
    Model.Dipole       = 0.245056f;
    Model.EzBnds       = 1.0f;
    Model.FlexTorsions = 2.0f;
    Model.Gyrrad       = 2.415841f;
    Model.HbAcc        = 2.0f;
    Model.HbDon        = 4.0f;
    Model.HeavyAtoms   = 10.0f;
    Model.Impropers    = 9.0f;
    Model.Lipole       = 4.472592f;
    Model.Mass         = 156.2088f;
    Model.Ovality      = 1.382357f;
    Model.Psa          = 96.54134f;
    Model.Rings        = 1.0f;
    Model.Sas          = 330.8518f;
    Model.Sav          = 474.6761f;
    Model.Sdiam        = 7.461171f;
    Model.Surface      = 174.8896f;
    Model.Torsions     = 9.0f;
    Model.Vdiam        = 6.345953f;
    Model.VirtualLogP  = 0.500129f;
    Model.Volume       = 133.8102f;

    System.out.printf("\n* Example #2\n");
    System.out.printf("  Domain violations: %d (must be 0)\n", Model.DomCheck());
    System.out.printf("  Predicted class:   %d (real 1)\n", Model.Classify());
  }
}
