1 package cz.cuni.amis.pogamut.ut2004.analyzer;
2
3 import java.util.Map;
4
5 import cz.cuni.amis.pogamut.base.agent.IAgentId;
6 import cz.cuni.amis.pogamut.base.agent.params.IAgentParameters;
7 import cz.cuni.amis.pogamut.base.communication.connection.IWorldConnectionAddress;
8 import cz.cuni.amis.pogamut.base.communication.connection.impl.socket.SocketConnectionAddress;
9 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
10 import cz.cuni.amis.pogamut.ut2004.agent.params.UT2004AgentParameters;
11 import cz.cuni.amis.pogamut.ut2004.factory.guice.remoteagent.UT2004ObserverModule;
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 public class UT2004AnalyzerParameters extends UT2004AgentParameters {
31
32 private SocketConnectionAddress observerAddress;
33 private UT2004AnalyzerFullObserverModule observerModule;
34 private String outputPath;
35 private Boolean waitForMatchRestart = null;
36 private Map<UnrealId, String> fileNames = null;
37 private Boolean humanLikeObserving = null;
38
39
40
41
42
43
44 public UT2004AnalyzerParameters() {
45 super();
46 }
47
48 public UT2004AnalyzerFullObserverModule getObserverModule() {
49 return observerModule;
50 }
51
52
53
54
55
56
57
58
59
60
61 public UT2004AnalyzerParameters setObserverModule(UT2004AnalyzerFullObserverModule observerModule) {
62 this.observerModule = observerModule;
63 return this;
64 }
65
66 @Override
67 public UT2004AnalyzerParameters setAgentId(IAgentId agentId) {
68 super.setAgentId(agentId);
69 return this;
70 }
71
72 @Override
73 public UT2004AnalyzerParameters setWorldAddress(IWorldConnectionAddress address) {
74 super.setWorldAddress(address);
75 return this;
76 }
77
78
79
80
81
82 public String getOutputPath() {
83 return outputPath;
84 }
85
86
87
88
89
90 public UT2004AnalyzerParameters setOutputPath(String outputPath) {
91 this.outputPath = outputPath;
92 return this;
93 }
94
95
96
97
98
99 public boolean isWaitForMatchRestart() {
100 return waitForMatchRestart == null ? false : waitForMatchRestart;
101 }
102
103
104
105
106
107 public UT2004AnalyzerParameters setWaitForMatchRestart(boolean waitForMatchRestart) {
108 this.waitForMatchRestart = waitForMatchRestart;
109 return this;
110 }
111
112
113
114
115
116 public Map<UnrealId, String> getFileNames() {
117 return fileNames;
118 }
119
120
121
122
123
124
125 public UT2004AnalyzerParameters setFileNames(Map<UnrealId, String> fileNames) {
126 this.fileNames = fileNames;
127 return this;
128 }
129
130
131
132
133
134 public SocketConnectionAddress getObserverAddress() {
135 return observerAddress;
136 }
137
138
139
140
141
142 public UT2004AnalyzerParameters setObserverAddress(SocketConnectionAddress observerAddress) {
143 this.observerAddress = observerAddress;
144 return this;
145 }
146
147
148
149
150
151 public Boolean getHumanLikeObserving() {
152 return humanLikeObserving;
153 }
154
155
156
157
158
159 public UT2004AnalyzerParameters setHumanLikeObserving(Boolean humanLikeObserving) {
160 this.humanLikeObserving = humanLikeObserving;
161 return this;
162 }
163
164 @Override
165 public void assignDefaults(IAgentParameters defaults) {
166 super.assignDefaults(defaults);
167 if (defaults instanceof UT2004AnalyzerParameters) {
168 if (observerModule == null) observerModule = ((UT2004AnalyzerParameters)defaults).getObserverModule();
169 if (observerAddress == null) observerAddress = ((UT2004AnalyzerParameters)defaults).getObserverAddress();
170 if (outputPath == null) outputPath = ((UT2004AnalyzerParameters)defaults).getOutputPath();
171 if (waitForMatchRestart == null && ((UT2004AnalyzerParameters)defaults).waitForMatchRestart != null)
172 waitForMatchRestart = ((UT2004AnalyzerParameters)defaults).waitForMatchRestart;
173 if (fileNames == null && ((UT2004AnalyzerParameters)defaults).fileNames != null) {
174 this.fileNames = ((UT2004AnalyzerParameters)defaults).fileNames;
175 }
176 if (humanLikeObserving == null) {
177 humanLikeObserving = ((UT2004AnalyzerParameters)defaults).humanLikeObserving;
178 }
179 }
180 }
181
182 }