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

27
LINES

< > BotCompany Repo | #1018822 // findBest_Audio_TwoWordAnalyzer1

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

Libraryless. Click here for Pure Java version (4525L/29K).

static IterableIterator<Audio_TwoWordAnalyzer1> findBest_Audio_TwoWordAnalyzer1(final LPair<S, BWImage> images) {
  replace A with Audio_TwoWordAnalyzer1.
  final LS words = uniquify(pairsA(images));
  final new Best<A> best;
  final new AIStrategy_RandomWithVariation<A> strategy;
  strategy.random = func -> A { random_Audio_TwoWordAnalyzer1(first(words), second(words)) };
  // todo: variation
  strategy.submit = func(final A a) -> double {
    new Scorer scorer;
    
    for (Pair<S, BWImage> img : images)
      scorer.add(eqic(img.a, a.analyze(img.b)));
      
    if (best.put(a, scorer!))
      print(scorer + " / " + struct(a)); 
    ret scorer!;
  };
  // rest of function should be same as: ret strategyIterator(best, strategy, optimumValue := 100.0);
  ret iff(func {
    if (best.score() == 100) ret endMarker();
    A lastBest = best!;
    strategy.go();
    A a = best! == lastBest ? null : best!;
    lastBest = best!;
    ret a;
  });
}

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: #1018822
Snippet name: findBest_Audio_TwoWordAnalyzer1
Eternal ID of this version: #1018822/7
Text MD5: 9f11442b7c849647f199d4d25ac365ac
Transpilation MD5: 073787aa4078017e83971de77f0d0368
Author: stefan
Category: javax / audio
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-24 19:38:50
Source code size: 981 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 263 / 340
Version history: 6 change(s)
Referenced in: [show references]