Changeset 1151
- Timestamp:
- 01/15/09 20:04:46 (16 years ago)
- Location:
- branches/CEDMA-Refactoring-Ticket419
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Charting/BubbleChart.cs
r1109 r1151 116 116 double minSize = 1; 117 117 try { 118 if (sizeDimension != null && Results.OrdinalVariables.Contains(sizeDimension)) {118 if (sizeDimension != null && results.OrdinalVariables.Contains(sizeDimension)) { 119 119 var sizes = records 120 120 .Select(x => Convert.ToDouble(x.Get(sizeDimension))) -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/Results.cs
r1129 r1151 37 37 namespace HeuristicLab.CEDMA.Core { 38 38 public class Results : ItemBase { 39 public static string[] CategoricalVariables { 40 get { return new string[] { "TargetVariable" }; } 39 private string[] categoricalVariables = null; 40 public string[] CategoricalVariables { 41 get { 42 if (categoricalVariables == null) { 43 LoadModelAttributes(); 44 } 45 return categoricalVariables; 46 } 41 47 } 42 48 43 public static string[] OrdinalVariables { 44 get { return new string[] { "ValidationMeanAbsolutePercentageError" }; } 49 private string[] ordinalVariables = null; 50 public string[] OrdinalVariables { 51 get { 52 if (ordinalVariables == null) { 53 LoadModelAttributes(); 54 } 55 return ordinalVariables; 56 } 45 57 } 46 58 … … 73 85 private IEnumerable<ResultsEntry> SelectRows() { 74 86 if (store == null) yield break; 87 entries = new List<ResultsEntry>(); 88 var results = store.Query("<"+dataSetEntity + "> <" + Ontology.PredicateHasModel + "> ?Model ." + Environment.NewLine + 89 "?Model ?Attribute ?Value .") 90 .GroupBy(x=>(Entity)x.Get("Model")); 91 foreach (var modelBindings in results) { 92 ResultsEntry entry = new ResultsEntry(modelBindings.Key.Uri); 93 foreach (var binding in modelBindings) { 94 if (binding.Get("Value") is Literal) { 95 string name = ((Entity)binding.Get("Attribute")).Uri.Replace(Ontology.CedmaNameSpace, ""); 96 if (entry.Get(name) == null) { 97 object value = ((Literal)binding.Get("Value")).Value; 98 entry.Set(name, value); 99 } 100 } 101 } 102 entries.Add(entry); 103 yield return entry; 104 } 75 105 76 //var models = store.Select(new Statement(dataSetEntity, Ontology.PredicateHasModel, Ontology.AnyEntity)); 77 78 ////var results = store.Select(new Statement(dataSetEntity, Ontology.PredicateHasModel, Ontology.AnyEntity)) 79 //// .SelectMany(x => store.Select(new SelectFilter( 80 //// new Entity[] { (Entity)x.Property }, 81 //// new Entity[] { Ontology.PredicateModelAttribute }, 82 //// new Resource[] { Ontology.AnyEntity }))) 83 //// .SelectMany(x => 84 //// store.Select( 85 //// new SelectFilter( 86 //// new Entity[] { (Entity)x.Property }, 87 //// new Entity[] { Ontology.PredicateModelAttributeName }, 88 //// new Entity[] { Ontology.AnyEntity })).Select(y => 89 //// new { 90 //// Model = x.Subject, 91 //// Attribute = (Entity)x.Property, 92 //// AttributeName = (Literal)y.Property 93 //// })) 94 //// .SelectMany(x => 95 //// store.Select( 96 //// new Statement(x.Attribute, Ontology.PredicateModelAttributeValue, Ontology.AnyEntity)) 97 //// .Select(y => 98 //// new { 99 //// Model = x.Model.Uri, 100 //// AttributeName = x.AttributeName.Value, 101 //// AttributeValue = ((Literal)y.Property).Value 102 //// })).GroupBy(x => x.Model); 103 104 //entries = new List<ResultsEntry>(); 105 //foreach (var model in models) { 106 // var attributes = store.Select(new Statement((Entity)model.Property, Ontology.PredicateModelAttribute, Ontology.AnyEntity)); 107 108 // foreach (var attr in attributes) { 109 // var namesAndValues = store 110 // .Select(new SelectFilter(new Entity[] { (Entity)attr.Property }, 111 // new Entity[] { Ontology.PredicateModelAttributeName, Ontology.PredicateModelAttributeValue }, 112 // new Entity[] { Ontology.AnyEntity })); 113 // } 114 //} 115 116 //foreach (var row in results) { 117 // ResultsEntry entry = new ResultsEntry(row.First().Model); 118 // foreach (var attr in row) { 119 // entry.Set((string)attr.AttributeName, attr.AttributeValue); 120 // } 121 // entries.Add(entry); 122 // yield return entry; 123 //} 124 125 //FireChanged(); 126 //cached = true; 106 FireChanged(); 107 cached = true; 127 108 } 128 109 129 110 internal IEnumerable<string> SelectModelAttributes() { 130 if (store == null) yield break; 111 return CategoricalVariables.Concat(OrdinalVariables); 112 } 131 113 132 //var attributeNames = 133 // store.Select(new Statement(Ontology.AnyEntity, Ontology.PredicateModelAttributeName, Ontology.AnyEntity)) 134 // .Select(s => (string)((Literal)s.Property).Value) 135 // .Distinct(); 136 //foreach (var name in attributeNames) { 137 // yield return name; 138 //} 114 private void LoadModelAttributes() { 115 this.ordinalVariables = 116 store.Query("?ModelAttribute <" + Ontology.PredicateInstanceOf + "> <" + Ontology.TypeOrdinalAttribute + "> .") 117 .Select(s => ((Entity)s.Get("ModelAttribute")).Uri.Replace(Ontology.CedmaNameSpace, "")) 118 .ToArray(); 119 this.categoricalVariables = 120 store.Query("?ModelAttribute <" + Ontology.PredicateInstanceOf + "> <" + Ontology.TypeCategoricalAttribute + "> .") 121 .Select(s => ((Entity)s.Get("ModelAttribute")).Uri.Replace(Ontology.CedmaNameSpace, "")) 122 .ToArray(); 139 123 } 140 124 } -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.DB.Interfaces/Entity.cs
r552 r1151 35 35 } 36 36 37 public override string ToString() { 38 return Uri; 39 } 40 37 41 public override bool Equals(object obj) { 38 42 if(this == obj) return true; -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Dispatcher.cs
r1130 r1151 69 69 var modelMAPE = new HeuristicLab.CEDMA.DB.Interfaces.Variable("ModelMAPE"); 70 70 71 //var query = new Statement[] {72 // new Statement(dataSetEntity, Ontology.PredicateHasModel, modelVar),73 // new Statement(modelVar, Ontology.TargetVariable, targetVar),74 // new Statement(modelVar, Ontology.ValidationMeanAbsolutePercentageError, modelMAPE)75 //};76 77 71 var query = "<" + dataSetEntity.Uri + "> <" + Ontology.PredicateHasModel.Uri + "> ?Model ." + Environment.NewLine + 78 72 "?Model <" + Ontology.TargetVariable.Uri + "> ?TargetVariable ." + Environment.NewLine + … … 100 94 int nConfigurations = utilization.Length; 101 95 for (int j = nConfigurations - 1; j > nConfigurations * 0.8; j--) { 102 int targetVariable = dataSet.Problem.AllowedTargetVariables[ j];96 int targetVariable = dataSet.Problem.AllowedTargetVariables[idx[j]]; 103 97 IEngine engine = CreateEngine(dataSet.Problem, targetVariable); 104 98 if (engine != null) { -
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.Grid/ServerForm.cs
r1130 r1151 66 66 internalHost = new ServiceHost(jobStore, new Uri(internalAddressTextBox.Text)); 67 67 ServiceThrottlingBehavior throttlingBehavior = new ServiceThrottlingBehavior(); 68 throttlingBehavior.MaxConcurrentSessions = 20;68 throttlingBehavior.MaxConcurrentSessions = 100; 69 69 internalHost.Description.Behaviors.Add(throttlingBehavior); 70 70 try {
Note: See TracChangeset
for help on using the changeset viewer.