source: src/main/java/genius/gui/progress/ProgressInfo.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: 1.6 KB
Line 
1package genius.gui.progress;
2
3import javax.swing.table.AbstractTableModel;
4
5class ProgressInfo extends AbstractTableModel{
6
7 private static final long serialVersionUID = 7091049252211861744L;
8 private static final int NUMBER_OF_COLUMNS = 8;
9 private String[] colNames={"Round","Side","utilA","utilB","utilA discount","utilB discount", "Time"};
10 private Object[][] data;
11
12 public ProgressInfo()
13 {
14 super();
15 data = new Object [NUMBER_OF_COLUMNS][colNames.length];
16 }
17
18 public void addRow(){
19 int currentLength = data.length;
20 Object [][] temp = new Object [currentLength+1][colNames.length];
21 //System.out.println("temp length "+temp.length);
22 for(int j=0;j<temp.length-1;j++){
23 for(int i=0;i<colNames.length;i++){
24 temp [j][i] = data [j][i];
25 //System.out.println("temp data "+temp [j][i]);
26 }
27 }
28 data = temp;
29 fireTableDataChanged();
30 }
31
32 public void reset()
33 {
34// System.out.println("reset the JTable now.");
35 data = new Object [NUMBER_OF_COLUMNS][colNames.length];
36 fireTableDataChanged();
37 }
38
39 public int getColumnCount() {
40 return colNames.length;
41 }
42
43 public int getRowCount() {
44 return data.length;
45 }
46
47 public String getColumnName(int col) {
48 return colNames[col];
49 }
50
51 public Object getValueAt(int row, int col) {
52 Object result = null;
53 try {
54 result = data[row][col];
55 } catch (Exception e) { }
56 return result;
57 }
58
59 public void setValueAt(Object value, int row, int col) {
60 data[row][col] = value;
61 //Notify all listeners that the value of the cell at (row, column) has been updated
62 fireTableCellUpdated(row, col);
63 }
64
65}
Note: See TracBrowser for help on using the repository browser.