--------------------------------------------
----            Lua example             ----
---- (c) 2017-2019, Alessandro Pedretti ----
--------------------------------------------


require 'random_tree'

Model = random_tree:New()


---- Prediction example 1 ----

Model.Angles = 325
Model.Atoms = 176
Model.Bonds = 185
Model.ChiralAtms = 18
Model.Dipole = 8.4205
Model.EzBnds = 0
Model.FG_CON2 = 0
Model.FG_COOH = 1
Model.FG_COOR = 0
Model.FG_F = 0
Model.FG_PhOH = 1
Model.FlexTorsions = 12
Model.Gyrrad = 7.364614
Model.HbAcc = 26
Model.HbDon = 21
Model.HeavyAtoms = 101
Model.Lipole = 0.858332
Model.Mass = 1449.254
Model.Ovality = 2.463538
Model.Psa = 498.9334
Model.Rings = 10
Model.Sas = 1573.201
Model.Sav = 3197.086
Model.Sdiam = 20.67702
Model.Torsions = 94
Model.Vdiam = 13.17372
Model.VirtualLogP = 0.346624

print("\n* Example #1")
print("  Domain violations: " .. Model:DomCheck() .. " (must be 0)")
print("  Predicted class:   " .. Model:Classify() .. " (real 0)")


---- Prediction example 2 ----

Model.Angles = 298
Model.Atoms = 152
Model.Bonds = 159
Model.ChiralAtms = 25
Model.Dipole = 7.189289
Model.EzBnds = 0
Model.FG_CON2 = 0
Model.FG_COOH = 0
Model.FG_COOR = 0
Model.FG_F = 0
Model.FG_PhOH = 1
Model.FlexTorsions = 15
Model.Gyrrad = 8.992547
Model.HbAcc = 24
Model.HbDon = 11
Model.HeavyAtoms = 76
Model.Lipole = 0.810682
Model.Mass = 1085.146
Model.Ovality = 2.443584
Model.Psa = 362.2158
Model.Rings = 8
Model.Sas = 1451.669
Model.Sav = 2739.57
Model.Sdiam = 19.1786
Model.Torsions = 72
Model.Vdiam = 12.26883
Model.VirtualLogP = 0.76864

print("\n* Example #2")
print("  Domain violations: " .. Model:DomCheck() .. " (must be 0)")
print("  Predicted class:   " .. Model:Classify() .. " (real 1)")
