source: src/main/java/genius/gui/domainrepository/MyTreeNode.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.2 KB
Line 
1package genius.gui.domainrepository;
2
3import javax.swing.tree.DefaultMutableTreeNode;
4
5import genius.core.exceptions.Warning;
6import genius.core.repository.DomainRepItem;
7import genius.core.repository.ProfileRepItem;
8import genius.core.repository.RepItem;
9
10public class MyTreeNode extends DefaultMutableTreeNode {
11
12 private static final long serialVersionUID = -4929729243877782033L;
13 RepItem repository_item;
14
15 public MyTreeNode(RepItem item)
16 {
17 super(item);
18 repository_item=item;
19 }
20
21 public String toString() {
22 if (repository_item==null) return "";
23 if (repository_item instanceof DomainRepItem)
24 return shortfilename(((DomainRepItem)repository_item).getURL().getFile());
25 if (repository_item instanceof ProfileRepItem)
26 return shortfilename( ((ProfileRepItem)repository_item).getURL().getFile());
27 new Warning("encountered item "+repository_item+" of type "+repository_item.getClass());
28 return "ERR";
29 }
30 /** returns only the filename given a full path with separating '/' */
31 public String shortfilename(String filename) {
32 int lastslash=filename.lastIndexOf('/');
33 if (lastslash==-1) return filename;
34 return filename.substring(lastslash+1);
35 }
36
37 public RepItem getRepositoryItem() { return repository_item; }
38}
Note: See TracBrowser for help on using the repository browser.