ningshuxia
2024-04-28 cc3788df309c28a19f61331a5ec5379717799a9b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
namespace IStation.Algorithm
{
    public class ScheduleCalc1
    {
        private int _belong = 0;
        private int[] _run_flags = null;
        private List<Model.Pump> _pumps = null;
 
        /// <summary>
        /// 初始化计算参数
        /// </summary>
        /// <param name="belong">所属对象</param>
        /// <param name="pumps">泵列表</param>
        /// <returns></returns>
        private bool InitCalcParas(int belong, List<Model.Pump> pumps)
        {
            _belong = 0;
            _pumps = null;
            _run_flags = null;
            _combine = null;
            if (pumps == null || pumps.Count < 1)
                return false;
            _belong = belong;
            _pumps = pumps;
            _run_flags = pumps.Select(x => x.ID).OrderBy(x => x).ToArray();
            _combine = new List<int>();
            return true;
        }
 
 
        private List<int> _combine = null;
        private bool CW(int belong, List<Model.Pump> pumps)
        {
            var bol = InitCalcParas(belong, pumps);
            if (!bol) return false;
 
 
 
            return true;
        }
 
 
 
        private void DoWork(int r, int i, int t)
        {
            if (r.Length / 2 >= t)
            {
                _combine.Add(r);
                return;
            }
            for (; i < _run_flags.Length;)
            {
                DoWork(r + _run_flags[i], ++i, t);
            }
        }
    }
}