anchor.diff:  -define(QL_TRAIN_OPTS, [{record_name, egTicTacQlSample}, {type, set}]).        
   -define(QL_OUTPUT_UNSAMPLED, 0.001).        % Value emitted as output for unsampled move in Export
   
  --record(egTicTacQlSample,   { sin= <<>> :: binary() % binstr key of normalized position (Board)
  -                            , nos=1     :: number() % number of samples (1...)
  -                            , qos=1     :: number() % score of sample (-1..+1)
  -                            , aaq=[]    :: list()   % aggregated action qualities
  +-record(egTicTacQlSample,   { input= <<>> :: binary()  % binstr key of normalized position (Board)
  +                            , nos=1       :: integer() % number of board samples (1...)
  +                            , nmax=1      :: integer() % number of action samples (1...) for Qmax
  +                            , qmax=1      :: number()  % Qmax of best action (-1..+1) as a quotient
  +                            , aaq=[]    :: list()      % aggregated action qualities
                               }).
   
   -define(egTicTacQlSample,   [ binstr
  -                            , number
  +                            , integer
  +                            , integer
                               , number
                               , list
                               ]).
  -% rd(egTicTacQlSample, {sin, nos, qos, aaq}).
  +% rd(egTicTacQlSample, {input, nos, nmax, qmax, aaq}).
   
   -record(state,  { bid        :: egBotId()       % bot id (= module name)
                   , tid        :: egGameTypeId()  % game type id
  
positive.code:             {N, qlearn_add(OldOut, Output, Qmax, OMove, Olen, Explore)}
      end,
      {CN,CQ} = NewQmax = qlearn_max(AggregatedActionQualities),   
      TrainingRec=#egTicTacQlSample{sin=list_to_binary(Input), nos=PreviousSampleCount+1, qos=CQ/CN, aaq=AggregatedActionQualities},
      imem_meta:write(Table, TrainingRec),
      NewQmax.
  
  
negative.code: 
  target(0, _, _) -> -100; 
  target({0,0}, _, _) -> 100; 
  target({N,Q}, NOS, Explore) -> 
      DE = 1.0 + Explore*math:sqrt(NOS)/(1+N),
      (Q/N + DE) / DE.
  % target({N,Q}, NOS, Explore) -> Q/N + Explore*math:sqrt(NOS)/(1+N).
  
  