View Javadoc

1   package cz.cuni.amis.pogamut.base.agent.impl;
2   
3   import com.google.inject.Inject;
4   
5   import cz.cuni.amis.pogamut.base.agent.IAgentId;
6   import cz.cuni.amis.pogamut.base.agent.IGhostAgent;
7   import cz.cuni.amis.pogamut.base.communication.command.IAct;
8   import cz.cuni.amis.pogamut.base.communication.worldview.IWorldView;
9   import cz.cuni.amis.pogamut.base.component.bus.IComponentBus;
10  import cz.cuni.amis.pogamut.base.utils.guice.AgentScoped;
11  import cz.cuni.amis.pogamut.base.utils.logging.IAgentLogger;
12  import cz.cuni.amis.utils.NullCheck;
13  
14  /**
15   * Next step to embodied agents are those without the physical body
16   * but with the ability to act inside the environment.
17   * <p><p>
18   * Example can be a world controller that is connected to the world gets all world
19   * events (knows everything) and can alter the environment (sounds like a god, right? :-).
20   * 
21   * @author Jimmy
22   */
23  @AgentScoped
24  public abstract class AbstractGhostAgent<WORLD_VIEW extends IWorldView, ACT extends IAct> 
25         extends        AbstractObservingAgent<WORLD_VIEW>
26         implements     IGhostAgent {
27  	
28  	private ACT act;
29  	
30  	@Inject
31  	public AbstractGhostAgent(IAgentId agentId, IComponentBus bus, IAgentLogger logger, WORLD_VIEW worldView, ACT act) {
32  		super(agentId, bus, logger, worldView);
33  		this.act = act;
34  		NullCheck.check(this.act, "act");
35  		addDependency(act);
36  	}
37  	
38      @Override
39  	public ACT getAct() {
40  		return act; 
41  	}
42  	
43  }