Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/29/09 14:44:07 (15 years ago)
Author:
mkommend
Message:

first stable version of CEDMA with new database backend (ticket #712)

Location:
branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3/HeuristicLab.CEDMA.Core-3.3.csproj

    r2194 r2207  
    108108  </ItemGroup>
    109109  <ItemGroup>
    110     <ProjectReference Include="..\..\HeuristicLab.CEDMA.DB.Interfaces\3.3\HeuristicLab.CEDMA.DB.Interfaces-3.3.csproj">
    111       <Project>{4F9BB789-D561-436B-B226-2BF44B7D0804}</Project>
    112       <Name>HeuristicLab.CEDMA.DB.Interfaces-3.3</Name>
    113     </ProjectReference>
    114110    <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj">
    115111      <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3/Results.cs

    r2194 r2207  
    5858    }
    5959
    60     private string[] multiDimensionalOrdinalVariables = new string[] { "VariableImpacts: EvaluationImpact", "VariableImpacts: QualityImpact" };
     60    private string[] multiDimensionalOrdinalVariables;
    6161    public string[] MultiDimensionalOrdinalVariables {
    6262      get { return multiDimensionalOrdinalVariables; }
     
    7474    public Results(IModelingDatabase database) {
    7575      this.database = database;
     76      multiDimensionalOrdinalVariables = database.GetAllResultsForInputVariables().Select(x => "VariableImpacts: "+ x.Name).ToArray();
    7677    }
    7778
     
    9394        modelEntry.Set("PersistedData", model.Data);
    9495        modelEntry.Set("TargetVariable", model.TargetVariable.Name);
     96        Dictionary<HeuristicLab.Modeling.Database.IVariable, ResultsEntry> inputVariableResultsEntries =
     97          new Dictionary<HeuristicLab.Modeling.Database.IVariable, ResultsEntry>();
     98
     99        foreach (IInputVariableResult inputVariableResult in database.GetInputVariableResults(model)) {
     100          if (!inputVariableResultsEntries.ContainsKey(inputVariableResult.Variable)) {
     101            inputVariableResultsEntries[inputVariableResult.Variable] = new ResultsEntry();
     102            inputVariableResultsEntries[inputVariableResult.Variable].Set("InputVariableName", inputVariableResult.Variable.Name);
     103            }
     104           inputVariableResultsEntries[inputVariableResult.Variable].Set(inputVariableResult.Result.Name, inputVariableResult.Value);
     105        }
     106        modelEntry.Set("VariableImpacts", inputVariableResultsEntries.Values);
    95107        entries.Add(modelEntry);
    96108      }
     
    100112      return entries;
    101113    }
    102 
    103     //private IEnumerable<ResultsEntry> SelectVariableImpacts(string modelUri) {
    104     //  var inputVariableNameBindings = store.Query(
    105     //      "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
    106     //      "?InputVariable <" + Ontology.Name + "> ?InputName .",
    107     //      0, PAGE_SIZE);
    108 
    109     //  var qualityImpactBindings = store.Query(
    110     //      "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
    111     //      "?InputVariable <" + Ontology.QualityImpact + "> ?QualityImpact .",
    112     //      0, PAGE_SIZE);
    113 
    114     //  var evaluationImpactBindings = store.Query(
    115     //       "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
    116     //       "?InputVariable <" + Ontology.EvaluationImpact + "> ?EvaluationImpact .",
    117     //       0, PAGE_SIZE);
    118     //  Dictionary<object, ResultsEntry> inputVariableAttributes = new Dictionary<object, ResultsEntry>();
    119 
    120     //  foreach (var inputVariableNameBinding in inputVariableNameBindings) {
    121     //    object inputVariable = inputVariableNameBinding.Get("InputVariable");
    122     //    object name = ((Literal)inputVariableNameBinding.Get("InputName")).Value;
    123     //    if (!inputVariableAttributes.ContainsKey(inputVariable)) {
    124     //      inputVariableAttributes[inputVariable] = new ResultsEntry();
    125     //      inputVariableAttributes[inputVariable].Set("InputVariableName", name);
    126     //    }
    127     //  }
    128 
    129     //  foreach (var qualityImpactBinding in qualityImpactBindings) {
    130     //    double qualityImpact = (double)((Literal)qualityImpactBinding.Get("QualityImpact")).Value;
    131     //    object inputVariable = qualityImpactBinding.Get("InputVariable");
    132     //    if (!IsAlmost(qualityImpact, 1.0)) {
    133     //      if (inputVariableAttributes[inputVariable].Get("QualityImpact") == null)
    134     //        inputVariableAttributes[inputVariable].Set("QualityImpact", qualityImpact);
    135     //    } else inputVariableAttributes.Remove(inputVariable);
    136     //  }
    137 
    138     //  foreach (var evaluationImpactBinding in evaluationImpactBindings) {
    139     //    double evaluationImpact = (double)((Literal)evaluationImpactBinding.Get("EvaluationImpact")).Value;
    140     //    object inputVariable = evaluationImpactBinding.Get("InputVariable");
    141     //    if (!IsAlmost(evaluationImpact, 0.0)) {
    142     //      if (inputVariableAttributes.ContainsKey(inputVariable) && inputVariableAttributes[inputVariable].Get("EvaluationImpact") == null)
    143     //        inputVariableAttributes[inputVariable].Set("EvaluationImpact", evaluationImpact);
    144     //    } else inputVariableAttributes.Remove(inputVariable);
    145     //  }
    146 
    147     //  return inputVariableAttributes.Values;
    148     //}
    149114
    150115    private bool IsAlmost(double x, double y) {
  • branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3/TableResultsView.cs

    r2139 r2207  
    1010using HeuristicLab.CEDMA.Core;
    1111using HeuristicLab.PluginInfrastructure;
    12 using HeuristicLab.CEDMA.DB.Interfaces;
    1312
    1413namespace HeuristicLab.CEDMA.Core {
     
    7069        DataGridView.HitTestInfo hitInfo = dataGridView.HitTest(e.X, e.Y);
    7170        ResultsEntry entry = (ResultsEntry)dataGridView.Rows[hitInfo.RowIndex].Tag;
    72         string serializedData =  (string)entry.Get(Ontology.SerializedData.Uri.Replace(Ontology.CedmaNameSpace, ""));
    73         var model = (IItem)PersistenceManager.RestoreFromGZip(Convert.FromBase64String(serializedData));
     71        var model = (IItem)PersistenceManager.RestoreFromGZip((byte[])entry.Get("PersistedData"));
    7472        PluginManager.ControlManager.ShowControl(model.CreateView());
    7573      }
Note: See TracChangeset for help on using the changeset viewer.