1 package cz.cuni.amis.pogamut.base.agent.params;
2
3 import cz.cuni.amis.pogamut.base.agent.IAgentId;
4 import cz.cuni.amis.pogamut.base.agent.utils.runner.IAgentRunner;
5
6 /**
7 * Parent interface for all agent's parameters interfaces/implementations.
8 * <p><p>
9 * Note that this is the most general way for passing parameters to Java, i.e., you are allowed to pass
10 * arbitrary object (possibly containing getters for more objects) that configures your agent.
11 * <p><p>
12 * The best (and intended) usage is to put the implementation of this interface into the module for
13 * Guice IOC which will allow you to inject those parameters to any class you want allowing you to
14 * easily pass values from the outside to any inner agent's class (it suffice to put {@link IAgentParameters}
15 * as a parameter of the constructor used by Guice).
16 *
17 * @author Jimmy
18 */
19 public interface IAgentParameters {
20
21 /**
22 * Fills missing parameters of 'this' with values from 'defaults'.
23 * <p><p>
24 * This method is meant as a hook for {@link IAgentRunner}s that can ease the burden
25 * of instantiating&launching the agent into a specific environment.
26 * <p><p>
27 * It assigns params from 'default' only to fields (of this) that are null!
28 *
29 * @param defaults values that should filled missing parameters
30 */
31 public void assignDefaults(IAgentParameters defaults);
32
33 /**
34 * Returns unique agent's id (and human-readable name) that is going to be used by the newly created agent instance.
35 * @return unique agent's id
36 */
37 public IAgentId getAgentId();
38
39 }