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.IObservingAgent;
7 import cz.cuni.amis.pogamut.base.communication.worldview.IWorldView;
8 import cz.cuni.amis.pogamut.base.component.bus.IComponentBus;
9 import cz.cuni.amis.pogamut.base.utils.guice.AgentScoped;
10 import cz.cuni.amis.pogamut.base.utils.logging.IAgentLogger;
11 import cz.cuni.amis.utils.NullCheck;
12
13
14
15
16
17
18
19
20
21 @AgentScoped
22 public abstract class AbstractObservingAgent<WORLD_VIEW extends IWorldView>
23 extends AbstractAgent implements IObservingAgent {
24
25
26
27
28
29
30
31
32 private WORLD_VIEW worldView;
33
34 @Inject
35 public AbstractObservingAgent(IAgentId agentId, IComponentBus bus, IAgentLogger logger, WORLD_VIEW worldView) {
36 super(agentId, bus, logger);
37 this.worldView = worldView;
38 NullCheck.check(this.worldView, "worldView");
39 addDependency(worldView);
40 }
41
42
43
44
45
46
47
48
49
50 @Override
51 public WORLD_VIEW getWorldView() {
52 return worldView;
53 }
54
55 }