'RESOURCE specifications and tracking of agent

I need to solve a problem, which due to my lack of Java training I can't solve. What is the code to write to trace the agent who took a resource? Let me explain better...I have a series of rooms, each agent who enters the structure takes a room which he keeps for his entire stay, and I would like to see in real-time, which rooms are occupied and by which agent. How can I do this? Thank you



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source