source: src/main/java/agents/anac/y2015/xianfa/AIssue.java@ 126

Last change on this file since 126 was 126, checked in by Aron Hammond, 6 years ago

Added function to calculate opposition to MultiLateralAnalysis.java

Moved code to add RLBOA listeners to RLBOAUtils is misc package

Added input for strategyParameters to SessionPanel (gui)

!! close SessionInfo after tournament; this caused /tmp/ to fill up with GeniusData files

Our own package:

  • Added opponents and strategies that are mentioned in the report
  • Change class hierarchy, agents can now extend from RLBOAagentBilateral to inherit RL functionality.
  • States extend from AbstractState
File size: 862 bytes
Line 
1package agents.anac.y2015.xianfa;
2
3import java.util.HashMap;
4import java.util.Random;
5
6import genius.core.issue.Value;
7
8public class AIssue {
9
10 HashMap<Value, Double> values = new HashMap<Value, Double>();
11 int issnr;
12
13 public AIssue(int n) {
14 issnr = n;
15 }
16
17 public int getIssNr() {
18 return issnr;
19 }
20
21 public void setVal(Value val, int total, int act) {
22 double freq = values.get(val);
23 if (act == 0) {
24 values.put(val, ((freq*(total-1))+1)/total);
25 } else {
26 values.put(val, freq+0.13);
27 }
28
29 }
30
31 public Value getDesiredVal() {
32 double max = 0;
33 Value value = new Value();
34 for (Value v : values.keySet()) {
35 if (values.get(v) > max) {
36 max = values.get(v);
37 value = v;
38 }
39 }
40 return value;
41 }
42
43 public double getVal(Value val) {
44 return values.get(val);
45 }
46
47 public HashMap<Value, Double> getValues() {
48 return values;
49 }
50}
Note: See TracBrowser for help on using the repository browser.