Ignore:
Timestamp:
03/20/13 16:56:28 (7 years ago)
Author:
fschoepp
Message:

#1888:

  • DAL: Added a Delete method which deletes by experiment id.
  • HL DataTables will now be transposed and mapped as double[ROWS][COLUMNS] (transposed)
  • JS: Moved all classes into "modules" to prevent namespace pollution (using OAAS_MODEL for model classes, OAAS_VIEW for views and OAAS_CONTROLLER for controllers)
  • JS: Moved DatatypeMapper classes into Backbone views
  • JS: Models now correctly send DELETE requests
  • Added a new job overview page (which also renders run details) using AJAX
  • Using moment.min.js to format DateTime as string
  • Controllers now inherit from BaseController which provides a RedirectToLoginIfNecessary-method
  • Added loading animations to several AJAX bound places (loading experiments / scenarios)
  • Added a section to _Layout.cshtml which allows page-specific JavaScript includes (<script> only for a certain page)
  • Fixed Build/Edit of experiment menu redirecting to the wrong page
  • The Experiment Variation Dialog disables input fields, if the property has not been activated before
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OaaS/HeuristicLab.Services.Optimization.Controller/HL/HiveScenarioManager.cs

    r9305 r9324  
    336336      else if (item is DoubleMatrix) {
    337337        var matrix = item as DoubleMatrix;
    338         double[][] matrixValue = new double[matrix.Rows][];
     338        /*double[][] matrixValue = new double[matrix.Rows][];
    339339        for (int i = 0; i < matrixValue.Length; ++i) {
    340340          matrixValue[i] = new double[matrix.Columns];
     
    342342            matrixValue[i][j] = matrix[i, j];
    343343          }
    344         }
    345         result.Value = new HeuristicLab.Services.Optimization.ControllerService.Model.DecimalMatrix() { Name = name, Value = matrixValue };
     344        } */
     345        double[][] matrixValue = new double[matrix.Columns][];
     346        for (int i = 0; i < matrix.Columns; ++i) {
     347          matrixValue[i] = new double[matrix.Rows];
     348          for (int j = 0; j < matrix.Rows; ++j) {
     349            matrixValue[i][j] = matrix[j, i];
     350          }
     351        }       
     352        result.Value = new HeuristicLab.Services.Optimization.ControllerService.Model.DecimalMatrix() { Name = name, Value = matrixValue, RowNames = (matrix.ColumnNames.Count() > 0 ? matrix.ColumnNames.ToArray() : null) };
    346353      }
    347354      else if (item is IStringConvertibleArray) {
     
    369376          var columns = table.Rows.ToList()[i];
    370377          names[i] = columns.Name;
    371           results[i] = new double[columns.Values.Count];
     378          results[i] = new double[columns.Values.Count];         
    372379          for (int j=0; j < columns.Values.Count; j++) {
    373380            results[i][j] = columns.Values[j];
    374381          }
    375382        }
     383        results = transpose(results);
    376384        result.Value = new HeuristicLab.Services.Optimization.ControllerService.Model.DecimalMatrix() { Name = name, Value = results, RowNames = names };
    377385      }
     
    437445    }
    438446
     447    private double[][] transpose(double[][] arr) {
     448      var width = arr.Length;
     449      var height = arr[0].Length;
     450
     451      var res = new double[height][];
     452      for (var i = 0; i < height; i++)
     453        res[i] = new double[width];
     454
     455      for (var i = 0; i < width; i++) {
     456        for (var j = 0; j < height; j++) {
     457          res[j][i] = arr[i][j];
     458        }
     459      }
     460      return res;
     461    }
     462
    439463    private string GetMapperFromBlobStore(string scenarioName) {
    440464      var scenarioDao = dal.ScenarioDao;
     
    482506
    483507    public bool DeleteExperiment(User user, string experiment) {
    484       return dal.ExperimentDao.DeleteByName(user.Username, experiment);
     508      return dal.ExperimentDao.Delete(user.Username, experiment);
    485509    }
    486510
     
    564588    }
    565589
    566     public IEnumerable<Model.Experiment> GetExperiments(User user) {
    567       return dal.ExperimentDao.GetExperiments(user.Username);
     590    public IEnumerable<Model.Experiment> GetExperiments(User user, bool namesOnly=false) {
     591      return dal.ExperimentDao.GetExperiments(user.Username, namesOnly);
    568592    }
    569593
Note: See TracChangeset for help on using the changeset viewer.