fromMap static method
Implementation
static QLearning fromMap(Map<String, dynamic> m, {int? seed}) {
final model = QLearning(
nStates: m['nStates'] as int,
nActions: m['nActions'] as int,
alpha: (m['alpha'] as num).toDouble(),
gamma: (m['gamma'] as num).toDouble(),
epsilon: (m['epsilon'] as num).toDouble(),
seed: seed,
epsilonMin:
m['epsilonMin'] == null ? null : (m['epsilonMin'] as num).toDouble(),
epsilonDecay:
m['epsilonDecay'] == null
? null
: (m['epsilonDecay'] as num).toDouble(),
alphaMin:
m['alphaMin'] == null ? null : (m['alphaMin'] as num).toDouble(),
alphaDecay:
m['alphaDecay'] == null ? null : (m['alphaDecay'] as num).toDouble(),
);
final raw = m['qTable'] as List;
model.qTable = raw.map((r) => List<double>.from(r as List)).toList();
model._steps = (m['steps'] as num?)?.toInt() ?? 0;
return model;
}