Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/28/09 14:28:46 (15 years ago)
Author:
gkronber
Message:

Refactored CEDMA plugins to work with new modeling backend. #712

Location:
branches/HeuristicLab.Modeling Database Backend/sources
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3/Console.cs

    r2047 r2190  
    2929using System.ServiceModel.Description;
    3030using HeuristicLab.CEDMA.DB.Interfaces;
     31using HeuristicLab.PluginInfrastructure;
     32using HeuristicLab.Modeling.SQLServerCompactBackend;
    3133
    3234namespace HeuristicLab.CEDMA.Core {
    3335  public class Console : ItemBase, IEditable {
    34     private string serverUri;
    35     public string ServerUri {
    36       get { return serverUri; }
     36    private static readonly string sqlServerCompactFile = AppDomain.CurrentDomain.BaseDirectory + "HeuristicLab.Modeling.database";
     37    private static readonly string sqlServerCompactConnectionString = @"Data Source=" + sqlServerCompactFile;
     38
     39    private Results results;
     40    public Results Results {
     41      get {
     42        if (results == null) ReloadResults();
     43        return results;
     44      }
    3745    }
    38 
    39     private DataSet dataSet;
    40     public DataSet DataSet {
    41       get { return dataSet; }
    42     }
    43 
    4446    public Console()
    4547      : base() {
    46       dataSet = new DataSet();
    4748    }
    4849
     
    5556    }
    5657
    57     #region serialization
    58     public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
    59       XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    60       XmlAttribute uriAttribute = document.CreateAttribute("ServerURI");
    61       uriAttribute.Value = serverUri;
    62       node.Attributes.Append(uriAttribute);
    63       return node;
    64     }
    65 
    66     public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
    67       base.Populate(node, restoredObjects);
    68       serverUri = node.Attributes["ServerURI"].Value;
    69     }
    70     #endregion
    71 
    72     internal void Connect(string serverUri) {
    73       IStore store = new StoreProxy(serverUri);
    74       var variableBindings = store.Query("?Dataset <" + Ontology.InstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 10).ToArray();
    75       if (variableBindings.Length > 0) {
    76         dataSet = new DataSet(store, (Entity)variableBindings[0].Get("Dataset"));
    77       } else {
    78         dataSet.Store = store;
    79       }
     58    private void ReloadResults() {
     59      results = new Results(new DatabaseService(sqlServerCompactConnectionString));
    8060    }
    8161  }
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3/ConsoleEditor.cs

    r2000 r2190  
    3333namespace HeuristicLab.CEDMA.Core {
    3434  class ConsoleEditor : EditorBase {
    35     private System.Windows.Forms.TextBox uriTextBox;
    36     private System.Windows.Forms.Label uriLabel;
    37     private Button connectButton;
    38     private Panel serverPanel;
     35    private ComboBox viewComboBox;
     36    private Button resultsButton;
    3937    private Console console;
    4038
     
    4240      InitializeComponent();
    4341      this.console = console;
     42      PopulateViewComboBox();
    4443    }
    4544
    4645    #region autogenerated code
    4746    private void InitializeComponent() {
    48       this.uriTextBox = new System.Windows.Forms.TextBox();
    49       this.uriLabel = new System.Windows.Forms.Label();
    50       this.connectButton = new System.Windows.Forms.Button();
    51       this.serverPanel = new System.Windows.Forms.Panel();
     47      this.viewComboBox = new System.Windows.Forms.ComboBox();
     48      this.resultsButton = new System.Windows.Forms.Button();
    5249      this.SuspendLayout();
    5350      //
    54       // uriTextBox
     51      // viewComboBox
    5552      //
    56       this.uriTextBox.Location = new System.Drawing.Point(94, 3);
    57       this.uriTextBox.Name = "uriTextBox";
    58       this.uriTextBox.Size = new System.Drawing.Size(205, 20);
    59       this.uriTextBox.TabIndex = 0;
     53      this.viewComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     54      this.viewComboBox.FormattingEnabled = true;
     55      this.viewComboBox.Location = new System.Drawing.Point(3, 3);
     56      this.viewComboBox.Name = "viewComboBox";
     57      this.viewComboBox.Size = new System.Drawing.Size(121, 21);
     58      this.viewComboBox.TabIndex = 7;
    6059      //
    61       // uriLabel
     60      // resultsButton
    6261      //
    63       this.uriLabel.AutoSize = true;
    64       this.uriLabel.Location = new System.Drawing.Point(6, 6);
    65       this.uriLabel.Name = "uriLabel";
    66       this.uriLabel.Size = new System.Drawing.Size(82, 13);
    67       this.uriLabel.TabIndex = 1;
    68       this.uriLabel.Text = "CEDMA Server:";
    69       //
    70       // connectButton
    71       //
    72       this.connectButton.Location = new System.Drawing.Point(305, 1);
    73       this.connectButton.Name = "connectButton";
    74       this.connectButton.Size = new System.Drawing.Size(75, 23);
    75       this.connectButton.TabIndex = 3;
    76       this.connectButton.Text = "&Connect";
    77       this.connectButton.UseVisualStyleBackColor = true;
    78       this.connectButton.Click += new System.EventHandler(this.connectButton_Click);
    79       //
    80       // serverPanel
    81       //
    82       this.serverPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    83                   | System.Windows.Forms.AnchorStyles.Left)
    84                   | System.Windows.Forms.AnchorStyles.Right)));
    85       this.serverPanel.Location = new System.Drawing.Point(3, 29);
    86       this.serverPanel.Name = "serverPanel";
    87       this.serverPanel.Size = new System.Drawing.Size(439, 157);
    88       this.serverPanel.TabIndex = 4;
     62      this.resultsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     63      this.resultsButton.Location = new System.Drawing.Point(130, 1);
     64      this.resultsButton.Name = "resultsButton";
     65      this.resultsButton.Size = new System.Drawing.Size(86, 23);
     66      this.resultsButton.TabIndex = 6;
     67      this.resultsButton.Text = "Show results";
     68      this.resultsButton.UseVisualStyleBackColor = true;
     69      this.resultsButton.Click += new System.EventHandler(this.resultsButton_Click);
    8970      //
    9071      // ConsoleEditor
    9172      //
    9273      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    93       this.Controls.Add(this.serverPanel);
    94       this.Controls.Add(this.connectButton);
    95       this.Controls.Add(this.uriLabel);
    96       this.Controls.Add(this.uriTextBox);
     74      this.Controls.Add(this.viewComboBox);
     75      this.Controls.Add(this.resultsButton);
    9776      this.Name = "ConsoleEditor";
    9877      this.Size = new System.Drawing.Size(445, 189);
    9978      this.ResumeLayout(false);
    100       this.PerformLayout();
    10179
    10280    }
     
    10482    #endregion
    10583
    106     private void connectButton_Click(object sender, EventArgs e) {
    107       try {
    108         console.Connect(uriTextBox.Text);
    109         connectButton.Enabled = false;
    110         serverPanel.Enabled = true;
    111         serverPanel.Controls.Clear();
    112         Control dataSetView = (Control)console.DataSet.CreateView();
    113         dataSetView.Dock = DockStyle.Fill;
    114         serverPanel.Controls.Add(dataSetView);
    115       } catch(CommunicationException ex) {
    116         MessageBox.Show("Exception while trying to connect to " + uriTextBox.Text + "\n" + ex.Message);
    117       }
     84    private void PopulateViewComboBox() {
     85      DiscoveryService service = new DiscoveryService();
     86      IResultsViewFactory[] factories = service.GetInstances<IResultsViewFactory>();
     87      viewComboBox.DataSource = factories;
     88      viewComboBox.ValueMember = "Name";
     89    }
     90
     91
     92    private void resultsButton_Click(object sender, EventArgs e) {
     93      IResultsViewFactory factory = (IResultsViewFactory)viewComboBox.SelectedItem;
     94      IControl control = factory.CreateView(console.Results);
     95      PluginManager.ControlManager.ShowControl(control);
    11896    }
    11997  }
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3/DataSetView.cs

    r2131 r2190  
    7373    }
    7474
    75     private void PopulateViewComboBox() {
    76       DiscoveryService service = new DiscoveryService();
    77       IResultsViewFactory[] factories = service.GetInstances<IResultsViewFactory>();
    78       viewComboBox.DataSource = factories;
    79       viewComboBox.ValueMember = "Name";
    80     }
    8175
    8276    private void activateButton_Click(object sender, EventArgs e) {
     
    8579    }
    8680
    87     private void resultsButton_Click(object sender, EventArgs e) {
    88       if (results == null)
    89         ReloadResults();
    90       try {
    91         IResultsViewFactory factory = (IResultsViewFactory)viewComboBox.SelectedItem;
    92         BackgroundWorker worker = new BackgroundWorker();
    93         worker.WorkerReportsProgress = true;
    94         worker.WorkerSupportsCancellation = true;
    95         worker.ProgressChanged += delegate(object progressChangedSender, ProgressChangedEventArgs progressChangedArgs) {
    96           progressBar.Value = progressChangedArgs.ProgressPercentage;
    97         };
    98         worker.DoWork += delegate(object doWorkSender, DoWorkEventArgs doWorkArgs) {
    99           int n = results.GetEntries().Count();
    100           int i = 0;
    101           // preload list
    102           foreach (var entry in results.GetEntries()) {
    103             i++;
    104             if((((i*100) / n) % 10) == 0) worker.ReportProgress((i * 100) / n);
    105           }
    106           worker.ReportProgress(100);
    107         };
    108         resultsButton.Enabled = false;
    109         worker.RunWorkerAsync();
    110         worker.RunWorkerCompleted += delegate(object completedSender, RunWorkerCompletedEventArgs compledArgs) {
    111           resultsButton.Enabled = true;
    112           progressBar.Value = 0;
    113           IControl control = factory.CreateView(results);
    114           PluginManager.ControlManager.ShowControl(control);
    115         };
    116       }
    117       catch (Exception ex) {
    118         string text = "Couldn't load selected view: " + viewComboBox.SelectedItem + "\n" + ex.Message;
    119         MessageBox.Show(text, "Unable to create view", MessageBoxButtons.OK, MessageBoxIcon.Error);
    120       }
    121     }
    12281
    12382    private void ReloadResults() {
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3/HeuristicLab.CEDMA.Core-3.3.csproj

    r2185 r2190  
    101101      <SubType>UserControl</SubType>
    102102    </Compile>
    103     <Compile Include="DataSetView.cs">
    104       <SubType>UserControl</SubType>
    105     </Compile>
    106     <Compile Include="DataSetView.Designer.cs">
    107       <DependentUpon>DataSetView.cs</DependentUpon>
    108     </Compile>
    109103    <Compile Include="HeuristicLabCedmaCorePlugin.cs" />
    110     <Compile Include="ProblemView.cs">
    111       <SubType>UserControl</SubType>
    112     </Compile>
    113     <Compile Include="ProblemView.Designer.cs">
    114       <DependentUpon>ProblemView.cs</DependentUpon>
    115     </Compile>
    116104    <Compile Include="Properties\AssemblyInfo.cs" />
    117105    <Compile Include="Results.cs" />
     
    137125      <Name>HeuristicLab.Data-3.2</Name>
    138126    </ProjectReference>
     127    <ProjectReference Include="..\..\HeuristicLab.Modeling.SQLServerCompactBackend\3.2\HeuristicLab.Modeling.SQLServerCompactBackend-3.2.csproj">
     128      <Project>{9B4F7D05-CCE1-45BB-81D1-5D4925851901}</Project>
     129      <Name>HeuristicLab.Modeling.SQLServerCompactBackend-3.2</Name>
     130    </ProjectReference>
    139131    <ProjectReference Include="..\..\HeuristicLab.Operators\3.2\HeuristicLab.Operators-3.2.csproj">
    140132      <Project>{A9983BA2-B3B2-475E-8E2C-62050B71D1C5}</Project>
     
    153145      <DependentUpon>ConsoleEditor.cs</DependentUpon>
    154146      <SubType>Designer</SubType>
    155     </EmbeddedResource>
    156     <EmbeddedResource Include="DataSetView.resx">
    157       <DependentUpon>DataSetView.cs</DependentUpon>
    158     </EmbeddedResource>
    159     <EmbeddedResource Include="ProblemView.resx">
    160       <DependentUpon>ProblemView.cs</DependentUpon>
    161147    </EmbeddedResource>
    162148  </ItemGroup>
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3/Results.cs

    r2146 r2190  
    6868    }
    6969
    70     private IStore store;
    71     public IStore Store {
    72       get { return store; }
    73       set {
    74         store = value;
    75       }
    76     }
     70    private IModelingDatabase database;
     71    //public IStore Store {
     72    //  get { return store; }
     73    //  set {
     74    //    store = value;
     75    //  }
     76    //}
    7777
    7878    private Dictionary<string, Dictionary<object, double>> categoricalValueIndices = new Dictionary<string, Dictionary<object, double>>();
    7979
    80     public Results(IStore store) {
    81       this.store = store;
     80    public Results(IModelingDatabase database) {
     81      this.database = database;
    8282    }
    8383
     
    9191
    9292    private IEnumerable<ResultsEntry> SelectRows() {
    93       int page = 0;
    94       int resultsReturned = 0;
    9593      entries = new List<ResultsEntry>();
    96       if (store == null) return entries;
    97       do {
    98         var allModels = store.Query(
    99           "?Model <" + Ontology.InstanceOf + "> <" + Ontology.TypeModel + "> ." +
    100           "?Model <" + Ontology.TargetVariable + "> ?TargetVariable ." +
    101           "?Model <" + Ontology.TestMeanSquaredError + "> ?TestMSE .",
    102           0, 3000)
    103           .Select(modelBinding => new {
    104             Model = ((Entity)modelBinding.Get("Model")).Uri,
    105             TestMSE = (double)((Literal)modelBinding.Get("TestMSE")).Value,
    106             TargetVariable = (string)((Literal)modelBinding.Get("TargetVariable")).Value
    107           })
    108           .Distinct()
    109           .GroupBy(m => m.TargetVariable)
    110           .Select(grouping => grouping.OrderBy(m => m.TestMSE));
    111         foreach (var targetVariableBindings in allModels) {
    112           resultsReturned = targetVariableBindings.Count();
    113           int nModels = Math.Max(10, resultsReturned * 10 / 100);
    114           nModels = Math.Min(nModels, resultsReturned);
    115           foreach (var modelBindings in targetVariableBindings.Take(nModels)) {
    116             ResultsEntry entry = new ResultsEntry();
    117             entry.Uri = modelBindings.Model;
    118             entries.Add(entry);
    119             SetModelAttributes(entry, modelBindings.Model);
    120             entry.Set("VariableImpacts", SelectVariableImpacts(modelBindings.Model));
    121           }
     94      foreach (var model in database.GetAllModels()) {
     95        ResultsEntry modelEntry = new ResultsEntry();
     96        foreach(var modelResult in database.GetModelResults(model)) {
     97          modelEntry.Set(modelResult.Result.Name, modelResult.Value);
    12298        }
    123         page++;
    124       } while (resultsReturned == PAGE_SIZE);
     99        modelEntry.Set("PersistedData", model.Data);
     100        modelEntry.Set("TargetVariable", model.TargetVariable.Name);
     101      }
     102     
    125103      FireChanged();
    126104      cached = true;
     
    128106    }
    129107
    130     private void SetModelAttributes(ResultsEntry entry, string modelUri) {
    131       var modelBindings = store.Query(
    132         "<" + modelUri + "> ?Attribute ?Value .",
    133         0, PAGE_SIZE);
    134       foreach (var binding in modelBindings) {
    135         if (binding.Get("Value") is Literal) {
    136           string name = ((Entity)binding.Get("Attribute")).Uri.Replace(Ontology.CedmaNameSpace, "");
    137           if (entry.Get(name) == null) {
    138             object value = ((Literal)binding.Get("Value")).Value;
    139             entry.Set(name, value);
    140           }
    141         }
    142       }
    143     }
     108    //private IEnumerable<ResultsEntry> SelectVariableImpacts(string modelUri) {
     109    //  var inputVariableNameBindings = store.Query(
     110    //      "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
     111    //      "?InputVariable <" + Ontology.Name + "> ?InputName .",
     112    //      0, PAGE_SIZE);
    144113
    145     private IEnumerable<ResultsEntry> SelectVariableImpacts(string modelUri) {
    146       var inputVariableNameBindings = store.Query(
    147           "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
    148           "?InputVariable <" + Ontology.Name + "> ?InputName .",
    149           0, PAGE_SIZE);
     114    //  var qualityImpactBindings = store.Query(
     115    //      "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
     116    //      "?InputVariable <" + Ontology.QualityImpact + "> ?QualityImpact .",
     117    //      0, PAGE_SIZE);
    150118
    151       var qualityImpactBindings = store.Query(
    152           "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
    153           "?InputVariable <" + Ontology.QualityImpact + "> ?QualityImpact .",
    154           0, PAGE_SIZE);
     119    //  var evaluationImpactBindings = store.Query(
     120    //       "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
     121    //       "?InputVariable <" + Ontology.EvaluationImpact + "> ?EvaluationImpact .",
     122    //       0, PAGE_SIZE);
     123    //  Dictionary<object, ResultsEntry> inputVariableAttributes = new Dictionary<object, ResultsEntry>();
    155124
    156       var evaluationImpactBindings = store.Query(
    157            "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
    158            "?InputVariable <" + Ontology.EvaluationImpact + "> ?EvaluationImpact .",
    159            0, PAGE_SIZE);
    160       Dictionary<object, ResultsEntry> inputVariableAttributes = new Dictionary<object, ResultsEntry>();
     125    //  foreach (var inputVariableNameBinding in inputVariableNameBindings) {
     126    //    object inputVariable = inputVariableNameBinding.Get("InputVariable");
     127    //    object name = ((Literal)inputVariableNameBinding.Get("InputName")).Value;
     128    //    if (!inputVariableAttributes.ContainsKey(inputVariable)) {
     129    //      inputVariableAttributes[inputVariable] = new ResultsEntry();
     130    //      inputVariableAttributes[inputVariable].Set("InputVariableName", name);
     131    //    }
     132    //  }
    161133
    162       foreach (var inputVariableNameBinding in inputVariableNameBindings) {
    163         object inputVariable = inputVariableNameBinding.Get("InputVariable");
    164         object name = ((Literal)inputVariableNameBinding.Get("InputName")).Value;
    165         if (!inputVariableAttributes.ContainsKey(inputVariable)) {
    166           inputVariableAttributes[inputVariable] = new ResultsEntry();
    167           inputVariableAttributes[inputVariable].Set("InputVariableName", name);
    168         }
    169       }
     134    //  foreach (var qualityImpactBinding in qualityImpactBindings) {
     135    //    double qualityImpact = (double)((Literal)qualityImpactBinding.Get("QualityImpact")).Value;
     136    //    object inputVariable = qualityImpactBinding.Get("InputVariable");
     137    //    if (!IsAlmost(qualityImpact, 1.0)) {
     138    //      if (inputVariableAttributes[inputVariable].Get("QualityImpact") == null)
     139    //        inputVariableAttributes[inputVariable].Set("QualityImpact", qualityImpact);
     140    //    } else inputVariableAttributes.Remove(inputVariable);
     141    //  }
    170142
    171       foreach (var qualityImpactBinding in qualityImpactBindings) {
    172         double qualityImpact = (double)((Literal)qualityImpactBinding.Get("QualityImpact")).Value;
    173         object inputVariable = qualityImpactBinding.Get("InputVariable");
    174         if (!IsAlmost(qualityImpact, 1.0)) {
    175           if (inputVariableAttributes[inputVariable].Get("QualityImpact") == null)
    176             inputVariableAttributes[inputVariable].Set("QualityImpact", qualityImpact);
    177         } else inputVariableAttributes.Remove(inputVariable);
    178       }
     143    //  foreach (var evaluationImpactBinding in evaluationImpactBindings) {
     144    //    double evaluationImpact = (double)((Literal)evaluationImpactBinding.Get("EvaluationImpact")).Value;
     145    //    object inputVariable = evaluationImpactBinding.Get("InputVariable");
     146    //    if (!IsAlmost(evaluationImpact, 0.0)) {
     147    //      if (inputVariableAttributes.ContainsKey(inputVariable) && inputVariableAttributes[inputVariable].Get("EvaluationImpact") == null)
     148    //        inputVariableAttributes[inputVariable].Set("EvaluationImpact", evaluationImpact);
     149    //    } else inputVariableAttributes.Remove(inputVariable);
     150    //  }
    179151
    180       foreach (var evaluationImpactBinding in evaluationImpactBindings) {
    181         double evaluationImpact = (double)((Literal)evaluationImpactBinding.Get("EvaluationImpact")).Value;
    182         object inputVariable = evaluationImpactBinding.Get("InputVariable");
    183         if (!IsAlmost(evaluationImpact, 0.0)) {
    184           if (inputVariableAttributes.ContainsKey(inputVariable) && inputVariableAttributes[inputVariable].Get("EvaluationImpact") == null)
    185             inputVariableAttributes[inputVariable].Set("EvaluationImpact", evaluationImpact);
    186         } else inputVariableAttributes.Remove(inputVariable);
    187       }
    188 
    189       return inputVariableAttributes.Values;
    190     }
     152    //  return inputVariableAttributes.Values;
     153    //}
    191154
    192155    private bool IsAlmost(double x, double y) {
     
    199162
    200163    private void LoadModelAttributes() {
    201       this.ordinalVariables =
    202         store
    203           .Query(
    204             "?ModelAttribute <" + Ontology.InstanceOf + "> <" + Ontology.TypeModelAttribute + "> ." + Environment.NewLine +
    205             "?ModelAttribute <" + Ontology.InstanceOf + "> <" + Ontology.TypeOrdinalAttribute + "> .", 0, 100)
    206           .Select(s => ((Entity)s.Get("ModelAttribute")).Uri.Replace(Ontology.CedmaNameSpace, ""))
    207           .Distinct()
    208           .ToArray();
    209       this.categoricalVariables =
    210         store
    211           .Query(
    212             "?ModelAttribute <" + Ontology.InstanceOf + "> <" + Ontology.TypeModelAttribute + "> ." + Environment.NewLine +
    213             "?ModelAttribute <" + Ontology.InstanceOf + "> <" + Ontology.TypeCategoricalAttribute + "> .", 0, 100)
    214           .Select(s => ((Entity)s.Get("ModelAttribute")).Uri.Replace(Ontology.CedmaNameSpace, ""))
    215           .Distinct()
    216           .ToArray();
     164      ordinalVariables = database.GetAllResults().Select(r => r.Name);
     165      categoricalVariables = new string[] { "TargetVariable" };
    217166    }
    218167
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Server/3.3/Server.cs

    r2185 r2190  
    5555
    5656    internal void Connect(string serverUrl) {
    57       DatabaseService database = new DatabaseService(sqlServerCompactConnectionString)
     57      DatabaseService database = new DatabaseService(sqlServerCompactConnectionString);
    5858      dispatcher = new SimpleDispatcher(database);
    5959      IGridServer gridServer = null;
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.Modeling.SQLServerCompactBackend/3.2/DataObjects/Model.cs

    r2185 r2190  
    88namespace HeuristicLab.Modeling.SQLServerCompactBackend {
    99  [Table(Name = "Model")]
    10   public class Model {
     10  public class Model : IModel{
    1111    public Model() {
    1212      targetVariable = default(EntityRef<Variable>);
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.Modeling.SQLServerCompactBackend/3.2/DataObjects/Result.cs

    r2185 r2190  
    88namespace HeuristicLab.Modeling.SQLServerCompactBackend {
    99  [Table(Name = "Result")]
    10   public class Result {
     10  public class Result : IResult {
    1111    public Result() {
    1212    }
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.Modeling.SQLServerCompactBackend/3.2/DatabaseService.cs

    r2185 r2190  
    178178    }
    179179
    180     #endregion
    181 
     180    public IEnumerable<IResult> GetAllResults() {
     181      throw new NotImplementedException();
     182    }
     183
     184    #endregion
     185
     186    #region ModelResult
     187    public IEnumerable<IModelResult> GetModelResults(IModel model) {
     188      throw new NotImplementedException();
     189    }
     190    #endregion
     191
     192    #region Model
     193    public IEnumerable<IDatabaseModel> GetAllModels() {
     194      using (ModelingDataContext ctx = new ModelingDataContext(connection)) {
     195        return ctx.Models;
     196      }
     197    }
     198    #endregion
    182199
    183200  }
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.Modeling/3.2/HeuristicLab.Modeling-3.2.csproj

    r2185 r2190  
    8383  <ItemGroup>
    8484    <Compile Include="ClassificationProblemInjector.cs" />
     85    <Compile Include="IDatabaseModel.cs" />
     86    <Compile Include="IResult.cs" />
     87    <Compile Include="IModelResult.cs" />
    8588    <Compile Include="IModelingDatabase.cs" />
    8689    <Compile Include="VariableImpactCalculatorBase.cs" />
Note: See TracChangeset for help on using the changeset viewer.