예제 #1
0
        protected override void GetGUForAtomicRITEs(GUInputEngine guLossesEngine)
        {
            bool GotGUForAll = true;

            foreach (ContractAtomicRITE aRITE in treatyGraph.ContractRITEs)
            {
                if (!aRITE.contractGraph.IsExecuted)
                {
                    GraphExecuter executer;
                    if (aRITE.contractGraph is PrimaryGraph)
                    {
                        executer = new PrimaryGraphExecuter(aRITE.contractGraph as PrimaryGraph);
                    }
                    else
                    {
                        executer = new TreatyGraphExecuter(aRITE.contractGraph as TreatyGraph);
                    }

                    executer.Execute(guLossesEngine);
                }
            }
        }
예제 #2
0
        public double Execute(long conID, GraphType type, Dictionary <string, Dictionary <int, Dictionary <long, Tuple <double, uint, List <float> > > > > guLoss)
        {
            ExposureDataAdaptor expData = PDataAdaptor.GetExposureAdaptor(conID);
            string error;

            //Stopwatch watch = new Stopwatch();
            //watch.Start();
            Graph graph = GetGraph(type, expData);
            //watch.Stop();

            //long graphTime = watch.ElapsedMilliseconds;

            GraphExecuter Executer;

            if (graph is PrimaryGraph)
            {
                Executer = new PrimaryGraphExecuter(graph as PrimaryGraph);
            }
            else if (graph is TreatyGraph)
            {
                Executer = new TreatyGraphExecuter(graph as TreatyGraph);
            }
            else
            {
                throw new NotSupportedException("Can only handle graph of type Treaty and Primary");
            }

            //Execute Graph and Allocate graph
            double payout = Executer.Execute(guLoss);

            //Allocate Graph
            //GraphAllocation Allocater = new GraphAllocation(graph);
            //Allocater.AllocateGraph();

            return(payout);
        }