Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/14/09 20:48:04 (15 years ago)
Author:
gkronber
Message:
  • re-enabled security for all WCF services;
  • debugged rdf queries
  • added tracing for WCF services
  • implemented simple version of quality based dispatching
  • extended ontology to include a number of predefined model-attributes (quality, size, evaluated solutions etc.)

ticket: #419 (Refactor CEDMA plugins)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Executer.cs

    r1116 r1130  
    103103
    104104    private void StoreResults(Execution finishedExecution, ProcessingEngine finishedEngine) {
    105       Entity modelEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
    106       store.Add(new Statement(modelEntity, Ontology.PredicateInstanceOf, Ontology.TypeGeneticProgrammingFunctionTree));
    107       store.Add(new Statement(finishedExecution.DataSetEntity, Ontology.PredicateHasModel, modelEntity));
    108       StoreModelAttribute(modelEntity, "TargetVariable", finishedExecution.TargetVariable);
     105      Entity model = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
     106      store.Add(new Statement(model, Ontology.PredicateInstanceOf, Ontology.TypeGeneticProgrammingFunctionTree));
     107      store.Add(new Statement(finishedExecution.DataSetEntity, Ontology.PredicateHasModel, model));
     108      StoreModelAttribute(model, Ontology.TargetVariable, finishedExecution.TargetVariable);
    109109      Scope bestModelScope = finishedEngine.GlobalScope.GetVariableValue<Scope>("BestValidationSolution", false);
    110       StoreModelAttribute(modelEntity, "TrainingMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("Quality", false).Data);
    111       StoreModelAttribute(modelEntity, "ValidationMeanSquaredError", bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data);
    112       StoreModelAttribute(modelEntity, "TrainingMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("TrainingMAPE", false).Data);
    113       StoreModelAttribute(modelEntity, "ValidationMeanAbsolutePercentageError", bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data);
    114       StoreModelAttribute(modelEntity, "TreeSize", bestModelScope.GetVariableValue<IntData>("TreeSize", false).Data);
    115       StoreModelAttribute(modelEntity, "TreeHeight", bestModelScope.GetVariableValue<IntData>("TreeHeight", false).Data);
    116       StoreModelAttribute(modelEntity, "EvaluatedSolutions", bestModelScope.GetVariableValue<IntData>("EvaluatedSolutions", false).Data);
     110      StoreModelAttribute(model, Ontology.TrainingMeanSquaredError, bestModelScope.GetVariableValue<DoubleData>("Quality", false).Data);
     111      StoreModelAttribute(model, Ontology.ValidationMeanSquaredError, bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data);
     112      StoreModelAttribute(model, Ontology.TrainingMeanAbsolutePercentageError, bestModelScope.GetVariableValue<DoubleData>("TrainingMAPE", false).Data);
     113      StoreModelAttribute(model, Ontology.ValidationMeanAbsolutePercentageError, bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data);
     114      StoreModelAttribute(model, Ontology.TreeSize, bestModelScope.GetVariableValue<IntData>("TreeSize", false).Data);
     115      StoreModelAttribute(model, Ontology.TreeHeight, bestModelScope.GetVariableValue<IntData>("TreeHeight", false).Data);
     116      StoreModelAttribute(model, Ontology.EvaluatedSolutions, bestModelScope.GetVariableValue<IntData>("EvaluatedSolutions", false).Data);
    117117       
    118118      byte[] serializedModel = PersistenceManager.SaveToGZip(bestModelScope.GetVariableValue("FunctionTree", false));
    119       store.Add(new Statement(modelEntity, Ontology.PredicateSerializedData, new Literal(Convert.ToBase64String(serializedModel))));
     119      store.Add(new Statement(model, Ontology.PredicateSerializedData, new Literal(Convert.ToBase64String(serializedModel))));
     120   }
    120121
    121     }
    122 
    123     private void StoreModelAttribute(Entity model, string name, object value) {
    124       Entity attr = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
    125       store.Add(new Statement(model, Ontology.PredicateModelAttribute, attr));
    126       store.Add(new Statement(attr, Ontology.PredicateModelAttributeName, new Literal(name)));
    127       store.Add(new Statement(attr, Ontology.PredicateModelAttributeValue, new Literal(value)));
    128       store.Add(new Statement(attr, Ontology.PredicateModelAttributeType, Ontology.TypeOrdinalAttribute));
     122    private void StoreModelAttribute(Entity model, Entity predicate, object value) {
     123      store.Add(new Statement(model, predicate, new Literal(value)));
    129124    }
    130125  }
Note: See TracChangeset for help on using the changeset viewer.