source: src/main/java/genius/core/tournament/VariablesAndValues/AgentParameterVariable.java

Last change on this file was 1, checked in by Wouter Pasman, 6 years ago

Initial import : Genius 9.0.0

File size: 1.5 KB
Line 
1package genius.core.tournament.VariablesAndValues;
2
3import genius.core.AgentParam;
4
5/**
6 * ProfileVariable is a variable for a tournament,
7 * indicating that the profile is to be manipulated.
8 * It just is an indicator for the TournamentVariable that its
9 * value array contains a ProfileValue.
10 *
11 * @author wouter
12 *
13 */
14public class AgentParameterVariable extends TournamentVariable
15{
16 private static final long serialVersionUID = -8223126402840072070L;
17
18 @Override
19 public int hashCode() {
20 final int prime = 31;
21 int result = 1;
22 // result = prime * result
23 // + ((agentparam == null) ? 0 : agentparam.hashCode());
24 return result;
25 }
26
27 @Override
28 public boolean equals(Object obj) {
29 if (this == obj)
30 return true;
31 if (obj == null)
32 return false;
33 if (getClass() != obj.getClass())
34 return false;
35 AgentParameterVariable other = (AgentParameterVariable) obj;
36 if (agentparam == null) {
37 if (other.agentparam != null)
38 return false;
39 } else if (!agentparam.equals(other.agentparam))
40 return false;
41 return true;
42 }
43
44 AgentParam agentparam; // the name and other info about the parameter
45
46 /**
47 * @param para the parameter info
48 */
49 public AgentParameterVariable(AgentParam para) {
50 agentparam=para;
51 }
52
53 public void addValue(TournamentValue v) throws Exception
54 {
55 if (!(v instanceof AgentParamValue))
56 throw new IllegalArgumentException("Expected AgentParamValue but received "+v);
57 values.add(v);
58 }
59
60 public AgentParam getAgentParam() { return agentparam; }
61
62 public String varToString() {
63 return "AgentParamVar:"+agentparam.name;
64 }
65
66}
Note: See TracBrowser for help on using the repository browser.