File size: 721 Bytes
f2beac3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from agent import RuleBasedPharmaAgent
from env import PharmaVigilanceEnv


def main() -> None:
    env = PharmaVigilanceEnv()
    agent = RuleBasedPharmaAgent()

    for task_id in ("known_signal_easy", "cluster_signal_medium", "confounded_hard"):
        observation = env.reset(task_id)
        action = agent.act(observation)
        observation, reward, done, info = env.step(action)

        print(f"\nTask: {task_id}")
        print(f"Action: {action.classification} / {action.suspect_drug}")
        print(f"Reward: {reward.total:.2f}")
        print(f"Done: {done}")
        print(f"Feedback: {observation.feedback}")
        print(f"Info: {info}")


if __name__ == "__main__":
    main()