Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

42
LINES

< > BotCompany Repo | #1003020 // Test Opposites Bot Load Bug

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1651L/11K/37K).

1  
!752
2  
3  
!include #1003021 // new unstructure
4  
5  
static new MultiMap<S, Node> byName; // multiple entries not really handled yet
6  
7  
sclass BaseNode {
8  
  S id = randomID(12);
9  
  S name;
10  
  
11  
  new L<Node> related;
12  
  new Map<Node, Float> relationStrengths; // strength of relation, 0 to 1
13  
  new L<O> identicalOuter; // identical nodes in other bots
14  
15  
  *() {}  
16  
  *(S *name) {
17  
    byName.put(name, (Node) this);
18  
  }
19  
  
20  
}
21  
22  
sclass Node extends BaseNode {
23  
  *() {}
24  
  *(S name) {
25  
    super(name);
26  
  }
27  
  
28  
  new L<Node> opposites; // list of opposites
29  
  new L<Node> dropped; // no longer considered opposites
30  
  new Map<Node, S> modifiers; // optional modifier for each entry
31  
  new Map<Node, L> sources; // source(s) of each entry
32  
}
33  
34  
p {
35  
  readLocally("#1003015", "byName");
36  
  for (S name : keys(byName.data)) {
37  
    print(name);
38  
    L nodes = byName.data.get(name);
39  
    for (O n : nodes)
40  
      print("  " + n.getClass());
41  
  }
42  
}

Author comment

Began life as a copy of #1003015

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003020
Snippet name: Test Opposites Bot Load Bug
Eternal ID of this version: #1003020/1
Text MD5: d36f2d0f537950dd29e2d328414addba
Transpilation MD5: 7ecf377bea673a12d6dc3d8f57570454
Author: stefan
Category: nl bots
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-04-19 17:54:12
Source code size: 949 bytes / 42 lines
Pitched / IR pitched: No / No
Views / Downloads: 572 / 656
Referenced in: [show references]