Esempio n. 1
0
    // Update is called once per frame

    public int UpdateTimeTaken(float TimeTaken)
    {
        int statusCode = 0;

        try
        {
            ExperimentalDesignDb expdb = new ExperimentalDesignDb();
            Start();
            TestSuiteDatabase tsd = new TestSuiteDatabase();
            if (tsd.testUpdateTimeTaken(dbConnection, "SELECT COUNT(ID) FROM experimental_results where TimeTaken = 0 ;"))
            {
                expdb.Update(dbConnection, "UPDATE experimental_results SET TimeTaken='" + TimeTaken + "' WHERE ID IN (SELECT Max(ID) FROM experimental_results);");

                statusCode = 200;
            }
            else
            {
                statusCode = 400;
            }
        }
        catch (SqliteException sqlEx)
        {
            statusCode = 400;
            Debug.LogError(sqlEx);
        }

        return(statusCode);
    }
Esempio n. 2
0
    public void Insert(string algorithm, string mazetype, double thresholdvalue, string sensor, string experimentType)
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();

        expdb.Insert(dbConnection, "INSERT INTO experimental_results(AlgorithmType, MazeSize, ThresholdFrequency,SensorType,ExperimentType) VALUES ('" + algorithm + "','" + mazetype + "'," + thresholdvalue + ",'" + sensor + "','" + experimentType + "');");
    }
Esempio n. 3
0
    public int get()
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();
        expdb.maxexpid(dbConnection);
        return(expdb.maxexpid(dbConnection));
    }
Esempio n. 4
0
    public float averagevalue(string yAxisValue, string InputAlgorithmValue, string MazeSizeValue, float Threshold, string SensorTypeValue)
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();
        float range = expdb.averagevalue(dbConnection, yAxisValue, InputAlgorithmValue, MazeSizeValue, Threshold, SensorTypeValue);

        return(range);
    }
Esempio n. 5
0
    public float averagevalue(string yAxisValue, int Expid)
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();
        float range = expdb.averagevalue(dbConnection, yAxisValue, Expid);

        return(range);
    }
Esempio n. 6
0
    public List <float> selectValuesfromDB(string yAxisValue, string InputAlgorithmValue, string MazeSizeValue, float Threshold, string SensorTypeValue)
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();
        List <float> range = new List <float>();

        range = expdb.Select(dbConnection, yAxisValue, InputAlgorithmValue, MazeSizeValue, Threshold, SensorTypeValue);
        return(range);
    }
Esempio n. 7
0
    public List <float> selectvaluesofthreshold(int Expid)
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();
        List <float> range = new List <float>();

        range = expdb.Selectthreshold(dbConnection, Expid);
        return(range);
    }
Esempio n. 8
0
    public List <string> selectpathcovered(int Expid)
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();
        List <string> range = new List <string>();

        range = expdb.Selectpathcovered(dbConnection, Expid);
        return(range);
    }
Esempio n. 9
0
    public List <string> selectvaluesofmazesize(int Expid)
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();
        List <string> range = new List <string>();

        range = expdb.Selectmaze(dbConnection, Expid);
        return(range);
    }
Esempio n. 10
0
    public List <string> selectValuesofAlgorithm(int Expid)
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();
        List <string> range = new List <string>();

        range = expdb.Selectalgo(dbConnection, Expid);
        return(range);
    }
Esempio n. 11
0
    public List <float> selectValuesfromDB(string yAxisValue, int Expid)
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();
        List <float> range = new List <float>();

        range = expdb.Select(dbConnection, yAxisValue, Expid);
        return(range);
    }
Esempio n. 12
0
    public float averagevalue(string yAxisValue, string InputAlgorithmValue, string MazeSizeValue, float Threshold, string SensorTypeValue)
    {
        ExperimentalDesignDb expdb = new ExperimentalDesignDb();

        Start();
        TestSuiteDatabase tsd = new TestSuiteDatabase();

        tsd.TestSelectValuesfromDB(yAxisValue);
        float range = expdb.averagevalue(dbConnection, yAxisValue, InputAlgorithmValue, MazeSizeValue, Threshold, SensorTypeValue);

        return(range);
    }
Esempio n. 13
0
    public int UpdatePointsScored(float PointsScored)
    {
        int statusCode = 0;

        try
        {
            ExperimentalDesignDb expdb = new ExperimentalDesignDb();
            Start();
            expdb.Update(dbConnection, "UPDATE experimental_results SET PointsScored='" + PointsScored + "' WHERE ID IN (SELECT Max(ID) FROM experimental_results);");
            statusCode = 200;
        }
        catch (SqliteException sqlEx)
        {
            statusCode = 400;
            Debug.LogError(sqlEx);
        }

        return(statusCode);
    }
Esempio n. 14
0
    public int UpdateMaze(int[,] updatedMaze)
    {
        int statusCode = 0;
        Dictionary <string, string> value = new Dictionary <string, string>();

        try
        {
            string str = "'";
            for (int i = 0; i <= updatedMaze.GetUpperBound(0); i++)
            {
                str += "";
                for (int j = 0; j <= updatedMaze.GetUpperBound(1); j++)
                {
                    str += updatedMaze[i, j];
                    if (j != updatedMaze.GetUpperBound(1))
                    {
                        str += ",";
                    }
                }
                str += "";
                if (i != updatedMaze.GetUpperBound(0))
                {
                    str += ";";
                }
            }
            str += "'";
            ExperimentalDesignDb expdb = new ExperimentalDesignDb();
            Start();
            expdb.Update(dbConnection, "UPDATE experimental_results SET PathCovered=" + str + " WHERE ID IN (SELECT Max(ID) FROM experimental_results);");
            statusCode = 200;
        }
        catch (SqliteException sqlEx)
        {
            Debug.LogError(sqlEx);
            statusCode = 400;
        }
        return(statusCode);
    }