コード例 #1
0
        protected void ExtractDataFromContext(LSExternalArgumentValues context)
        {
            Flc.MilkRunCycleLength = (int)context.GetIntValue(0);
            for (var i = 0; i < Flc.NumMachines; i++)
            {
                Flc.Machines[i].OrderUpToMilkLevel = (int)context.GetIntValue(1 + i);
            }

            for (var i = 0; i < Flc.NumBuffers; i++)
            {
                Flc.Buffers[i].Size = (int)context.GetIntValue(1 + Flc.NumMachines + i);
            }
        }
コード例 #2
0
        public override double Evaluate(LSExternalArgumentValues context)
        {
            ExtractDataFromContext(context);
            var newSample = Flc.ToSample();
            var oldSample = Samples.Find(sample => sample.ToFloats().Equals(newSample.ToFloats()));

            if (oldSample == null)
            {
                var result = SimulationRunner.ProductionRateForConfiguration(Flc);
                newSample.ProductionRate = result;
                Samples.Add(newSample);
                return(result);
            }
            return(oldSample.ProductionRate);
        }
コード例 #3
0
 public override double Evaluate(LSExternalArgumentValues context)
 {
     ExtractDataFromContext(context);
     return(_predictor.PredictConfig(Flc));
 }
コード例 #4
0
 public override double Evaluate(LSExternalArgumentValues context)
 {
     ExtractDataFromContext(context);
     return(SimulationRunner.ProductionRateForConfiguration(Flc));
 }
コード例 #5
0
 public abstract double Evaluate(LSExternalArgumentValues context);