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

43
LINES

< > BotCompany Repo | #1023195 // MultiSpaceReasoning1

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (10386L) is out of date.

1  
sclass MultiSpaceReasoning1 {
2  
  // spaces & names
3  
  
4  
  sS objectiveSpace = 'objective, computerSpace = 'computer, userSpace = 'user;
5  
  S userName = "usery", computerName = "computery";
6  
  
7  
  int stepLimit = 1000;
8  
  
9  
  new MultiMap<S, IAttractor> rulesForSpace;
10  
  bool debug;
11  
  
12  
  Set<ES> rewriteInSpace(S space, Collection<ES> inputs) {
13  
    ret applyAttractors_es(rulesForSpace.get(space), inputs, max := stepLimit);
14  
  }
15  
  
16  
  Collection<ES> reason_inputToAnswer(S input) {
17  
    ret reason_inputToAnswer(ll(ext(input)));
18  
  }
19  
  
20  
  Collection<ES> reason_inputToAnswer(Collection<ES> inputs) {
21  
    // first, rewrite in user space
22  
    Set<ES> outputs = rewriteInSpace(userSpace, inputs);
23  
    if (debug) pnlIndent("User space > ", outputs);
24  
    
25  
    // translate to objective space
26  
    Collection<ES> outputs2 = ai_spaceToSpace_es(userSpace, objectiveSpace, outputs, +computerName, +userName);
27  
    if (debug) pnlIndent("Translated to objective space > ", outputs2);
28  
 
29  
    // rewrite in objective space
30  
    Collection<ES> outputs3 = rewriteInSpace(objectiveSpace, outputs2);
31  
    if (debug) pnlIndent("Objective space > ", outputs3);
32  
    
33  
    // translate to computer space
34  
    Collection<ES> outputs4 = ai_spaceToSpace_es(objectiveSpace, computerSpace, outputs3, +computerName, +userName);
35  
    if (debug) pnlIndent("Bot space > ", outputs4);
36  
    
37  
    ret outputs4;
38  
  }
39  
  
40  
  <A extends IAttractor> void addRules(MultiMap<S, A> mm) {
41  
    rulesForSpace.putAll((MultiMap) mm);
42  
  }
43  
}

Author comment

Began life as a copy of #1023180

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023195
Snippet name: MultiSpaceReasoning1
Eternal ID of this version: #1023195/18
Text MD5: 2ea3a26a0e4698ccc25a1aed126d6f87
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-19 12:37:31
Source code size: 1511 bytes / 43 lines
Pitched / IR pitched: No / No
Views / Downloads: 389 / 913
Version history: 17 change(s)
Referenced in: [show references]