Exemple #1
0
 def test_GetResults_from_Compounds_fraction(self):
     csmile = "[H][C](=[O])[C]([H])([H])[C]([H])([H])[H]"
     chassis_2_smile = "[H][O][C](=[O])[C](=[O])[C]([H])([H])[C]([H])([O][H])[C]([H])([O][H])[C]([H])([H])[H]"
     outside_compound = Compound(csmile)
     chassis_2 = Compound(chassis_2_smile)
     state_chassis = ChemicalCompoundState([chassis_2, outside_compound],
                                           organism=Test_organism_H)
     assert state_chassis.GetResults_from_Compounds(
         rewarding=Basic_Rollout_Reward) == 1 / 2
Exemple #2
0
 def test_GetResults_from_Compounds_reward(self):
     chassis_1_smile = "[H+]"
     chassis_2_smile = "[H][O][C](=[O])[C](=[O])[C]([H])([H])[C]([H])([O][H])[C]([H])([O][H])[C]([H])([H])[H]"
     chassis_1 = Compound(chassis_1_smile)
     chassis_2 = Compound(chassis_2_smile)
     state_chassis = ChemicalCompoundState([chassis_1, chassis_2],
                                           organism=Test_organism_H)
     assert state_chassis.GetResults_from_Compounds(
         rewarding=Basic_Rollout_Reward
     ) == Basic_Rollout_Reward.full_state_reward
Exemple #3
0
 def test_GetResults_from_Compounds_penalty(self):
     csmile = "[H][C](=[O])[C]([H])([H])[C]([H])([H])[H]"
     compound = Compound(csmile)
     state = ChemicalCompoundState([compound], organism=Test_organism_H)
     assert state.GetResults_from_Compounds(
         rewarding=Basic_Rollout_Reward) == -1