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); } }
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); }
public override double Evaluate(LSExternalArgumentValues context) { ExtractDataFromContext(context); return(_predictor.PredictConfig(Flc)); }
public override double Evaluate(LSExternalArgumentValues context) { ExtractDataFromContext(context); return(SimulationRunner.ProductionRateForConfiguration(Flc)); }
public abstract double Evaluate(LSExternalArgumentValues context);