Changeset 2207 for branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3
- Timestamp:
- 07/29/09 14:44:07 (15 years ago)
- 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 108 108 </ItemGroup> 109 109 <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>114 110 <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj"> 115 111 <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project> -
branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3/Results.cs
r2194 r2207 58 58 } 59 59 60 private string[] multiDimensionalOrdinalVariables = new string[] { "VariableImpacts: EvaluationImpact", "VariableImpacts: QualityImpact" };60 private string[] multiDimensionalOrdinalVariables; 61 61 public string[] MultiDimensionalOrdinalVariables { 62 62 get { return multiDimensionalOrdinalVariables; } … … 74 74 public Results(IModelingDatabase database) { 75 75 this.database = database; 76 multiDimensionalOrdinalVariables = database.GetAllResultsForInputVariables().Select(x => "VariableImpacts: "+ x.Name).ToArray(); 76 77 } 77 78 … … 93 94 modelEntry.Set("PersistedData", model.Data); 94 95 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); 95 107 entries.Add(modelEntry); 96 108 } … … 100 112 return entries; 101 113 } 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 //}149 114 150 115 private bool IsAlmost(double x, double y) { -
branches/HeuristicLab.Modeling Database Backend/sources/HeuristicLab.CEDMA.Core/3.3/TableResultsView.cs
r2139 r2207 10 10 using HeuristicLab.CEDMA.Core; 11 11 using HeuristicLab.PluginInfrastructure; 12 using HeuristicLab.CEDMA.DB.Interfaces;13 12 14 13 namespace HeuristicLab.CEDMA.Core { … … 70 69 DataGridView.HitTestInfo hitInfo = dataGridView.HitTest(e.X, e.Y); 71 70 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")); 74 72 PluginManager.ControlManager.ShowControl(model.CreateView()); 75 73 }
Note: See TracChangeset
for help on using the changeset viewer.