Ejemplo n.º 1
0
        public List <Tuple <int, int> > GetPairings(int noScripts, int noPairings, string rScript)
        {
            REngineClass.GetREngine().Evaluate(@"source('REngine\\RScripts\\Generate\\" + rScript + "')");
            NumericMatrix matrix = REngineClass.GetREngine().Evaluate(string.Format("matrix <- generatePairings(noOfScripts = {0}, noOfPairings = {1})", noScripts, noPairings)).AsNumericMatrix();

            List <Tuple <int, int> > pairings = new List <Tuple <int, int> >();

            for (int i = 0; i < matrix.RowCount; i++)
            {
                pairings.Add(new Tuple <int, int>((int)matrix[i, 0], (int)matrix[i, 1]));
            }
            return(pairings);
        }
Ejemplo n.º 2
0
        //public NumericMatrix getPairings(int noScripts, int noPairings)
        public List <Tuple <int, int> > getPairings(int noScripts, int noPairings)
        {
            REngineClass.GetREngine().Evaluate(@"source('wwwroot/RScripts/ComparativeJudgmentPairingsTest.R')");
            NumericMatrix matrix = REngineClass.GetREngine().Evaluate(string.Format("matrix <- generatePairings(noOfScripts = {0}, noOfPairings = {1})", noScripts, noPairings)).AsNumericMatrix();

            //create an empty list of tuples
            List <Tuple <int, int> > pairings = new List <Tuple <int, int> >();

            for (int i = 0; i < matrix.RowCount; i++)
            {
                //add new tuple to list
                pairings.Add(new Tuple <int, int>((int)matrix[i, 0], (int)matrix[i, 1]));
            }
            return(pairings);
        }