1 | static Pair<L<IfThen>, LS> ai_activeRulesAndFacts() { |
2 | ret ai_activeRulesAndFacts(null); |
3 | } |
4 | |
5 | static Pair<L<IfThen>, LS> ai_activeRulesAndFacts(LS extraFacts) { |
6 | time "ai_activeRulesAndFacts" { |
7 | LS facts = concatLists_conservative(extraFacts, mL_facts()); |
8 | |
9 | LS unparsedRules = ai_unparsedTalkRules(); |
10 | |
11 | for (S listName : mL("Rule & Fact Lists")) |
12 | for (S x : splitAtEmptyLines(mL_raw(listName))) |
13 | if (anyJavaTokens(x)) |
14 | if (nlLogic_parseRule(x) != null) |
15 | unparsedRules.add(x); |
16 | else |
17 | facts.add(x); |
18 | |
19 | unparsedRules = sortedByCalculatedField(unparsedRules, func(S s) { jcontains(s, "entity(") }); |
20 | L<IfThen> rules = map_pcall nlLogic_parseRule(unparsedRules); |
21 | |
22 | for (S listName : mL("Default active scripts")) |
23 | addAll(rules, nlLogic_loadMechScript(listName)); |
24 | |
25 | nlLogic_expandMacros(rules); |
26 | } |
27 | ret pair(rules, facts); |
28 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1017899 |
Snippet name: | ai_activeRulesAndFacts - preprocesses them too |
Eternal ID of this version: | #1017899/7 |
Text MD5: | 9e4e51020144abaee104c72e85119e2a |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-08-29 15:35:32 |
Source code size: | 903 bytes / 28 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 484 / 534 |
Version history: | 6 change(s) |
Referenced in: | [show references] |