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.0 KB
|
Line | |
---|
1 | package genius.gui.panels;
|
---|
2 |
|
---|
3 | import java.util.ArrayList;
|
---|
4 | import java.util.List;
|
---|
5 |
|
---|
6 | import javax.swing.AbstractListModel;
|
---|
7 | import javax.swing.ComboBoxModel;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * Extends the default ListModel by allowing it to be loaded afterwards with
|
---|
11 | * data.
|
---|
12 | *
|
---|
13 | * @author Mark Hendrikx (m.j.c.hendrikx@student.tudelft.nl)
|
---|
14 | * @version 05/12/11
|
---|
15 | */
|
---|
16 | public class ExtendedComboBoxModel<A> extends AbstractListModel<A> implements ComboBoxModel<A> {
|
---|
17 | private static final long serialVersionUID = -8345719619830961700L;
|
---|
18 | private List<A> items = new ArrayList<A>();
|
---|
19 | private A selection;
|
---|
20 |
|
---|
21 | public void setInitialContent(List<A> items) {
|
---|
22 | this.items = items;
|
---|
23 |
|
---|
24 | }
|
---|
25 |
|
---|
26 | public A getElementAt(int index) {
|
---|
27 | if (index >= 0) {
|
---|
28 | return items.get(index);
|
---|
29 | }
|
---|
30 | return null;
|
---|
31 | }
|
---|
32 |
|
---|
33 | public int getSize() {
|
---|
34 | return items.size();
|
---|
35 | }
|
---|
36 |
|
---|
37 | public void removeElementAt(int i) {
|
---|
38 | items.remove(i);
|
---|
39 | }
|
---|
40 |
|
---|
41 | @Override
|
---|
42 | public A getSelectedItem() {
|
---|
43 | return selection;
|
---|
44 | }
|
---|
45 |
|
---|
46 | @SuppressWarnings("unchecked")
|
---|
47 | @Override
|
---|
48 | public void setSelectedItem(Object anItem) {
|
---|
49 | selection = (A) anItem;
|
---|
50 | }
|
---|
51 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.