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