I've built a generic agent
that will be instantiated several times in the environment:
unit agent_u {
monitor : monitor_u is instance;
};
The monitor prints some messages, e.g.:
unit monitor_u {
run() is also {
message(LOW, "Hello monitor!");
};
};
I would like to add to the monitor's messages which agent instance has printed them. For example, for environment:
extend sys {
first_agent : agent_u is instance;
second_agent : agent_u is instance;
};
the desirable output will be something like that:
first_agent: Hello monitor!
second_agent: Hello monitor!
I could not find anything related to instance name in the reflection API... Is there some way to print an instance name in e?
Thank you for your help