Ejemplo n.º 1
0
        void ProcessMod(double now, Modulation mod)
        {
            switch (mod.Type)                     /////////////////////////////////////////////////////////////////////////////
            {
            case ModulationType.OverallLimit:     //OVERALL LIMIT MODS MUST BE PROCESSED FIRST FROM MOD QUEUE!!!!!!!!!
                Debug.WriteLine($"LimitMod {mod.Rate}");

                _optimum = new Optimum(mod.Rate, _optimum.RealRatePerJob);
                break;

            case ModulationType.JobRate:
                Debug.WriteLine($"JobMod {mod.Key.Id} {mod.Rate}");

                var key = mod.Key;

                if (mod.Rate == 0)
                {
                    ClearJobState(key);
                }
                else
                {
                    var state = GetJobState(key);
                    PlaceJob(now, new JobInfo(key, state), mod.Rate);
                }
                break;
            }
        }
Ejemplo n.º 2
0
 public void Notify(Modulation mod)   //params of optimum should be passed by Notify too
 {
     _qMods.Enqueue(mod);
 }