// 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); }
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 + "');"); }
public int get() { ExperimentalDesignDb expdb = new ExperimentalDesignDb(); Start(); expdb.maxexpid(dbConnection); return(expdb.maxexpid(dbConnection)); }
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); }
public float averagevalue(string yAxisValue, int Expid) { ExperimentalDesignDb expdb = new ExperimentalDesignDb(); Start(); float range = expdb.averagevalue(dbConnection, yAxisValue, Expid); return(range); }
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); }
public List <float> selectvaluesofthreshold(int Expid) { ExperimentalDesignDb expdb = new ExperimentalDesignDb(); Start(); List <float> range = new List <float>(); range = expdb.Selectthreshold(dbConnection, Expid); return(range); }
public List <string> selectpathcovered(int Expid) { ExperimentalDesignDb expdb = new ExperimentalDesignDb(); Start(); List <string> range = new List <string>(); range = expdb.Selectpathcovered(dbConnection, Expid); return(range); }
public List <string> selectvaluesofmazesize(int Expid) { ExperimentalDesignDb expdb = new ExperimentalDesignDb(); Start(); List <string> range = new List <string>(); range = expdb.Selectmaze(dbConnection, Expid); return(range); }
public List <string> selectValuesofAlgorithm(int Expid) { ExperimentalDesignDb expdb = new ExperimentalDesignDb(); Start(); List <string> range = new List <string>(); range = expdb.Selectalgo(dbConnection, Expid); return(range); }
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); }
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); }
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); }
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); }