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