select method

  1. @override
AiSelection select(
  1. List<AIModel> all,
  2. RotationSettings settings
)
override

Implementation

@override
AiSelection select(List<AIModel> all, RotationSettings settings) {
  final pool = _rotationPool(all);
  if (pool.isEmpty) return AiSelection(_defaultOf(all), settings);

  final index = settings.roundRobinIndex % pool.length;
  final next = RotationSettings(
    mode: settings.mode,
    roundRobinIndex: (index + 1) % pool.length,
  );
  return AiSelection(pool[index], next);
}