protected internal override void Reinitialize()
 {
     base.Reinitialize();
     lastBatch = null;
     Strategy.Reinitialize(this);
     ClearCache();
     uid = Guid.NewGuid().ToString();
 }
 protected override LearningScriptBatch GetNextBatch()
 {
     var indexes = Strategy.GetNextIndexes();
     if (indexes.IsNullOrEmpty())
     {
         if (lastBatch == null)
         {
             throw new InvalidOperationException(Strategy + " has returned null or empty index collection.");
         }
     }
     else
     {
         var cache = LearningScriptCache.Cache;
         if (cache != null)
         {
             lastBatch = GetNextBatchCached(indexes, cache);
         }
         else
         {
             lastBatch = GetNextBatchUncached(indexes);
         }
     }
     return lastBatch;
 }