Esempio n. 1
0
        } //Execute

        private ExecutionOutput ExecuteWindow(TimeWindow timewindow, GUInputEngine guLossesEngine)
        {
            ApplyWindowToGU(timewindow);  //unrestricted, raintest

            List <CoverNode> TopCovers = graph.TopNodes.OfType <CoverNode>().ToList();

            ExecutionOutput totalExOutput = new ExecutionOutput();

            foreach (CoverNode coverNode in TopCovers)
            {
                totalExOutput += ExecuteCover(guLossesEngine, coverNode);
            }

            return(totalExOutput);
        }
Esempio n. 2
0
        } //Execute

        public double Execute(GUInputEngine guinputengine)
        {
            GetGUForAtomicRITEs(guinputengine);

            List <TimeWindow> timewindows;

            if (graph.Declarations.IsHoursClause)
            {
                timewindows = guinputengine.GenerateWindows(graph.Declarations.HoursClauses[0].Duration);
            }
            else
            {
                timewindows = new List <TimeWindow>()
                {
                    new TimeWindow()
                }
            };

            List <ExecutionOutput> lst_execoutputs = new List <ExecutionOutput>();

            foreach (TimeWindow tw in timewindows)
            {
                lst_execoutputs.Add(ExecuteWindow(tw, guinputengine));
            }

            //find the timewindow that has the maximum payout
            ExecutionOutput MaxPayout_ExecutionOutput = lst_execoutputs.First();

            foreach (ExecutionOutput exout in lst_execoutputs)
            {
                if (exout.Payout > MaxPayout_ExecutionOutput.Payout)
                {
                    MaxPayout_ExecutionOutput = exout;
                }
            }

            graph.exResults = MaxPayout_ExecutionOutput;
            return(MaxPayout_ExecutionOutput.Payout);
        } //Execute